不能启动Apache,说HTML文件夹不是目录

当我尝试启动httpd时:

[root@cameronaziz www]# service httpd start Starting httpd: Syntax error on line 292 of /etc/httpd/conf/httpd.conf: DocumentRoot must be a directory [FAILED] 

我的configuration292行:

 DocumentRoot "/var/www/html" 

并列出www目录:

 [root@cameronaziz www]# ll total 16 drwxr-xr-x. 2 root root 4096 Feb 13 14:33 cgi-bin drwxr-xr-x. 3 root root 4096 Jul 11 21:03 error drwxrwxrwx. 9 root 6226 4096 Aug 2 14:02 html drwxr-xr-x. 3 root root 4096 Jul 11 21:17 icons 

 [root@cameronaziz ~]# ls -laZ /var/www/html/ drwxrwxrwx. apache 6226 unconfined_u:object_r:admin_home_t:s0 . drwxr-xr-x. root root system_u:object_r:httpd_sys_content_t:s0 .. -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 authorize.php -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 CHANGELOG.txt -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 COPYRIGHT.txt -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 cron.php -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 .gitignore -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 .htaccess drwxr-xr-x. 6226 6226 unconfined_u:object_r:admin_home_t:s0 includes -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 index.php -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 INSTALL.mysql.txt -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 INSTALL.pgsql.txt -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 install.php -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 INSTALL.sqlite.txt -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 INSTALL.txt -rw-rw-r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 LICENSE.txt -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 MAINTAINERS.txt drwxr-xr-x. 6226 6226 unconfined_u:object_r:admin_home_t:s0 misc drwxr-xr-x. 6226 6226 unconfined_u:object_r:admin_home_t:s0 modules drwxr-xr-x. 6226 6226 unconfined_u:object_r:admin_home_t:s0 profiles -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 README.txt -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 robots.txt drwxr-xr-x. 6226 6226 unconfined_u:object_r:admin_home_t:s0 scripts drwxr-xr-x. 6226 6226 unconfined_u:object_r:admin_home_t:s0 sites -rw-r--r--. root root unconfined_u:object_r:admin_home_t:s0 test.php drwxr-xr-x. 6226 6226 unconfined_u:object_r:admin_home_t:s0 themes -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 update.php -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 UPGRADE.txt -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 web.config -rw-r--r--. 6226 6226 unconfined_u:object_r:admin_home_t:s0 xmlrpc.php 

我的configuration有什么问题,不会让apache启动? 我正在运行CentOS。

 drwxrwxrwx. apache 6226 unconfined_u:object_r:admin_home_t:s0 . 

您的DocumentRoot被设置为错误的安全上下文(admin_home_t)。

运行以下命令并重试:

 # chcon -R -h -t httpd_sys_content_t /var/www/html/