# General setup for the virtual host
ServerName lab.mitty.jp
ServerSignature On
LogLevel warn
ErrorLog "|/usr/sbin/rotatelogs /var/log/apache2/ssl/error_lab_%Y%m%d_log 86400 540"
CustomLog "|/usr/sbin/rotatelogs /var/log/apache2/ssl/access_lab_%Y%m%d_log 86400 540" combined
SSLEngine on
SSLCertificateFile "/path/to/ssl/server.crt"
SSLCertificateKeyFile "/path/to/ssl/server.key"
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
DocumentRoot "/var/www/lab"
SSLRequireSSL
Options FollowSymLinks
AllowOverride None
Order Deny,Allow
Deny from all
Order Allow,Deny
Allow from all
SetEnv HTTPS 1
# Alias for project independent contents
Order Allow,Deny
Allow from all
Alias /static/trac /var/www/trac
Alias /static/svn /home/tools/www/svn
Alias /static/htdocs /home/tools/trac/htdocs
# Alias for SVN
RedirectMatch ^/svn$ /svn/
# Requests for a collection must have a trailing slash on the URI.
DAV svn
SVNParentPath /var/svn/lab
SVNListParentPath on
SVNIndexXSLT "/static/svn/svnindex.xsl"
AuthType Basic
AuthName "Authentication for lab.mitty.jp"
AuthUserFile /home/tools/passwd/htpasswd.lab
AuthzSVNAccessFile /home/tools/passwd/svn-authz.lab
Require valid-user
Order Allow,Deny
Allow from all
# Alias for Trac
ScriptAlias /trac /home/tools/trac/cgi-bin/trac.fcgi
FcgidInitialEnv PYTHON_EGG_CACHE "/tmp"
FcgidInitialEnv TRAC_ENV_PARENT_DIR "/var/trac/lab"
# increase fcgi timeout value to wait slow cgi exec
FcgidIOTimeout 180
AuthType Basic
AuthName "Authentication for lab.mitty.jp"
AuthUserFile /home/tools/passwd/htpasswd.lab
Require valid-user
Order Allow,Deny
Allow from all
Require valid-user
## Trac query redirect
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteRule ^/trac/([^/]+)/query$ - [L]
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{HTTP_COOKIE} !trac_auth=
RewriteRule ^/trac/([^/]+)/query$ /trac/$1/query?status=!&group=component [R,L]
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{HTTP_COOKIE} trac_auth=
RewriteRule ^/trac/([^/]+)/query$ /trac/$1/query?status=!closed&group=component [R,L]