Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

originally i had the virtual host inside /var/www/dir which worked well.

However, i wanted to separate this site from the other, so i create /var/www2/

i set DocumentRoot to /var/www2/

now when i navigate to the new site, it throws 403 Forbidden error.

share|improve this question

Have you checked the permissions and ownership on the /var/www2 directory? There ought to be errors in the error log that will give you a better idea of what's going on.

share|improve this answer

As Hans mentioned, check permissions, the directory should at least be group owned by the user running apache and have the execute bit set. You would probably have it set for world/other read and execute (chmod o+rx /var/www2).

Additionally, you should verify that SELinux isn't complaining about /var/www2 being set to the wrong context. In either case, you should see errors in your error_log file telling you exactly what the problem is.

share|improve this answer

Did you set up permissions within your VirtualHost directive:

<Directory /var/www2>
    Options Indexes FollowSymLinks
    Order allow,deny
    Allow from all

Also as Hans mentioned, check your permissions on that directory. It must be readable by the User and Group the Apache server is running under.

share|improve this answer

You might want to create your vhost in /var/www/anotherdir as apache doesn't have SELinux permissions by default to serve files outside of that directory structure if I recall correctly. You can use ls -Z /var/www /var/www2 to see the SELinux security context information for those directories. If you are getting SELinux permission denied errors you'll see them in the /var/log/audit/audit.log. If you do move /var/www2 into /var/www you may wish to use restorecon -R /var/www to reset the security context of your files based on its rules.

share|improve this answer

Your Answer


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