diff options
author | Jonas Smedegaard <dr@jones.dk> | 2006-04-02 16:01:51 +0000 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2006-04-02 16:01:51 +0000 |
commit | 67f3fa100fb12ec2216345006c51717929dffeb3 (patch) | |
tree | be6c18ad2a25e25d42ec2b7ea730a75f831e9a6e | |
parent | f2d69c225dd64ba27813cb08b39b512bceaf1368 (diff) |
Add new sample apache2 config snippets.
-rw-r--r-- | apache2/conf.d/local-log-vhosts.conf | 5 | ||||
-rw-r--r-- | apache2/conf.d/local-macvolumes.conf | 1 | ||||
-rw-r--r-- | apache2/conf.d/local-ssl.conf | 23 | ||||
-rw-r--r-- | apache2/sites-available/lists.secure-example.com | 49 | ||||
-rw-r--r-- | apache2/sites-available/mail.secure-example.com | 36 | ||||
-rw-r--r-- | apache2/sites-available/people.secure-example.com | 41 | ||||
-rw-r--r-- | apache2/sites-available/wiki.secure-example.com | 83 | ||||
-rw-r--r-- | apache2/sites-available/www.secure-example.com | 21 |
8 files changed, 259 insertions, 0 deletions
diff --git a/apache2/conf.d/local-log-vhosts.conf b/apache2/conf.d/local-log-vhosts.conf new file mode 100644 index 0000000..a8c8920 --- /dev/null +++ b/apache2/conf.d/local-log-vhosts.conf @@ -0,0 +1,5 @@ +# logformat used by vlogger +LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_vlogger + +# Simple setup for a single shared dir for all vhosts +#CustomLog "| /usr/sbin/vlogger -s access.log -u www-data -g www-data -t '%Y.%m.%d' /var/log/apache-vhosts" combined_vlogger diff --git a/apache2/conf.d/local-macvolumes.conf b/apache2/conf.d/local-macvolumes.conf new file mode 100644 index 0000000..a3ec693 --- /dev/null +++ b/apache2/conf.d/local-macvolumes.conf @@ -0,0 +1 @@ +IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t "Network Trash Folder" TheVolumeSettingsFolder :2eDS_Store "Temporary Items" diff --git a/apache2/conf.d/local-ssl.conf b/apache2/conf.d/local-ssl.conf new file mode 100644 index 0000000..40e6be3 --- /dev/null +++ b/apache2/conf.d/local-ssl.conf @@ -0,0 +1,23 @@ +SSLEngine on +SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL +SSLCertificateFile /etc/ssl/certs/apache2.pem +SSLCertificateKeyFile /etc/ssl/private/apache2.pem +SSLCACertificatePath /etc/ssl/certs +#SSLCARevocationPath /etc/apache2/ssl.crl +#SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl +#SSLVerifyClient require +#SSLVerifyDepth 10 + +<Files ~ "\.(cgi|shtml|phtml|php3?)$"> + SSLOptions +StdEnvVars +</Files> +<Directory "/usr/lib/cgi-bin"> + SSLOptions +StdEnvVars +</Directory> + +SetEnvIf User-Agent ".*MSIE.*" \ + nokeepalive ssl-unclean-shutdown \ + downgrade-1.0 force-response-1.0 + +CustomLog /var/log/apache2/ssl_request_log \ + "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" diff --git a/apache2/sites-available/lists.secure-example.com b/apache2/sites-available/lists.secure-example.com new file mode 100644 index 0000000..dd28c88 --- /dev/null +++ b/apache2/sites-available/lists.secure-example.com @@ -0,0 +1,49 @@ +<VirtualHost *:443> + ServerName lists.secure-example.com:443 + ServerAlias lists + ServerAdmin webmaster@secure-example.com + DocumentRoot /home/admin/public_websites/lists.secure-example.com/ + + Include /etc/apache2/conf.d/local-ssl.conf + + 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] + + <Location /images/> + order deny,allow + allow from all + </Location> + + Include /etc/apache2/conf.d/local-log-vhosts.conf + CustomLog "| /usr/sbin/vlogger -s access.log -u admin -g admin -t '%Y.%m.%d' /home/admin/weblogs" combined_vlogger + ErrorLog "| /usr/sbin/vlogger -s error.log -u admin -g admin -t '%Y.%m.%d' -e /home/admin/weblogs/ERRORS" +</VirtualHost> +<VirtualHost *:443> + ServerName www.lists.secure-example.com:443 + ServerAlias *.lists.secure-example.com:443 + ServerAdmin webmaster@secure-example.com + + Include /etc/apache2/conf.d/local-ssl.conf + + RewriteEngine On + RewriteRule / https://lists.secure-example.com/ [R] +# RewriteRule /(.*) https://lists.secure-example.com/$1 [R] + + TransferLog /dev/null +</VirtualHost> +<VirtualHost *:80> + ServerName lists.secure-example.com + ServerAlias *.lists.secure-example.com + ServerAdmin webmaster@secure-example.com + + RewriteEngine On + RewriteRule / https://lists.secure-example.com/ [R] +# RewriteRule /(.*) https://lists.secure-example.com/$1 [R] + + TransferLog /dev/null +</VirtualHost> diff --git a/apache2/sites-available/mail.secure-example.com b/apache2/sites-available/mail.secure-example.com new file mode 100644 index 0000000..acb0029 --- /dev/null +++ b/apache2/sites-available/mail.secure-example.com @@ -0,0 +1,36 @@ +<VirtualHost *:443> + ServerName mail.secure-example.com:443 + ServerAlias mail + ServerAdmin webmaster@secure-example.com + DocumentRoot /home/admin/public_websites/mail.secure-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> +</VirtualHost> +<VirtualHost *:443> + ServerName www.mail.secure-example.com:443 + ServerAlias *.mail.secure-example.com:443 + ServerAdmin webmaster@secure-example.com + + Include /etc/apache2/conf.d/local-ssl.conf + + RewriteEngine On + RewriteRule / https://mail.secure-example.com/ [R] + + TransferLog /dev/null +</VirtualHost> +<VirtualHost *:80> + ServerName mail.secure-example.com + ServerAlias *.mail.secure-example.com + ServerAdmin webmaster@secure-example.com + + RewriteEngine On + RewriteRule / https://mail.secure-example.com/ [R] + + TransferLog /dev/null +</VirtualHost> diff --git a/apache2/sites-available/people.secure-example.com b/apache2/sites-available/people.secure-example.com new file mode 100644 index 0000000..1a83355 --- /dev/null +++ b/apache2/sites-available/people.secure-example.com @@ -0,0 +1,41 @@ +<VirtualHost *:80> + ServerName people.secure-example.com + ServerAlias people + ServerAdmin webmaster@secure-example.com + DocumentRoot /home/admin/public_websites/people.secure-example.com/ + + Include /etc/apache2/conf.d/local-userdir.conf + Include /etc/apache2/conf.d/local-macvolumes.conf + + RewriteEngine On + RewriteRule ^/-(.*)$ http://people.secure-example.com/~$1 [R] + RewriteRule ^/([^~].*)$ http://people.secure-example.com/~$1 [R] + + Include /etc/apache2/conf.d/local-log-vhosts.conf + CustomLog "| /usr/sbin/vlogger -s access.log -u admin -g admin -t '%Y.%m.%d' /home/admin/weblogs" combined_vlogger + ErrorLog "| /usr/sbin/vlogger -s error.log -u admin -g admin -t '%Y.%m.%d' -e /home/admin/weblogs/ERRORS" +</VirtualHost> +<VirtualHost *:80> + ServerName www.people.secure-example.com + ServerAlias *.people.secure-example.com + ServerAdmin webmaster@secure-example.com + + RewriteEngine On + RewriteRule / http://people.secure-example.com/ [R] +# RewriteRule /(.*) http://people.secure-example.com/$1 [R] + + TransferLog /dev/null +</VirtualHost> +<VirtualHost *:443> + ServerName people.secure-example.com:443 + ServerAlias *.people.secure-example.com:443 + ServerAdmin webmaster@secure-example.com + + Include /etc/apache2/conf.d/local-ssl.conf + + RewriteEngine On + RewriteRule / http://people.secure-example.com/ [R] +# RewriteRule /(.*) http://people.secure-example.com/$1 [R] + + TransferLog /dev/null +</VirtualHost> diff --git a/apache2/sites-available/wiki.secure-example.com b/apache2/sites-available/wiki.secure-example.com new file mode 100644 index 0000000..f36ddf0 --- /dev/null +++ b/apache2/sites-available/wiki.secure-example.com @@ -0,0 +1,83 @@ +<VirtualHost *:443> + ServerName wiki.secure-example.com + ServerAlias wiki + ServerAdmin webmaster@secure-example.com + DocumentRoot /usr/share/moin/htdocs + + Include /etc/apache2/conf.d/local-ssl.conf + +# <Location /> +# Options +ExecCGI +# </Location> + + <Directory /usr/share/moin/server/> + # Use mod_python as handler + SetHandler python-program + + # set the path to the MoinMoin package and to the wikiconfig.py + PythonPath "['/etc/moin']+sys.path" + + # 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] + + Include /etc/apache2/conf.d/local-log-vhosts.conf + CustomLog "| /usr/sbin/vlogger -s access.log -u admin -g admin -t '%Y.%m.%d' /home/admin/weblogs" combined_vlogger + ErrorLog "| /usr/sbin/vlogger -s error.log -u admin -g admin -t '%Y.%m.%d' -e /home/admin/weblogs/ERRORS" +</VirtualHost> +<VirtualHost *:443> + ServerName www.wiki.secure-example.com:443 + ServerAlias *.wiki.secure-example.com:443 + ServerAdmin webmaster@secure-example.com + + Include /etc/apache2/conf.d/local-ssl.conf + + RewriteEngine On +# RewriteRule / https://wiki.secure-example.com/ [R] + RewriteRule /(.*)? https://wiki.secure-example.com/$1 [R] + + TransferLog /dev/null +</VirtualHost> +<VirtualHost *:80> + ServerName wiki.secure-example.com + ServerAdmin webmaster@secure-example.com + + RewriteEngine On +# RewriteRule / https://wiki.secure-example.com/ [R] + RewriteRule /(.*)? https://wiki.secure-example.com/$1 [R] + + TransferLog /dev/null +</VirtualHost> +<VirtualHost *:80> + ServerName www.wiki.secure-example.com + ServerAlias *.wiki.secure-example.com + ServerAdmin webmaster@secure-example.com + + RewriteEngine On + RewriteRule / https://wiki.secure-example.com/ [R] +# RewriteRule /(.*)? https://wiki.secure-example.com/$1 [R] + + TransferLog /dev/null +</VirtualHost> diff --git a/apache2/sites-available/www.secure-example.com b/apache2/sites-available/www.secure-example.com new file mode 100644 index 0000000..ee756ae --- /dev/null +++ b/apache2/sites-available/www.secure-example.com @@ -0,0 +1,21 @@ +<VirtualHost *:80> + ServerName www.secure-example.com + ServerAlias www + ServerAdmin webmaster@secure-example.com + DocumentRoot /home/admin/public_websites/www.secure-example.com/ + + Include /etc/apache2/conf.d/local-log-vhosts.conf + CustomLog "| /usr/sbin/vlogger -s access.log -u admin -g admin -t '%Y.%m.%d' /home/admin/weblogs" combined_vlogger + ErrorLog "| /usr/sbin/vlogger -s error.log -u admin -g admin -t '%Y.%m.%d' -e /home/admin/weblogs/ERRORS" +</VirtualHost> +<VirtualHost *:80> + ServerName secure-example.com + ServerAlias *.www.secure-example.com + ServerAdmin webmaster@secure-example.com + + RewriteEngine On + RewriteRule / http://www.secure-example.com/ [R] +# RewriteRule /(.*) http://www.secure-example.com/$1 [R] + + TransferLog /dev/null +</VirtualHost> |