linux nginx 启动脚本 [root@webtest76 ~]# vi /etc/init.d/nginx #!/bin/bash # nginx Startup script for the Nginx HTTP Server # this script create it by jackbillow at . # it is v. version. # if you find any errors on this scripts,please contact jackbillow.
命令:nginx -t 查看失败原因: nginx: [emerg] "fastcgi_pass" directive is duplicate in /etc/nginx/sites-enabled/default:61 nginx: configuration file /etc/nginx/nginx.conf test failed 然后找到这样的原因的解决的方法 cd /etc/nginx/site-enabaled/default With php5-cgi alone或者
本文要记述的是最简单的Ubuntu下开机自启 nginx的脚本 这里将nginx装在了/usr/local/nginx目录下,nginx本身没有注册成服务,所以直接使用服务开机自启是不行的,除非自己写nginx.service脚本,这不在本文范畴内. 创建脚本文件 $ sudo vim /etc/init.d/nginx.sh 脚本内容,注意替换root密码.nginx执行文件目录和配置文件目录 #!/bin/bash #auto run nginx when system startup su
1.服务权限systemd有系统和用户区分:系统(/user/lib/systemd/system/).用户(/etc/lib/systemd/user/). 一般系统管理员手工创建的单元文件建议存放在/etc/systemd/system/目录下面. 2.创建服务文件 [Unit] Description=nginx - high performance web server Documentation=http://nginx.org/en/docs/ After=network.targe