Trac over HTTPS

I just set up an SVN project on HTTPS and added a Trac project.

The Trac project is accessible over HTTP and HTTPS and the HTTPS is broken. It seems to be missing CSS or something similar.

Has anyone successfully set up Trac over HTTPS?

Yes, I’ve setup SVN and Trac with HTTPS (using SNI and a self-signed cert). I’ll help if I can.

What is the CSS URL that fails and what error does it get?

I found the problem. It references the HTTP addresses for CSS and script and even though they were available my security settings would not allow it and I did not notice.
Not sure that helps though, as I’d have to leave the HTTP sit available for it to work :frowning:

Now I have another error I’m working on
I’m trying to add svn trac-post-commit-hook and getting this error

trac.core.TracError: The user dhapache requires read and write permissions to the database file /home/userx/trac/db/trac.db and the directory it is located in.

The fix I used was to change htdocs_location configuration in conf/trac.ini to use https:

htdocs_location =

If you want to support both HTTP and HTTPS, you could probably use a protocol-relative URL, like this:

htdocs_location = //

However, for security it is probably best to require HTTPS. You can do this by putting this directive in .htaccess:


Thanks for the info. I’ll try that. I don’t want HTTP access so that should be fine.
I solved my other issue by using acl to give dhapache write permission to the database. Seems to work.

Your suggestions seemed to work. Thanks

Now my problem is that the trac server seems to go down for a few minutes every hour or so :frowning: