④启动并检查安装结果
匿名 · 更新于 2017/6/30
[root@iZ2zef32qxgaqdo7w2m844Z ~]# /application/nginx/sbin/nginx -t //启动服务前检查语法非常重要,可以防止因配置错误导致网站重启或重新加载配置等对用户的影响
nginx: the configuration file /application/nginx-1.12.0/--with-http_stub_status_module/conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-1.12.0/--with-http_stub_status_module/conf/nginx.conf test is successful
[root@iZ2zef32qxgaqdo7w2m844Z ~]# /application/nginx/sbin/nginx //启动Nginx
[root@iZ2zef32qxgaqdo7w2m844Z ~]# lsof -i :80 //查看Nginx服务对应的端口是否成功启动
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
AliYunDun 1203 root 18u IPv4 8550 0t0 TCP 172.17.138.113:53776->140.205.140.205:http (ESTABLISHED)
nginx 7477 root 6u IPv4 35821 0t0 TCP *:http (LISTEN)
nginx 7478 nginx 6u IPv4 35821 0t0 TCP *:http (LISTEN)
到此为止,如果没有其他问题,应该Nginx网站可以通过IP访问了
