服务器之家:专注于服务器技术及软件下载分享
分类导航

Linux|Centos|Ubuntu|系统进程|Fedora|注册表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服务器之家 - 服务器系统 - Centos - Centos5.2配置LAMP与Centos5.3配置LAMP(41)

Centos5.2配置LAMP与Centos5.3配置LAMP(41)

2019-10-11 14:12Centos教程网 Centos

DirectoryIndex index.php index.html index.htm 找到这一段: # AllowOverride controls what directives may be placed in .htaccess files. # It can be All, None, or any combination of the keywords: #


DirectoryIndex index.php index.html index.htm 
找到这一段: 
# AllowOverride controls what directives may be placed in .htaccess files. 
# It can be "All", "None", or any combination of the keywords: 
# Options FileInfo AuthConfig Limit 

AllowOverride none 
更改为AllowOverride all 
允许apache rewrite 
保存httpd.conf,退出。 
# /usr/local/apache2/bin/apachectl restart //重启 Apache 
这时会出现错误: 
/usr/local/apache2/bin/apachectl start 
httpd: Syntax error on line 107 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied 
不急,我们慢慢解决。 
这个Permission denied问题,在centos 5下面一般是Selinux引起的,作为生产用服务器,我建议你千万别草率地关掉Selinux一了百了。就像家里的防盗网,阻碍了你的猫自由进出窗户,你不能为了猫方便,就把防盗网简单拆除是同样的道理。我看见网上许多人建议把Selinux简单关闭来解决这个问题,这是削足适履的做法,不值得提倡。 
我们可以这样操作: 
# audit2allow -a //查看究竟问题出在什么地方 

allow unconfined_t usr_t:file execmod; 
allow useradd_t var_log_t:file { read write }; 

延伸 · 阅读

精彩推荐