2017-07-06 14:51:40 +02:00
|
|
|
<VirtualHost *:80>
|
2016-11-07 14:00:57 +01:00
|
|
|
ServerName {{ ansible_fqdn }}
|
|
|
|
ServerAdmin webmaster@localhost
|
2017-07-06 14:51:40 +02:00
|
|
|
|
2017-07-18 17:05:47 +02:00
|
|
|
DocumentRoot /var/www/
|
|
|
|
|
2017-07-06 14:51:40 +02:00
|
|
|
RewriteEngine on
|
2017-07-18 17:05:47 +02:00
|
|
|
# Redirect to HTTPS, execpt for munin, because some plugins
|
|
|
|
# can't handle HTTPS! :(
|
|
|
|
RewriteCond %{REQUEST_URI} !^/server-status.*$ [NC] [OR]
|
|
|
|
RewriteCond %{REQUEST_URI} !^/munin_opcache.php$ [NC]
|
2017-07-06 14:51:40 +02:00
|
|
|
RewriteRule ^/(.*) https://{{ ansible_fqdn }}/$1 [L,R=permanent]
|
2017-07-18 17:05:47 +02:00
|
|
|
|
|
|
|
<Location /munin_opcache.php>
|
|
|
|
Require ip 127.0.0.1
|
|
|
|
</Location>
|
|
|
|
|
2017-07-06 14:51:40 +02:00
|
|
|
</VirtualHost>
|
|
|
|
|
|
|
|
<VirtualHost *:443>
|
|
|
|
ServerName {{ ansible_fqdn }}
|
|
|
|
ServerAdmin webmaster@localhost
|
|
|
|
|
2016-11-07 14:00:57 +01:00
|
|
|
DocumentRoot /var/www/
|
|
|
|
|
|
|
|
SSLEngine on
|
2017-07-13 16:44:39 +02:00
|
|
|
SSLCertificateFile {{ apache_evolinux_default_ssl_cert }}
|
|
|
|
SSLCertificateKeyFile {{ apache_evolinux_default_ssl_key }}
|
2016-11-07 14:00:57 +01:00
|
|
|
|
2017-07-18 17:05:47 +02:00
|
|
|
# We override these 2 Directory directives setted in apache2.conf.
|
|
|
|
# We want no access except from allowed IP address.
|
|
|
|
<Directory />
|
|
|
|
Options -Indexes
|
|
|
|
Require all denied
|
|
|
|
Include /etc/apache2/private_ipaddr_whitelist.conf
|
|
|
|
</Directory>
|
2017-07-06 14:51:40 +02:00
|
|
|
<Directory /var/www/>
|
2017-07-18 17:05:47 +02:00
|
|
|
Options -Indexes
|
2017-07-19 10:20:54 +02:00
|
|
|
Require all denied
|
2016-11-07 14:00:57 +01:00
|
|
|
Include /etc/apache2/private_ipaddr_whitelist.conf
|
|
|
|
</Directory>
|
|
|
|
|
2017-07-18 17:05:47 +02:00
|
|
|
# Munin. We need to set Directory directive as Alias take precedence.
|
2017-07-06 14:51:40 +02:00
|
|
|
Alias /munin /var/cache/munin/www
|
2017-07-18 17:05:47 +02:00
|
|
|
<Directory /var/cache/munin/>
|
|
|
|
Options -Indexes
|
|
|
|
Require all denied
|
2017-07-06 14:51:40 +02:00
|
|
|
Include /etc/apache2/private_ipaddr_whitelist.conf
|
2016-11-07 14:00:57 +01:00
|
|
|
</Directory>
|
2017-07-18 17:05:47 +02:00
|
|
|
<Directory /usr/lib/munin/cgi/>
|
|
|
|
Options -Indexes
|
|
|
|
Require all denied
|
2016-11-07 14:00:57 +01:00
|
|
|
Include /etc/apache2/private_ipaddr_whitelist.conf
|
2017-07-18 17:05:47 +02:00
|
|
|
</Directory>
|
2016-11-07 14:00:57 +01:00
|
|
|
|
2017-07-19 18:25:22 +02:00
|
|
|
# Munin cgi
|
|
|
|
# Ensure we can run (fast)cgi scripts
|
|
|
|
ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph
|
|
|
|
<Location /munin-cgi/munin-cgi-graph>
|
|
|
|
Options +ExecCGI
|
|
|
|
<IfModule mod_fcgid.c>
|
|
|
|
SetHandler fcgid-script
|
|
|
|
</IfModule>
|
|
|
|
<IfModule mod_fastcgi.c>
|
|
|
|
SetHandler fastcgi-script
|
|
|
|
</IfModule>
|
|
|
|
<IfModule !mod_fastcgi.c>
|
|
|
|
<IfModule !mod_fcgid.c>
|
|
|
|
SetHandler cgi-script
|
|
|
|
</IfModule>
|
|
|
|
</IfModule>
|
|
|
|
Allow from all
|
|
|
|
</Location>
|
|
|
|
|
2017-07-18 17:05:47 +02:00
|
|
|
# For CGI Scripts. We need to set Directory directive as ScriptAlias take precedence.
|
2016-11-07 14:00:57 +01:00
|
|
|
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
|
2017-07-18 17:05:47 +02:00
|
|
|
<Directory /usr/lib/cgi-bin>
|
2016-11-07 14:00:57 +01:00
|
|
|
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
|
2017-07-18 17:05:47 +02:00
|
|
|
Require all denied
|
|
|
|
Include /etc/apache2/private_ipaddr_whitelist.conf
|
2016-11-07 14:00:57 +01:00
|
|
|
</Directory>
|
|
|
|
|
|
|
|
CustomLog /var/log/apache2/access.log vhost_combined
|
|
|
|
ErrorLog /var/log/apache2/error.log
|
|
|
|
LogLevel warn
|
|
|
|
|
2017-07-05 18:22:00 +02:00
|
|
|
Alias /phpmyadmin-{{ apache_phpmyadmin_suffix }} /usr/share/phpmyadmin/
|
2016-11-07 14:00:57 +01:00
|
|
|
IncludeOptional /etc/apache2/conf-available/phpmyadmin*
|
|
|
|
|
|
|
|
<Files ~ "\.(inc|bak)$">
|
2017-07-19 11:20:13 +02:00
|
|
|
Require all denied
|
2016-11-07 14:00:57 +01:00
|
|
|
</Files>
|
|
|
|
|
|
|
|
</VirtualHost>
|