PHP
nginx
-
设置防火墙规则,打开端口
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --zone=public --add-port=80/tcp --permanent //–permanent永久生效,没有此参数重启后失效
sudo firewall-cmd --reload -
关闭SELinux
查看当前selinux的状态。 /usr/sbin/sestatus
将SELINUX=enforcing修改为SELINUX=disabled状态。
sudo vi /etc/selinux/config
#SELINUX=enforcing
SELINUX=disabled
重启生效。 -
清理默认配置
nginx安装测试无误后,需清理(/etc/nginx/nginx.conf及/etc/nginx/nginx.conf.default)中的默认server配置。