Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apache says my DocumentRoot directory doesn't exist

I am using Phusion Passenger to deploy a rails application using apache2 on CentOS 5.5. For some reason, I keep getting this message when I start up apache:

> service start httpd
Starting httpd: Warning: DocumentRoot [/home/deploy/my_app/public] does not exist
[ OK ]

The directory most certainly does exist. Here are some important files from my configuration:

/etc/httpd/conf/httpd.conf
...
User deploy
Group deploy
...

/etc/httpd/conf.d/my_app.conf
< VirtualHost *:80>
    ServerName my_app.com
    DocumentRoot /home/deploy/my_app/public
    < Directory /home/deploy/my_app/public>
        Allow from all
        Options -MultiViews
    < /Directory>
< /VirtualHost>

The directories /home/deploy, /home/deploy/my_app, and /home/deploy/my_app/public all belong to the deploy user.

like image 292
muirbot Avatar asked Oct 16 '10 07:10

muirbot


People also ask

Where is DocumentRoot in Apache?

By default, the Apache web root or Document root folder location is at /var/www/html.

What is DocumentRoot in Apache server?

The DocumentRoot is the top-level directory in the document tree visible from the web and this directive sets the directory in the configuration from which Apache2 or HTTPD looks for and serves web files from the requested URL to the document root. For example: DocumentRoot "/var/www/html"


1 Answers

I ran into this problem too. Are you running SELinux? Check /etc/sysconfig/selinux, or try echo "0" >/selinux/enforce as root to see if disabling it helps.

If so, you can either modify your selinux policy to allow access to these files, or just disable selinux altogether.

like image 146
Edward Anderson Avatar answered Sep 28 '22 10:09

Edward Anderson