nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
1
2
1
2
3
4
5. 配置防火墙
如果是使用的腾讯服务器,只需要在服务器管理平台添加80端口的安全组就好 服务器则可以设置防火墙:
# 修改防火墙配置:
vi + /etc/sysconfig/iptables
# 添加配置项
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
# 重启防火墙
service iptables restart我本机装的虚拟机,把防火墙停掉了,命令sudo ufw disable
1
2
3
4
5
6
7. 启动nginx
# 方法1
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
# 方法2
cd /usr/local/nginx/sbin
./nginx