root@ip-133-101-168-192conf]#servicehttpdrestart
Stoppinghttpd:[FAILED]
Startinghttpd:httpd:Couldnotopenconfigurationfile/etc/httpd/conf/httpd.conf:Permissiondenied
[FAILED]
[root@ip-133-101-168-192conf]#httpd-f/etc/httpd/conf/httpd.conf-t
SyntaxOK
[root@ip-133-101-168-192conf]#chcon-thttpd_config_thttpd.conf
[root@ip-133-101-168-192conf]#ls-Z
-rwxrwxrwxapacheapacheroot:object_r:httpd_config_thttpd.conf
-rwxrwxrwxapacheapachesystem_u:object_r:httpd_config_thttpd.conf.bak
-rwxrwxrwxapacheapachesystem_u:object_r:httpd_config_tmagic
[root@ip-133-101-168-192conf]#servicehttpdrestart
Stoppinghttpd:[FAILED]
Startinghttpd:[OK]

在这里有一个问题,如果你的系统安装了SELinux模块,那么由于安全控制的原因,会出现如下错误:
Startinghttpd:Syntaxerroronline191of/etc/httpd/conf/httpd.conf:
Cannotload/etc/httpd/modules/libphp5.sointoserver:libxml2.so.2:failedtomapsegmentfromsharedobject:Permissiondenied

vi/etc/selinux/config

SELINUX=disabled或setenforce0