diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2014-02-07 18:41:35 +0100 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2014-02-07 18:41:35 +0100 |
commit | eff03699b6e68951d569c08878f3f9fdc96f7d94 (patch) | |
tree | e533ee916a70bef21a5ac872c9f0901e735212df | |
parent | 45bc339348d17a9936f94996f33213201926ee36 (diff) |
Updated Apache website configurations.
Change-Id: I9edee09fdd61b854e5937fce95c626ca590bbb5f
-rw-r--r-- | ansible/roles/status/templates/apache_production.conf | 56 | ||||
-rw-r--r-- | ansible/roles/status/templates/apache_staging.conf | 47 | ||||
-rw-r--r-- | ansible/roles/status/templates/apache_website.conf | 68 |
3 files changed, 66 insertions, 105 deletions
diff --git a/ansible/roles/status/templates/apache_production.conf b/ansible/roles/status/templates/apache_production.conf deleted file mode 100644 index bc3aa7e..0000000 --- a/ansible/roles/status/templates/apache_production.conf +++ /dev/null @@ -1,56 +0,0 @@ -<VirtualHost *:80> - ServerName {{ install_dir }} - ServerAdmin webmaster@linaro.org - - Redirect permanent / https://{{ install_dir }} -</VirtualHost> - -<VirtualHost *:443> - ServerName {{ install_dir }} - ServerAdmin webmaster@linaro.org - - CustomLog ${APACHE_LOG_DIR}/{{ install_dir }}-access.log combined - ErrorLog ${APACHE_LOG_DIR}/{{ install_dir }}-error.log - - SSLEngine on - SSLCertificateFile /etc/ssl/certs/{{ install_dir }}.crt - SSLCertificateKeyFile /etc/ssl/certs/{{ install_dir }}.key - SSLCACertificateFile /etc/ssl/certs/gd_bundle.crt - - SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown - #DocumentRoot /var/www/{{ install_dir }} - WSGIScriptAlias / {{ install_base }}/{{ install_dir }}/{{ install_dir }}.wsgi - - ExpiresActive On - ExpiresDefault "access plus 300 seconds" - - ExpiresByType text/css "access plus 1 month" - ExpiresByType text/javascript "access plus 1 month" - ExpiresByType image/png "access plus 1 month" - ExpiresByType image/jpg "access plus 1 month" - ExpiresByType image/jpeg "access plus 1 month" - ExpiresByType image/x-icon "access plus 1 month" - - Header append Cache-Control "public, no-transform" - - <FilesMatch "\.(html|htm)$"> - Header add Cache-Control "must-revalidate" - </FilesMatch> - - <FilesMatch "\.(js|css)$"> - Header add Cache-Control "max-age=604800" - </FilesMatch> - - Alias /static/ /var/www/{{ install_dir }}/static/ - <Location "/static/"> - Options -Indexes - SetOutputFilter DEFLATE - - BrowserMatch ^Mozilla/4 gzip-only-text/html - BrowserMatch ^Mozilla/4\.0[678] no-gzip - BrowserMatch \bMSIE !no-gzip !gzip-only-text/html - - SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary - Header append Vary User-Agent env=!dont-vary - </Location> -</VirtualHost> diff --git a/ansible/roles/status/templates/apache_staging.conf b/ansible/roles/status/templates/apache_staging.conf deleted file mode 100644 index 68e1995..0000000 --- a/ansible/roles/status/templates/apache_staging.conf +++ /dev/null @@ -1,47 +0,0 @@ -<VirtualHost *:80> - ServerName {{ install_dir }} - ServerAdmin webmaster@linaro.org - - CustomLog ${APACHE_LOG_DIR}/{{ install_dir }}-access.log combined - ErrorLog ${APACHE_LOG_DIR}/{{ install_dir }}-error.log - - SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown - #DocumentRoot /var/www/{{ install_dir }} - - WSGIDaemonProcess {{ install_dir }} maximum-requests=10000 - WSGIProcessGroup {{ install_dir }} - WSGIScriptAlias / {{ install_base }}/{{ install_dir }}/{{ install_dir }}.wsgi - - ExpiresActive On - ExpiresDefault "access plus 300 seconds" - - ExpiresByType text/css "access plus 1 month" - ExpiresByType text/javascript "access plus 1 month" - ExpiresByType image/png "access plus 1 month" - ExpiresByType image/jpg "access plus 1 month" - ExpiresByType image/jpeg "access plus 1 month" - ExpiresByType image/x-icon "access plus 1 month" - - Header append Cache-Control "public, no-transform" - - <FilesMatch "\.(html|htm)$"> - Header add Cache-Control "must-revalidate" - </FilesMatch> - - <FilesMatch "\.(js|css)$"> - Header add Cache-Control "max-age=604800" - </FilesMatch> - - Alias /static/ /var/www/{{ install_dir }}/static/ - <Location "/static/"> - Options -Indexes - SetOutputFilter DEFLATE - - BrowserMatch ^Mozilla/4 gzip-only-text/html - BrowserMatch ^Mozilla/4\.0[678] no-gzip - BrowserMatch \bMSIE !no-gzip !gzip-only-text/html - - SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary - Header append Vary User-Agent env=!dont-vary - </Location> -</VirtualHost> diff --git a/ansible/roles/status/templates/apache_website.conf b/ansible/roles/status/templates/apache_website.conf index c6e763e..9faf171 100644 --- a/ansible/roles/status/templates/apache_website.conf +++ b/ansible/roles/status/templates/apache_website.conf @@ -1,8 +1,72 @@ WSGIRestrictEmbedded On WSGILazyInitialization On +<VirtualHost *:80> + ServerName {{ site_name }} + ServerAdmin webmaster@linaro.org + + Redirect permanent / https://{{ site_name }} +</VirtualHost> + +<VirtualHost *:443> + ServerName {{ site_name }} + ServerAdmin webmaster@linaro.org + + CustomLog ${APACHE_LOG_DIR}/{{ site_name }}-access.log combined + ErrorLog ${APACHE_LOG_DIR}/{{ site_name }}-error.log + + SSLEngine on {% if role == 'staging' %} -{% extends "apache_staging.conf" %} + SSLCertificateFile /etc/ssl/certs/{{ site_name }}.pem + SSLCertificateKeyFile /etc/ssl/certs/{{ site_name }}.key {% else %} -{% extends "apache_production.conf" %} + SSLCertificateFile /etc/ssl/certs/{{ site_name }}.crt + SSLCertificateKeyFile /etc/ssl/certs/{{ site_name }}.key + SSLCACertificateFile /etc/ssl/certs/gd_bundle.crt +{% endif %} + + SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown + + WSGIDaemonProcess {{ wsgi_daemon }} + WSGIProcessGroup {{ wsgi_daemon }} + WSGIScriptAlias / {{ install_base }}/{{ install_dir }}/{{ wsgi_name }} + WSGIApplicationGroup %{GLOBAL} + +{% if site_function == 'roadmap' %} + RewriteEngine On + RewriteRule ^/$ /roadmap [R] {% endif %} + + ExpiresActive On + ExpiresDefault "access plus 300 seconds" + + ExpiresByType text/css "access plus 1 month" + ExpiresByType text/javascript "access plus 1 month" + ExpiresByType image/png "access plus 1 month" + ExpiresByType image/jpg "access plus 1 month" + ExpiresByType image/jpeg "access plus 1 month" + ExpiresByType image/x-icon "access plus 1 month" + + Header append Cache-Control "no-transform" + + <FilesMatch "\.(html|htm)$"> + Header add Cache-Control "must-revalidate" + </FilesMatch> + + <FilesMatch "\.(js|css)$"> + Header add Cache-Control "max-age=604800" + </FilesMatch> + + Alias /static/ /var/www/{{ install_dir }}/static/ + <Location "/static/"> + Options -Indexes + SetOutputFilter DEFLATE + + BrowserMatch ^Mozilla/4 gzip-only-text/html + BrowserMatch ^Mozilla/4\.0[678] no-gzip + BrowserMatch \bMSIE !no-gzip !gzip-only-text/html + + SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary + Header append Vary User-Agent env=!dont-vary + </Location> +</VirtualHost> |