From 67f3fa100fb12ec2216345006c51717929dffeb3 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 2 Apr 2006 16:01:51 +0000 Subject: Add new sample apache2 config snippets. --- apache2/conf.d/local-log-vhosts.conf | 5 ++ apache2/conf.d/local-macvolumes.conf | 1 + apache2/conf.d/local-ssl.conf | 23 +++++++ apache2/sites-available/lists.secure-example.com | 49 +++++++++++++ apache2/sites-available/mail.secure-example.com | 36 ++++++++++ apache2/sites-available/people.secure-example.com | 41 +++++++++++ apache2/sites-available/wiki.secure-example.com | 83 +++++++++++++++++++++++ apache2/sites-available/www.secure-example.com | 21 ++++++ 8 files changed, 259 insertions(+) create mode 100644 apache2/conf.d/local-log-vhosts.conf create mode 100644 apache2/conf.d/local-macvolumes.conf create mode 100644 apache2/conf.d/local-ssl.conf create mode 100644 apache2/sites-available/lists.secure-example.com create mode 100644 apache2/sites-available/mail.secure-example.com create mode 100644 apache2/sites-available/people.secure-example.com create mode 100644 apache2/sites-available/wiki.secure-example.com create mode 100644 apache2/sites-available/www.secure-example.com 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 + + + SSLOptions +StdEnvVars + + + SSLOptions +StdEnvVars + + +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 @@ + + 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] + + + order deny,allow + allow from all + + + 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" + + + 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 + + + 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 + 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 @@ + + 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 + + Options FollowSymLinks -MultiViews + DirectoryIndex index.php + + + + 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 + + + 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 + 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 @@ + + 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" + + + 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 + + + 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 + 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 @@ + + 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 + +# +# Options +ExecCGI +# + + + # 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 + + + # 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" + + + 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 + + + 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 + + + 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 + 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 @@ + + 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" + + + 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 + -- cgit v1.2.3