In /etc/apache2/apache2.conf
, I have the following configuration for Apache with regard to the /var/www
directory:
<Directory /var/www/>
Options -Indexes -Includes -ExecCGI
AllowOverride All
Require all granted
</Directory>
In /etc/apache2/sites-enabled/example.com.conf
then, this is how I've set up my virtual host for example.com
:
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
ServerAdmin [email protected]
DocumentRoot /var/www/example.com/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Everything is working fine so far.
But as soon as I edit the <Directory /var/www/>
part (see above) from
Options -Indexes -Includes -ExecCGI
to
Options -Indexes -FollowSymLinks -Includes -ExecCGI
the website stops working and responds with a 403
error instead.
Why is this happening? Nowhere did I use any symbolic links, at least not consciously. So is Apache using them internally when working with virtual hosts?
I don't see any reason why that option should break the setup. The website is actually stored in /var/www/example.com/public
, that's not a symbolic link, either.
The Apache error logs explain the reason for this problem:
Using
mod_rewrite
withRewriteRule
(as is common) while disablingFollowSymLinks
(as shown in the question) is only possible ifSymLinksIfOwnerMatch
is enabled in return.Thus
must become
or
mod_rewrite
withRewriteRule
cannot be used anymore.Thanks for the hint, @fkraiem!