VPS侦探论坛

 找回密码
 注册
查看: 11082|回复: 2

安装lnmpa 是出现nginx 502 Bad Gateway错误的一个解决办法

[复制链接]
发表于 2011-9-12 23:02:48 | 显示全部楼层 |阅读模式

今天在虚拟机上安装了centos 5.6 测试lampa 0.7,一切顺利,
最后一步重新启动apache报如下错误:
httpd: Syntax error on line 53 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied



解决办法:
原因是Linux有一个SELinux保护模式引起的。
1关闭SELINUX的方法:
vi /etc/selinux/config 将SELINUX=enforcing 改成SELINUX=disabled  需要重启

2不关闭SELINUX的方法:
# setenforce 0
# chcon -c -v -R -u system_u -r object_r -t textrel_shlib_t /usr/local/apache/modules/libphp5.so
# service httpd restart
# setenforce 1
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-3-6 12:59:34 | 显示全部楼层


设置了

[root@AY130306101818270a4b ~]# /root/lnmpa restart
=========================================================================
Manager for LNMPA V0.9  ,  Written by Licess
=========================================================================
LNMPA is a tool to auto-compile & install Nginx+MySQL+PHP+Apache on Linux
This script is a tool to Manage status of LNMPA
For more information please visit http://www.lnmp.org


Usage: /root/lnmpa {start|stop|reload|restart|kill|status}
=========================================================================
Stoping LNMP...
Nginx program is stop
httpd: Syntax error on line 343 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: cannot open shared object file: No such file or directory
MySQL program is not runing!
Starting LNMPA...
Nginx start successfully!
httpd: Syntax error on line 343 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: cannot open shared object file: No such file or directory
Starting MySQL SUCCESS!
MySQL start successfully!


安装教程上面的两种设置了,还是502,也重启过服务器了
该怎么解决呢
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2013-3-6 13:29:50 | 显示全部楼层

找到问题了 我升级到php5.4  /usr/local/php/里面就会只有一个文件夹     现在升级到5.3.6就正常了
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-16 19:04 , Processed in 0.025797 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表