Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When I attempt to start 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]

Line 292 of my config:

DocumentRoot "/var/www/html"

And listing www directory:

[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

and

[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

What is wrong with my config that wont let apache start?? Im running CentOS.

share|improve this question
1  
Append the output of ls -laZ /var/www/html/ to your question? –  quanta Aug 3 '12 at 4:18

1 Answer 1

up vote 3 down vote accepted
drwxrwxrwx. apache 6226 unconfined_u:object_r:admin_home_t:s0 .

Your DocumentRoot was set to wrong security context (admin_home_t).

Run the following command and try again:

# chcon -R -h -t httpd_sys_content_t /var/www/html/
share|improve this answer
    
works! thanks.. –  Cameron Aziz Aug 3 '12 at 13:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.