
<VirtualHost *:443>
    ServerName tracsite.coderanger.net
    ServerAdmin webmaster@coderanger.net
    
    # Note: This folder should exist, but will generally be empty
    DocumentRoot /srv/tracsite/htdocs
    <Directory /srv/tracsite/htdocs>
        Order allow,deny
        Allow from all
    </Directory>
    
    # ---- SSL ----
    # Note: If you are not using SSL, make sure to change the port above
    SSLEngine On
    SSLCipherSuite HIGH:MEDIUM    
    SSLProtocol all -SSLv2
    SSLCertificateFile /etc/ssl/...
    SSLCertificateKeyFile /etc/ssl/...
        
    # ---- TRAC ----
    # Note: See below for the contents of this file.
            The trailing slash is important, don't leave it off.
    ScriptAlias / /srv/tracsite/cgi-bin/trac.fcgi/
    
    # ---- AUTHENTICATION ----
    # Note: Do not add this section if you are planning to use AccountManager for logins.
    #       Use the normal htpasswd[2] tool to create/update this file.
    <Location /login>
        AuthType Basic
        AuthName "Trac Login"
        AuthUserFile /srv/tracsite/htpasswd
        Require valid-user
    </Location>
</VirtualHost>

# ---- TRAC.FCGI ----
# Note: This will work on >=0.9

#!/usr/bin/env python
import os

from trac.web.main import dispatch_request
try:
    from flup.server.fcgi import WSGIServer
except ImportError:
    from trac.web._fcgi import WSGIServer

if __name__ == '__main__':
    os.environ['TRAC_ENV'] = '/srv/tracsite/trac'
    os.environ['PYTHON_EGG_CACHE'] = '/tmp'
    WSGIServer(dispatch_request).run()
