[SOLVED] Apache: DocumentRoot must be a directory
[SOLVED] Apache: DocumentRoot must be a directory
I just installed CentOS 6 and modified /etc/httpd/conf/httpd.conf like this:
[code]DocumentRoot "/home/sayres/Web"[/code]
However, after doing this, every time I tried to start httpd it gives me the error:
[code]
[root@centos ~]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: Syntax error on line 292 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
[FAILED]
[root@centos ~]#
[/code]
What can I do?
[code]DocumentRoot "/home/sayres/Web"[/code]
However, after doing this, every time I tried to start httpd it gives me the error:
[code]
[root@centos ~]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: Syntax error on line 292 of /etc/httpd/conf/httpd.conf:
DocumentRoot must be a directory
[FAILED]
[root@centos ~]#
[/code]
What can I do?
Re: Apache: DocumentRoot must be a directory
Make sure the directory exist? Make sure that the apache user can read it and can see inside it? Check its selinux context to make sure that Apache is allowed to access it? Or perhaps better, use /var/www/html which already has all of those attributes set up correctly out of the box?
Re: Apache: DocumentRoot must be a directory
[code]Check its selinux context to make sure that Apache is allowed to access it[/code]
who??
i want install joomla 1.5 and now my document root is: /var/www/html
but when run joomla index.php for installation :
http://127.0.0.1/Joomla/
encounter a massage:
[code]Forbidden 403
You don't have permission to access /Joomla/ on this server.
Apache/2.2.15 (CentOS) Server at localhost Port 80[/code]
what i can doit???
who??
i want install joomla 1.5 and now my document root is: /var/www/html
but when run joomla index.php for installation :
http://127.0.0.1/Joomla/
encounter a massage:
[code]Forbidden 403
You don't have permission to access /Joomla/ on this server.
Apache/2.2.15 (CentOS) Server at localhost Port 80[/code]
what i can doit???
Re: Apache: DocumentRoot must be a directory
Post the output from
[code]
ls -laZ /var/www/html
sestatus
[/code]
[code]
ls -laZ /var/www/html
sestatus
[/code]
Re: Apache: DocumentRoot must be a directory
[code]
[sayres@centos ~]$ ls -laZ /var/www/html/
drwxrwxr-x. root sayres system_u:object_r:httpd_sys_content_t:s0 .
drwxr-xr-x. root root system_u:object_r:httpd_sys_content_t:s0 ..
-rw-rw-r--. root sayres unconfined_u:object_r:httpd_sys_content_t:s0 info.php
drwxr-xr-x. root sayres unconfined_u:object_r:user_home_t:s0 Joomla
[sayres@centos ~]$
[/code]
[sayres@centos ~]$ ls -laZ /var/www/html/
drwxrwxr-x. root sayres system_u:object_r:httpd_sys_content_t:s0 .
drwxr-xr-x. root root system_u:object_r:httpd_sys_content_t:s0 ..
-rw-rw-r--. root sayres unconfined_u:object_r:httpd_sys_content_t:s0 info.php
drwxr-xr-x. root sayres unconfined_u:object_r:user_home_t:s0 Joomla
[sayres@centos ~]$
[/code]
Re: Apache: DocumentRoot must be a directory
[quote]
drwxr-xr-x. root sayres unconfined_u:object_r:user_home_t:s0 Joomla
[/quote]
Yes, the selinux context is wrong so it will not let that directory be accessed by apache. To fix this, the easy way is to run as root
[code]
chcon -R --reference=/var/www/html /var/www/html/Joomla
[/code]
For reference, to prevent this in the future, don't untar something in your home directory and then move it to /var/www/html.
drwxr-xr-x. root sayres unconfined_u:object_r:user_home_t:s0 Joomla
[/quote]
Yes, the selinux context is wrong so it will not let that directory be accessed by apache. To fix this, the easy way is to run as root
[code]
chcon -R --reference=/var/www/html /var/www/html/Joomla
[/code]
For reference, to prevent this in the future, don't untar something in your home directory and then move it to /var/www/html.
Re: Apache: DocumentRoot must be a directory
tanks dude...
how i can check selinux ????
how i can check selinux ????
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
[SOLVED] Apache: DocumentRoot must be a directory
http://wiki.centos.org/HowTos/SELinux
http://wiki.centos.org/TipsAndTricks/SelinuxBooleans
Also for future reference, please start a new Topic for a new question, rather than hijacking your own thread.
http://wiki.centos.org/TipsAndTricks/SelinuxBooleans
Also for future reference, please start a new Topic for a new question, rather than hijacking your own thread.
Re: Apache: DocumentRoot must be a directory
tanks.
[solved]
[solved]
- AlanBartlett
- Forum Moderator
- Posts: 9345
- Joined: 2007/10/22 11:30:09
- Location: ~/Earth/UK/England/Suffolk
- Contact:
Re: [SOLVED] Apache: DocumentRoot must be a directory
For posterity, and as requested by the OP, this thread is marked [SOLVED].