重新起动APACHE出现:Permission denied(解决)

古城微笑少年丶 2022-08-24 11:55 96阅读 0赞

重新起动APACHE:
# /usr/local/apache2/bin/apachectl start
如果重新起动APACHE出现:
Syntax error . line 232 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server:
/usr/local/apache2/modules/libphp4.so: cannot restore segment prot after reloc: Permission denied
那就要按照下面的方法解决:

1.chcon -t texrel_shlib_t /usr/local/apache2/modules/*.so

2.编辑/etc/selinux/config,找到这段:
# This file controls the state of SELinux . the system.
# SELINUX= can take .e of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing

把 SELINUX=enforcing 注释掉:#SELINUX=enforcing ,然后新加一行为:
SELINUX=disabled
保存,关闭。

编辑/etc/sysconfig/selinux,找到:
# This file controls the state of SELinux . the system.
# SELINUX= can take .e of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing

如果SELINUX已经是 SELINUX=disabled,那么就不用改了,否则就把SELINUX=enforcing 注释掉,新加一行:
SELINUX=disabled
保存,退出。

发表评论

表情:
评论列表 (有 0 条评论,96人围观)

还没有评论,来说两句吧...

相关阅读