本文摘自PHP中文网,作者(*-*)浩,侵删。
检查配置文件并启动Nginx服务
1.检查配置文件 (推荐学习:nginx教程)
Nginx的主程序提供了“-t”选项来对配置文件进行检查,以便找出不当或错误的配置。
1 2 3 | [root@centos7-1 nginx-1.12.0]# nginx -t
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
|
2.启动Nginx
直接运行Nginx即可启动Nginx服务器
1 2 3 | [root@centos7-1 nginx-1.12.0]# nginx
[root@centos7-1 nginx-1.12.0]# killall -1 nginx
[root@centos7-1 nginx-1.12.0]# killall -3 nginx
|
3.使用Nginx服务脚本
为了使nginx服务的启动、停止、重载等操作更加方便,可以编写nginx服务脚本,并使用chkconfig和systemctl工具来进行管理,这更加符合系统的管理习惯。
阅读剩余部分
相关阅读 >>
在nginx服务器上,master进程和worker进程分别是什么
nginx开源吗
nginx为什么会出现404
nginx添加第三方模块
nginx配置了需要重启吗
nginx如何解决cookie跨域
nginx静态网站不显示图片怎么解决
welcome to nginx是什么意思
nginx_lua能做什么
nginx能干什么
更多相关阅读请进入《nginx》频道 >>
转载请注明出处:木庄网络博客 » 怎么实现nginx访问