Ubuntu – 403 Forbidden on Apache 2.4

Apache2permissionsserver

I've read the answer at Apache2: Forbidden You don't have permission to access /dir/ on this server as well as all of the related questions and none of the solutions seem to work.

I'm trying to set up Apache with SSL but am getting a 403 Forbidden error when I go to https://[::1]/ or https://localhost/.

My only "sites-enabled" are localssl and this is localssl.conf:

<VirtualHost _default_:443>

        ServerAdmin webmaster@localhost

        ####Configuration for SSL #####
        SSLEngine on
        SSLCertificateFile /etc/apache2/ssl/server.pem
        SSLCertificateKeyFile /etc/apache2/ssl/server.key
        #### End of SSL Configuration ####

        DocumentRoot /data
        <Directory /data>
                Options FollowSymLinks
                AllowOverride None
                Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        LogLevel warn
</VirtualHost>

Permissions for /data are set to 755 for root:www-data recursively.

In my apache2.conf file:

#<Directory /var/www/>
#       Options Indexes FollowSymLinks
#       AllowOverride None
#       Require all granted
#</Directory>

<Directory /data/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

I've also tried omitting the section in apache2.conf and it did not make a difference.

What else do I need to do to get this to work?

Best Answer

Problem solved by adding Indexes into the Options directive:

In the Directory "node" inside localssl.conf:

    <Directory /data>
            Options Indexes FollowSymLinks
            AllowOverride None
            Require all granted
    </Directory>
Related Question