CentOS 7安装Nginx

安装参考:

https://www.cnblogs.com/liujuncm5/p/6713784.html

添加为系统服务参考:

https://www.jianshu.com/p/c51c1a0285ff

sudo systemctl start nginx 报错:

Job for nginx.service failed because the control process exited with error code. See “systemctl stat...

解决参考:

https://blog.csdn.net/weixin_44486991/article/details/88246972

将nginx的启动路径加入到环境变量中:

1. 打开环境变量所在的文件:vim /etc/profile
2. 在命令模式下按GG至末尾,加上一行
PATH=$PATH:/usr/local/nginx/sbin
3. 重新加载环境
source profile
完毕!~
就可以使用以下命令对nginx进行启动、暂停、重启等操作

nginx -t
nginx -s reload

具体参考:

https://blog.csdn.net/qq_38253837/article/details/81255483

原文地址:https://www.cnblogs.com/gme5/p/11726927.html