Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Apache2 403 Forbidden - you don't have permission to access

Writer Sophia Terry

I've added one virtual host to sites-available. It was showing Index Of... a while ago, then I installed mysql, don't know if it's the reason but after that there was 404, then I changed Directoryto /var/www/html/ and is now showing 403.

I'ver tried chown -R www-data:www-data /var/www with no avail.
Also changed DocumentRoot in 000-defaut.conf to /var/www/html/. There're never any errors in error.log.

It's a vps and i'm accessing it via ssh

3

1 Answer

We eventually found that is a misconfiguration between 00-default and mysite.com.

I guess that request are serverd by mysite.com VirtualHost that have not permission to access /var/www/html.

If you need both VirtualHost working, Apache need to recognize both either by name or by ip.

You should add ServerName directive in 00-default and add both name in /etc/hosts as described in How to access a website under Ubuntu

Also don't forget that 404 error means "not found", when you change DocumentRoot, you should move file to the new directory too.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy