diff --git a/templates/apache2.conf.j2 b/templates/apache2.conf.j2 index ebccb6e40e3651afa9ede2f18e07618fdfc69189..350a0f5bd8915368366b884624476338ef46d5e2 100644 --- a/templates/apache2.conf.j2 +++ b/templates/apache2.conf.j2 @@ -165,32 +165,37 @@ Include ports.conf # the latter may be used for local directories served by the web server. If # your system is serving content from a sub-directory in /srv you must allow # access here, or in any related virtual host. -<Directory /> +<Directory "/"> Options FollowSymLinks AllowOverride None Require all denied </Directory> -<Directory /usr/share> +<Directory "/usr/share"> AllowOverride None Require all granted </Directory> -<Directory /var/www/> +<Directory "/var/www/"> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> +<IfFile "{{ apache_chroot_dir }}/var/www"> + <Directory "{{ apache_chroot_dir }}/var/www/"> + Options Indexes FollowSymLinks + AllowOverride None + Require all granted + </Directory> +</IfFile> + #<Directory /srv/> # Options Indexes FollowSymLinks # AllowOverride None # Require all granted #</Directory> - - - # AccessFileName: The name of the file to look for in each directory # for additional configuration directives. See also the AllowOverride # directive.