0

I have a new Ubuntu installation that seems to work fine, apache runs, and i can connect using the ip adress.

However, after adding a virtualhost file, im getting a 403 permission denied error. Already tried all the stuff i could find on here, but it doesnt work...

There is just a simple index.html in the folder right now.

<VirtualHost *:80>
    ServerAdmin admin@example.com
    ServerName lacasting.online
    ServerAlias www.lacasting.online nyccasting.online www.nyccasting.online sdcasting.online sfcasting.online
    DocumentRoot /var/www/html/wcc
<Directory "/var/www/html/wcc">
            # AllowOverride All      # Deprecated
        # Order Allow,Deny       # Deprecated
        # Allow from all         # Deprecated
        # --New way of doing it
        Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
0

This could be if you don't have an index.html or one of the other default documents described in the apache.conf file. You'll get a 403 in this case because if the default document is not there, it will try to list the directory, which is disabled by default. You can confirm this by trying to go to the .html file you have in the /var/www/html/wcc/somefile.html and see if it loads.

For apache, there is a default vhost config located in /etc/apache2/sites-available/000-default.conf and it is symlinked to /etc/apache2/sites-enabled. If this is the file you modified or created a new file, you'll want to be sure to reload or restart apache2 to pick up the changes as they are cached.

If you've created a new .conf file ensure it is in the sites-enabled folder, or if it's in sites-available symlink it to sites-enabled. Restart or reload apache after any changes or if you have not done this after creating the file.

If both of these are correct, check and make sure apache has access to the directory. It needs to be accessible to the www-data user and the easiest way is to ensure the www-data group has access to the directory via

chown -R YourUser:www-data /var/www/html/wcc
| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.