nginx和apache2冲突 – 403禁止

我在我的服务器上运行nginx,错误地盯着服务器上的apache2。 这样做后,我的主页上有一个403禁止错误。

我杀了apache2进程,但我仍然面临同样的问题。

Nginx没有运行,但我在我的主页上有这个。

403 Forbidden nginx/1.0.12 

我检查了nginx是否用ps aux |运行 grep nginx,这里是我得到的:

 root 27740 0.0 0.0 3408 764 pts/1 R+ 20:16 0:00 grep --color=auto nginx 

我执行了lsof -Pi | grep LISTEN,在80/443或我的Web端口上不侦听进程

另外/etc/init.d/nginx不存在…

看来nginx没有安装,但我得到了nginx / 1.0.12的403错误。

当你说它没有在你的服务器上运行,输出是什么:

ps aux | grep nginx (任何正在运行的进程?)

 [root@msweb01 ~] $ ps aux | grep "^nginx" nginx 24214 0.0 0.2 1037044 40580 ? S Mar07 0:00 php-fpm: pool default-webnode-check ... nginx 30379 0.0 0.0 60336 4524 ? S 11:18 0:04 nginx: worker process 

lsof -Pi | grep LISTEN (在80/443或您的Web端口上侦听的任何进程?)

 [root@msweb01 ~] $ lsof -Pi | grep LISTEN nginx 1046 root 13u IPv4 35851146 0t0 TCP msweb01.dev:81 (LISTEN) php-fpm 24212 root 7u IPv4 31168887 0t0 TCP localhost:9001 (LISTEN) nginx 30377 nginx 13u IPv4 35851146 0t0 TCP msweb01.dev:81 (LISTEN) 

/etc/init.d/nginx状态 (取决于你系统的initd脚本)

 [root@msweb01 ~] $ /etc/init.d/nginx status nginx (pid 1046) is running... 

正如迈克尔·汉普顿(Michael Hampton)指出的那样,

/etc/init.d/nginx restart来正确地碰撞nginx服务器,然后根据您在nginx.conf中设置的日志选项和相关的configuration,我会尾巴他们,并找出您的networking请求要去的地方。

我可能在这里完全错了,但是最近在Apache和PHP之间testing(和交换)Apache / PHP已经写入模板configurationcaching到文件系统,然后启动nginx(哪些工作正常并按预期的方式工作)稍后在命中模板时抛出错误,因为nginx用户无权访问/更新模板caching。 无论如何可能是要看的东西。