I'm having a problem setting up a vhost on Apache 2.4, using CentOS 6.3.
This question seems to have been answered several times on this forum, but none of the solutions work for me.
Basically, I set up a vhost with a particular document root. When I attempt to access the site, I get a permissions error. But I have no problem if I use a different root.
More specifically, if I set the root to be /volume1/web/xxx, I get a 503 because of a permission problem on index.html.
But if I set it to be /volume1/web, the index.html comes up without a problem.
The details:
- I set the persmissions on volume1, web, and xxx to 755.
- I set the permissions on the index.html files to 777.
- I copy the index.html file to both /volume1/web and /volume1/web/xxx, so that they have identical index files with identical permissions.
In httpd.conf, I set the VirtualHost options so that I can easily switch the document root by changing 2 comment marks
I have the following lines in the conf file:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
#DocumentRoot /volume1/web
DocumentRoot /volume1/web/xxx
#<Directory /volume1/web>
<Directory /volume1/web/xxx>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order Allow,Deny
Allow from all
</Directory>
ErrorLog logs/localhost-error_log
CustomLog logs/localhost-access_log common
</VirtualHost>
These lines contain all the suggestions that worked for other people with the same problem.
What I get when I enter localhost in my browser depends on the document root.
- If the root is /volume1/web, the index.html page comes up.
if the root is /volume1/web/xxx, then I get a 503 error, and the apache error log has this line:
[Thu Jul 19 17:17:52 2012] [error] [client ::1] (13)Permission denied: access to /index.html denied
I also tried adding an index.php file to the directory. I then got permission denied messages for both the php file and the html file.
I also tried setting the user : group to apache : apache on the directories and files. That didn't help.
I've done everything I can think of to fix the permissions, to no avail.
Does anyone have an idea about what's happening here?
Thanks.