diff options
author | Jonas Smedegaard <dr@jones.dk> | 2012-03-27 13:55:32 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2012-03-27 13:55:32 +0200 |
commit | a9bf97764205b57275d52075803222d445ea3ff2 (patch) | |
tree | 244364677aea2670d4b3fffb53280499c1c9d0e1 /apache2/sites-available | |
parent | 3314548c9846d7b4b556d6fc3dbbd2ad05c92341 (diff) |
Modernize sample apache2 site snippets.
Diffstat (limited to 'apache2/sites-available')
-rw-r--r-- | apache2/sites-available/0_default | 30 | ||||
-rw-r--r-- | apache2/sites-available/lists.secure-example.com | 62 | ||||
-rw-r--r-- | apache2/sites-available/mail.secure-example.com | 57 | ||||
-rw-r--r-- | apache2/sites-available/users.secure-example.com | 94 | ||||
-rw-r--r-- | apache2/sites-available/wiki.secure-example.com | 86 | ||||
-rw-r--r-- | apache2/sites-available/www.secure-example.com | 51 |
6 files changed, 185 insertions, 195 deletions
diff --git a/apache2/sites-available/0_default b/apache2/sites-available/0_default index 142392e..ce390fb 100644 --- a/apache2/sites-available/0_default +++ b/apache2/sites-available/0_default @@ -1,25 +1,19 @@ <VirtualHost *:443> - ServerName wrong.example.com - ServerAdmin webmaster@example.com - DocumentRoot /home/webmaster/public_websites/wrong.example.com + ServerName wrong.example.com + ServerAdmin webmaster@example.com + DocumentRoot /home/webmaster/public_websites/wrong.example.com - Include /etc/apache2/conf.d/local-ssl.conf + Include conf.d/local-ssl.conf - <Location /> - Options +MultiViews - DirectoryIndex index - </Location> - AddLanguage da .da + ErrorLog ${APACHE_LOG_DIR}/wrong.example.com-error.log + CustomLog ${APACHE_LOG_DIR}/wrong.example.com-access.log combined </VirtualHost> <VirtualHost *:80> - ServerName wrong.example.com - ServerAlias wrong - ServerAdmin webmaster@example.com - DocumentRoot /home/webmaster/public_websites/wrong.example.com + ServerName wrong.example.com + ServerAlias wrong + ServerAdmin webmaster@example.com + DocumentRoot /home/webmaster/public_websites/wrong.example.com - <Location /> - Options +MultiViews - DirectoryIndex index - </Location> - AddLanguage da .da + ErrorLog ${APACHE_LOG_DIR}/wrong.example.com-error.log + CustomLog ${APACHE_LOG_DIR}/wrong.example.com-access.log combined </VirtualHost> diff --git a/apache2/sites-available/lists.secure-example.com b/apache2/sites-available/lists.secure-example.com index 48e9d84..45f2fc4 100644 --- a/apache2/sites-available/lists.secure-example.com +++ b/apache2/sites-available/lists.secure-example.com @@ -1,52 +1,52 @@ <VirtualHost *:443> - ServerName lists.example.com:443 - ServerAlias lists - ServerAdmin webmaster@example.com - DocumentRoot /home/webmaster/public_websites/lists.example.com/ + ServerName lists.example.com:443 + ServerAlias lists + ServerAdmin webmaster@example.com + DocumentRoot /home/webmaster/public_websites/lists.example.com/ - Include /etc/apache2/conf.d/local-ssl.conf - Include /etc/apache2/conf.d/local-log-vhosts.conf + Include conf.d/local-ssl.conf + Include conf.d/local-log-vhosts.conf - Alias /pipermail /var/lib/mailman/archives/public - Alias /images/mailman /usr/share/images/mailman - ScriptAlias /mailman /usr/lib/cgi-bin/mailman + Alias /pipermail /var/lib/mailman/archives/public + Alias /images/mailman /usr/share/images/mailman + ScriptAlias /mailman /usr/lib/cgi-bin/mailman - RewriteEngine On - RewriteRule ^/$ /mailman/listinfo [R] - RewriteRule ^/mailman(/)?$ /mailman/listinfo [R] + RewriteEngine On + RewriteRule ^/$ /mailman/listinfo [R] + RewriteRule ^/mailman(/)?$ /mailman/listinfo [R] <Location /images/> order deny,allow allow from all </Location> - CustomLog "| /usr/sbin/vlogger -s access.log -u admin -g admin -t '%Y.%m.%d' /home/webmaster/weblogs" combined_vlogger - ErrorLog "| /usr/sbin/vlogger -s error.log -u admin -g admin -t '%Y.%m.%d' -e /home/webmaster/weblogs/ERRORS" + ErrorLog ${APACHE_LOG_DIR}/lists.example.com-error.log + CustomLog ${APACHE_LOG_DIR}/lists.example.com-access.log combined </VirtualHost> <VirtualHost *:443> - ServerName www.lists.example.com:443 - ServerAlias *.lists.example.com:443 - ServerAdmin webmaster@example.com + ServerName www.lists.example.com:443 + ServerAlias *.lists.example.com:443 + ServerAdmin webmaster@example.com - Include /etc/apache2/conf.d/local-ssl.conf - Include /etc/apache2/conf.d/local-log-origin.conf + Include conf.d/local-ssl.conf + Include conf.d/local-log-origin.conf - RewriteEngine On - RewriteRule / https://lists.example.com/ [R] -# RewriteRule /(.*) https://lists.example.com/$1 [R] + RewriteEngine On + RewriteRule / https://lists.example.com/ [R] +# RewriteRule /(.*) https://lists.example.com/$1 [R] - CustomLog /var/log/apache2/redirect.log origin + CustomLog ${APACHE_LOG_DIR}/redirect.log origin </VirtualHost> <VirtualHost *:80> - ServerName lists.example.com - ServerAlias *.lists.example.com - ServerAdmin webmaster@example.com + ServerName lists.example.com + ServerAlias *.lists.example.com + ServerAdmin webmaster@example.com - Include /etc/apache2/conf.d/local-log-origin.conf + Include conf.d/local-log-origin.conf - RewriteEngine On - RewriteRule / https://lists.example.com/ [R] -# RewriteRule /(.*) https://lists.example.com/$1 [R] + RewriteEngine On + RewriteRule / https://lists.example.com/ [R] +# RewriteRule /(.*) https://lists.example.com/$1 [R] - CustomLog /var/log/apache2/redirect.log origin + CustomLog ${APACHE_LOG_DIR}/redirect.log origin </VirtualHost> diff --git a/apache2/sites-available/mail.secure-example.com b/apache2/sites-available/mail.secure-example.com index b9dea83..f01ccfb 100644 --- a/apache2/sites-available/mail.secure-example.com +++ b/apache2/sites-available/mail.secure-example.com @@ -1,44 +1,41 @@ <VirtualHost *:443> - ServerName mail.example.com:443 - ServerAdmin webmaster@example.com + ServerName mail.example.com:443 + ServerAdmin webmaster@example.com + DocumentRoot /home/webmaster/public_websites/mail.example.com/ - DocumentRoot /home/webmaster/public_websites/mail.example.com/ - - Include /etc/apache2/conf.d/local-ssl.conf - Include /etc/apache2/conf.d/horde2.conf - - <Location /horde2> - Options FollowSymLinks -MultiViews - DirectoryIndex index.php - </Location> + Include conf.d/local-ssl.conf + Include conf.d/local-php.conf + Include conf.d/local-horde3.conf + ErrorLog ${APACHE_LOG_DIR}/mail.example.com-error.log + CustomLog ${APACHE_LOG_DIR}/mail.example.com-access.log combined </VirtualHost> <VirtualHost *:443> - ServerName www.mail.example.com:443 - ServerAlias *.mail.example.com:443 - ServerAlias mail:443 - ServerAlias *.mail:443 - ServerAdmin webmaster@example.com + ServerName www.mail.example.com:443 + ServerAlias *.mail.example.com:443 + ServerAlias mail:443 + ServerAlias *.mail:443 - Include /etc/apache2/conf.d/local-ssl.conf - Include /etc/apache2/conf.d/local-log-origin.conf + Include conf.d/local-ssl.conf + Include conf.d/local-log-origin.conf - RewriteEngine On - RewriteRule / https://mail.example.com/ [R] + RewriteEngine On + RewriteRule / https://mail.example.com/ [R] +# RewriteRule /(.*) https://mail.example.com/$1 [R] - CustomLog /var/log/apache2/redirect.log origin + CustomLog ${APACHE_LOG_DIR}/redirect.log origin </VirtualHost> <VirtualHost *:80> - ServerName mail.example.com - ServerAlias *.mail.example.com - ServerAlias mail - ServerAlias *.mail - ServerAdmin webmaster@example.com + ServerName mail.example.com + ServerAlias *.mail.example.com + ServerAlias mail + ServerAlias *.mail - Include /etc/apache2/conf.d/local-log-origin.conf + Include /etc/apache2/conf.d/local-log-origin.conf - RewriteEngine On - RewriteRule / https://mail.example.com/ [R] + RewriteEngine On + RewriteRule / https://mail.example.com/ [R] +# RewriteRule /(.*) https://mail.example.com/$1 [R] - CustomLog /var/log/apache2/redirect.log origin + CustomLog ${APACHE_LOG_DIR}/redirect.log origin </VirtualHost> diff --git a/apache2/sites-available/users.secure-example.com b/apache2/sites-available/users.secure-example.com index 5b46c52..10f2477 100644 --- a/apache2/sites-available/users.secure-example.com +++ b/apache2/sites-available/users.secure-example.com @@ -1,19 +1,17 @@ <VirtualHost *:443> - ServerName users.example.com:443 - ServerAdmin webmaster@example.com + ServerName users.example.com:443 + ServerAdmin webmaster@example.com + DocumentRoot /var/www/vhosts/web-static/users.example.com/ - DocumentRoot /var/www/vhosts/web-static/users.example.com/ - - Include /etc/apache2/conf.d/local-ssl.conf -# Include /etc/apache2/conf.d/local-userdir.conf -# Include /etc/apache2/conf.d/local-macvolumes.conf + Include conf.d/local-ssl.conf +# Include conf.d/local-userdir.conf +# Include conf.d/local-macvolumes.conf # Support OpenID using Gracie - - RewriteEngine On - RewriteRule ^/(login|id/.*) http://localhost:8000/$1 [L,P] - RewriteRule ^/-(.*) https://users.example.com/~$1 [R] - RewriteRule ^/([^~].*) https://users.example.com/~$1 [R] + RewriteEngine On + RewriteRule ^/(login|id/.*) http://localhost:8000/$1 [L,P] + RewriteRule ^/-(.*) https://users.example.com/~$1 [R] + RewriteRule ^/([^~].*) https://users.example.com/~$1 [R] # prevent the webserver from beeing used as proxy <LocationMatch "^[^/]"> @@ -25,53 +23,57 @@ Allow from all </ProxyMatch> - ErrorLog /var/log/apache2/users.example.com-error.log - CustomLog /var/log/apache2/users.example.com-access.log combined + ErrorLog ${APACHE_LOG_DIR}/users.example.com-error.log + CustomLog ${APACHE_LOG_DIR}/users.example.com-access.log combined </VirtualHost> #<VirtualHost *:80> -# ServerName users.example.com -# ServerAlias users -# ServerAdmin webmaster@example.com -# -# DocumentRoot /var/www/vhosts/web-static/users.example.com/ +# ServerName users.example.com +# ServerAlias users +# ServerAdmin webmaster@example.com +# DocumentRoot /var/www/vhosts/web-static/users.example.com/ # -# Include /etc/apache2/conf.d/local-userdir.conf -# Include /etc/apache2/conf.d/local-macvolumes.conf +# Include conf.d/local-userdir.conf +# Include conf.d/local-macvolumes.conf # -# RewriteEngine On -# RewriteRule ^/(login|id/.*) https://users.example.com/$1 [R] -# RewriteRule ^/-(.*) http://users.example.com/~$1 [R] -# RewriteRule ^/([^~].*) http://users.example.com/~$1 [R] +# # Support OpenID using Gracie +# RewriteEngine On +# RewriteRule ^/(login|id/.*) https://users.example.com/$1 [R] +# RewriteRule ^/-(.*) http://users.example.com/~$1 [R] +# RewriteRule ^/([^~].*) http://users.example.com/~$1 [R] # -# TransferLog /dev/null -# ErrorLog /var/log/apache2/users.example.com-error.log -# CustomLog /var/log/apache2/users.example.com-access.log combined +# TransferLog /dev/null +# ErrorLog ${APACHE_LOG_DIR}/users.example.com-error.log +# CustomLog ${APACHE_LOG_DIR}/users.example.com-access.log combined #</VirtualHost> <VirtualHost *:443> - ServerName www.users.example.com:443 - ServerAlias *.users.example.com:443 - ServerAlias users:443 - ServerAlias *.users:443 - ServerAdmin webmaster@example.com + ServerName www.users.example.com:443 + ServerAlias *.users.example.com:443 + ServerAlias users:443 + ServerAlias *.users:443 + ServerAdmin webmaster@example.com - Include /etc/apache2/conf.d/local-ssl.conf - Include /etc/apache2/conf.d/local-log-origin.conf + Include conf.d/local-ssl.conf + Include conf.d/local-log-origin.conf - RewriteEngine On - RewriteRule / https://users.example.com/ [R] + RewriteEngine On + RewriteRule / https://users.example.com/[R] +# RewriteRule /(.*) https://users.example.com/$1 [R] - CustomLog /var/log/apache2/redirect.log origin + CustomLog ${APACHE_LOG_DIR}/redirect.log origin </VirtualHost> <VirtualHost *:80> - ServerName www.users.example.com - ServerAlias *.users.example.com - ServerAlias *.users - ServerAdmin webmaster@example.com + ServerName www.users.example.com + ServerAlias *.users.example.com + ServerAlias *.users + ServerAdmin webmaster@example.com - Include /etc/apache2/conf.d/local-log-origin.conf + Include conf.d/local-log-origin.conf - RewriteEngine On - RewriteRule / http://users.example.com/ [R] + RewriteEngine On +# RewriteRule / http://users.example.com/ [R] +# RewriteRule /(.*) http://users.example.com/$1 [R] + RewriteRule / https://users.example.com/ [R] +# RewriteRule /(.*) https://users.example.com/$1 [R] - CustomLog /var/log/apache2/redirect.log origin + CustomLog ${APACHE_LOG_DIR}/redirect.log origin </VirtualHost> diff --git a/apache2/sites-available/wiki.secure-example.com b/apache2/sites-available/wiki.secure-example.com index 8ca2919..5a6c146 100644 --- a/apache2/sites-available/wiki.secure-example.com +++ b/apache2/sites-available/wiki.secure-example.com @@ -1,10 +1,9 @@ <VirtualHost *:443> - ServerName wiki.example.com - ServerAdmin webmaster@example.com + ServerName wiki.example.com + ServerAdmin webmaster@example.com + DocumentRoot /usr/share/moin/htdocs - DocumentRoot /usr/share/moin/htdocs - - Include /etc/apache2/conf.d/local-ssl.conf + Include conf.d/local-ssl.conf # <Location /> # Options +ExecCGI @@ -20,57 +19,56 @@ # choose the ModPy Request class as handler PythonHandler MoinMoin.request::RequestModPy.run - # PythonOption Location /moin </Directory> # Use default themes - Alias /wiki/ /usr/share/moin/htdocs/ - - AcceptPathInfo On - - RewriteEngine On - RewriteLogLevel 1 - RewriteRule ^/moin(/(.*))? /$2 [last,R] - RewriteRule ^/wiki/ - [last] - RewriteRule ^/robots.txt - [last] - RewriteRule ^/favicon.ico - [last] -# RewriteRule ^/?(.*) /usr/share/moin/server/moin.cgi/$1 [last,type=application/x-httpd-cgi] -# RewriteRule ^/?(.*) /var/local/moin/server/moinmodpy.py$1 [last,type=application/x-python-code] - RewriteRule ^/?(.*) /usr/share/moin/server/moinmodpy.py/$1 [last,type=application/x-python-code] -# RewriteRule ^/?(.*) /var/local/moin/server/moinmodpy.py$1 [last] -# RewriteRule ^/?(.*) moin/$1 [last,type=application/x-python-code] - - ErrorLog /var/log/apache2/wiki.example.com-error.log - CustomLog /var/log/apache2/wiki.example.com-access.log combined + Alias /wiki/ /usr/share/moin/htdocs/ + + AcceptPathInfo On + + RewriteEngine On + RewriteLogLevel 1 + RewriteRule ^/moin(/(.*))? /$2 [last,R] + RewriteRule ^/wiki/ - [last] + RewriteRule ^/robots.txt - [last] + RewriteRule ^/favicon.ico - [last] +# RewriteRule ^/?(.*) /usr/share/moin/server/moin.cgi/$1 [last,type=application/x-httpd-cgi] +# RewriteRule ^/?(.*) /var/local/moin/server/moinmodpy.py$1 [last,type=application/x-python-code] + RewriteRule ^/?(.*) /usr/share/moin/server/moinmodpy.py/$1 [last,type=application/x-python-code] +# RewriteRule ^/?(.*) /var/local/moin/server/moinmodpy.py$1 [last] +# RewriteRule ^/?(.*) moin/$1 [last,type=application/x-python-code] + + ErrorLog ${APACHE_LOG_DIR}/wiki.example.com-error.log + CustomLog ${APACHE_LOG_DIR}/wiki.example.com-access.log combined </VirtualHost> <VirtualHost *:443> - ServerName www.wiki.example.com:443 - ServerAlias wiki:443 - ServerAlias *.wiki:443 - ServerAdmin webmaster@example.com + ServerName www.wiki.example.com:443 + ServerAlias wiki:443 + ServerAlias *.wiki:443 + ServerAdmin webmaster@example.com - Include /etc/apache2/conf.d/local-ssl.conf - Include /etc/apache2/conf.d/local-log-origin.conf + Include conf.d/local-ssl.conf + Include conf.d/local-log-origin.conf - RewriteEngine On -# RewriteRule / https://wiki.example.com/ [R] - RewriteRule /(.*)? https://wiki.example.com/$1 [R] + RewriteEngine On + RewriteRule / https://wiki.example.com/ [R] +# RewriteRule /(.*)? https://wiki.example.com/$1 [R] - CustomLog /var/log/apache2/redirect.log origin + CustomLog ${APACHE_LOG_DIR}/redirect.log origin </VirtualHost> <VirtualHost *:80> - ServerName wiki.example.com - ServerAlias *.wiki.example.com - ServerName wiki - ServerAlias *.wiki - ServerAdmin webmaster@example.com + ServerName wiki.example.com + ServerAlias *.wiki.example.com + ServerName wiki + ServerAlias *.wiki + ServerAdmin webmaster@example.com - Include /etc/apache2/conf.d/local-log-origin.conf + Include conf.d/local-log-origin.conf - RewriteEngine On -# RewriteRule / https://wiki.example.com/ [R] - RewriteRule /(.*)? https://wiki.example.com/$1 [R] + RewriteEngine On + RewriteRule / https://wiki.example.com/ [R] +# RewriteRule /(.*)? https://wiki.example.com/$1 [R] - CustomLog /var/log/apache2/redirect.log origin + CustomLog ${APACHE_LOG_DIR}/redirect.log origin </VirtualHost> diff --git a/apache2/sites-available/www.secure-example.com b/apache2/sites-available/www.secure-example.com index 3842593..4016d14 100644 --- a/apache2/sites-available/www.secure-example.com +++ b/apache2/sites-available/www.secure-example.com @@ -1,39 +1,38 @@ <VirtualHost *:80> - ServerName www.example.com - ServerAlias www - ServerAdmin webmaster@example.com + ServerName www.example.com + ServerAlias www + ServerAdmin webmaster@example.com + DocumentRoot /home/webmaster/public_websites/www.example.com/ - DocumentRoot /home/webmaster/public_websites/www.example.com/ - - ErrorLog /var/log/apache2/www.example.com-error.log - CustomLog /var/log/apache2/www.example.com-access.log combined + ErrorLog ${APACHE_LOG_DIR}/www.example.com-error.log + CustomLog ${APACHE_LOG_DIR}/www.example.com-access.log combined </VirtualHost> <VirtualHost *:80> - ServerName example.com - ServerAlias *.www.example.com - ServerAdmin webmaster@example.com + ServerName example.com + ServerAlias *.www.example.com + ServerAdmin webmaster@example.com - Include /etc/apache2/conf.d/local-log-origin.conf + Include conf.d/local-log-origin.conf - RewriteEngine On - RewriteRule / http://www.example.com/ [R] -# RewriteRule /(.*) http://www.example.com/$1 [R] + RewriteEngine On + RewriteRule / http://www.example.com/ [R] +# RewriteRule /(.*) http://www.example.com/$1 [R] - CustomLog /var/log/apache2/redirect.log origin + CustomLog ${APACHE_LOG_DIR}/redirect.log origin </VirtualHost> <VirtualHost *:443> - ServerName www.example.com:443 - ServerAlias *.example.com:443 - ServerName www:443 - ServerAlias *.www:443 - ServerAdmin webmaster@example.com + ServerName www.example.com:443 + ServerAlias *.example.com:443 + ServerName www:443 + ServerAlias *.www:443 + ServerAdmin webmaster@example.com - Include /etc/apache2/conf.d/local-ssl.conf - Include /etc/apache2/conf.d/local-log-origin.conf + Include conf.d/local-ssl.conf + Include conf.d/local-log-origin.conf - RewriteEngine On - RewriteRule / http://www.example.com/ [R] -# RewriteRule /(.*) http://www.example.com/$1 [R] + RewriteEngine On + RewriteRule / http://www.example.com/ [R] +# RewriteRule /(.*) http://www.example.com/$1 [R] - CustomLog /var/log/apache2/redirect.log origin + CustomLog ${APACHE_LOG_DIR}/redirect.log origin </VirtualHost> |