linux nginx service nginx restart [fail]

命令: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或者with php5-fpm

不要俩个都用就能够了。

于是凝视掉fastcgi_pass 这一行

service nginx restart 就ok了。这应该是上次微信php配置的时候遗留下来的问题。

时间: 2024-10-10 22:45:01

linux nginx service nginx restart [fail]的相关文章

[ubuntu] service apache2 restart [fail]

$ /etc/init.d/apache2 restart * Restarting web server apache2 [fail] 解决办法4步走: 1. sudo /etc/init.d/apache2 stop 2. sudo killall apache2 3. sudo netstat -l|grep www # 确认没有服务占用80端口 4. sudo /etc/init.d/apache2 restart

Linux命令:nginx及php和mysql安装使用

首先下载mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz lftp [email protected]:/> get mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz 314592758 bytes transferred in 28 seconds (10.66M/s) lftp [email protected]:/> quit [[email protected] ~]# ls anaconda-ks.cfg  Down

Linux下设置Nginx开机自启

1.本地环境 [[email protected] ~]#cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) 2.在/etc/init.d创建nginx文件,并添加如下内容 [[email protected] ~]# vim /etc/init.d/nginx 脚本内容如下: #!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chk

linux安装php nginx mysql

linux装软件方式: systemctl status firewalld.service 查看防火墙systemctl stop firewalld.service systemctl disable firewalld.service 开机 防火墙 不自启 ###Nginx#######安装篇############rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx

在centos下启动nginx出现Failed to start nginx.service:unit not found

错误的原因就是没有添加nginx服务,所以启动失败. 解决方法: 1.    在/root/etc/init.d/目录下新建文件,文件名为nginx 或者用命令在根目录下执行:# vim /etc/init.d/nginx    (注意vim旁边有一个空格) 2.    插入以下代码  #!/bin/sh # nginx - this script starts and stops the nginx daemin # # chkconfig: - 85 15 # description: Ng

linux下安装nginx,php,mysql

首先如果yum源中如果没有nginx,需要自己添加资源库 先安装nginx的yum源 http://nginx.org/en/linux_packages.html#stable 找到链接,安装: rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm 查看: yum info nginx 安装: yum install nginx service ng

CentOS7+Nginx设置Systemctl restart nginx.service服务

centos 7上是用Systemd进行系统初始化的,Systemd 是 Linux 系统中最新的初始化系统(init),它主要的设计目标是克服 sysvinit 固有的缺点,提高系统的启动速度.关于Systemd的详情介绍在这里. Systemd服务文件以.service结尾,比如现在要建立nginx为开机启动,如果用yum install命令安装的,yum命令会自动创建nginx.service文件,直接用命令 1 systemcel enable nginx.service 设置开机启动即

添加nginx为系统服务(service nginx start/stop/restart)

1.在/etc/init.d/目录下编写脚本,名为nginx 1 #!/bin/sh 2 # 3 # nginx - this script starts and stops the nginx daemon 4 # 5 # chkconfig: - 85 15 6 # description: Nginx is an HTTP(S) server, HTTP(S) reverse \ 7 # proxy and IMAP/POP3 proxy server 8 # processname: n

把Nginx加为系统服务(service nginx start/stop/restart)

1.编写脚本,名为nginx #!/bin/sh # # nginx - this script starts and stops the nginx daemon # # chkconfig:   - 85 15 # description: Nginx is an HTTP(S) server, HTTP(S) reverse \ #               proxy and IMAP/POP3 proxy server # processname: nginx # config: