nginx 服务配置

centos7 配置nginx服务、开机自动启动

半腔热情 提交于 2019-12-07 21:45:52
环境: centos7、nginx 1.10.1 在以上都已经安装完成,能正常启动之后 配置服务: centos7 的服务管理 与 centos6 发生了一些变化 ,此处参考 http://www.ebanban.com/?p=476 启动、停止、重启、重载、检查服务: 6: service httpd start|stop|restart|reload|status 7: systemctl start|stop|restart|reload|status httpd.service 允许、禁止服务自启动: 6: chkconfig httpd on|off 7: system enable|disable httpd.service 列出服务: 6: chkconfig –list 7: systemctl list-unit-files –type=service 或 ls /etc/systemd/system/*.wants/ 添加服务: 6: chkconfig httpd –add 7: systemctl daemon-reload 可以先通过上述命令查询是否已经配置nginx服务,如果没有 centos7: 服务文件 #systemd 下的 system 或 usr 创建 nginx.service 文件 vim /usr/lib/systemd/system