I set up Trac with mod_wsgi, and all seems well except I can't access the projects. I can successfully see the list of projects after I log in, but Trac will hang indefinitely if I try to click on any of the projects.
If I run the same apache setup over port 80, everything runs fine. However I do not want it over port 80. I also generated my own certificates, which I am using. I can't spot what's wrong with my setup?
Here are the general steps I took:
cd /etc/apache2/sites-available
vi default-ssl
a2ensite default-ssl
/etc/init.d/apache2 restart
Going to https://www.myserver.com/trac
shows my list of trac projects.
Clicking on any of these results in trac hanging. ie, https://www.myserver.com/trac/project1
hangs.
sites-available/default-ssl:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
# Trac settings
WSGIScriptAlias /trac /var/lib/trac/apache/trac.wsgi
<Directory /var/lib/trac/apache>
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
# Trac authentication stuff
<Location /trac>
AuthName "Trac login"
AuthType Basic
AuthUserFile /var/lib/trac/.htpasswd
require valid-user
</Location>
# Trac mod_rewrite rules
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteLog "/var/lib/trac/logs/rewrite.log"
RewriteLogLevel 9
# Don't let DirectoryIndex mess with Trac installed in the root
RewriteCond %{REQUEST_URI} ^/$
RewriteRule . /trac [QSA,PT,L]
# Don't let Trac handle existing directories, files or aliases
RewriteCond /var/lib/trac%{REQUEST_FILENAME} !-d
RewriteCond /var/lib/trac%{REQUEST_FILENAME} !-f
# prepend /trac to URI and append Query String, Pass-Through to xxxAlias directives, Last rule.
RewriteRule ^(.*)$ /trac$1 [QSA,PT,L]
</IfModule>
....
</VirtualHost>
</IfModule>
Testing trac with http works just fine:
httpd.conf:
WSGIScriptAlias /trac /var/lib/trac/apache/trac.wsgi
<Directory /var/lib/trac/apache>
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
<Location /trac>
AuthType Basic
AuthName "Trac login"
AuthUserFile /var/lib/trac/.htpasswd
Require valid-user
</Location>
You know, this is really odd. I decided I'd reload the page. This time, I got the standard unverified certificate question, which I accepted...
Now trac has loaded completely. So it's fine now.
I had thought I already accepted the certificate before though. This is very odd!