0
votes

Trying to setup my webserver and allow .htaccess in all www directories. When accessing sub.domain.com on my laptop (with host files adjusted), returns a 403 Forbidden. "You don't have permission to access / on this server."

It feels like the .htaccess file is not allowed, and therefore throws the 403. But as per my understanding the settings are correct isn't? Am I overlooking something?

apache2.conf

<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www/>
        AllowOverride All
</Directory>

domain.com.conf

<VirtualHost *:80>
        ServerName domain.com
        ServerAlias sub.domain.com
        ServerAdmin [email protected]
        DocumentRoot /var/www/domain.com/public_html/support/current
        <Directory "/var/www/domain.com/public_html/support/current">
                Options FollowSymLinks
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

<VirtualHost *:443>
        ServerName domain.com
        ServerAlias .domain.com
        ServerAdmin [email protected]
        DocumentRoot /var/www/domain.com/public_html/support/current
        <Directory "/var/www/domain.com/public_html/support/current">
                Options FollowSymLinks
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>
1
Is it possible that the user www-data which is the default apache-user has no rights for the folder you specify? - Fuzzzzel

1 Answers

1
votes

Either /var/www/domain.com/public_html/support/current doesn't exist, or its rights are not correct for user Apache runs on. Check the User and Group settings in the main Apache config to find out what they are.

You might also want to check the error log to get additional clues.