From time to time I use Dreamhost’s one-click-install version of Trac for a project. I always forget the steps I have to go through to get it working, so, for posterity, here’s how it works. This will set up a Trac site that allows the general public to visit your Trac site, but allows people who have commit permissions on SVN to login to the admin side of the site. It also sets up email notifications.
- First setup the new domain from the Manage Domains panel and create subdomains for SVN and for Trac, e.g. svn.mydomain.com and trac.mydomain.com (assuming you’ll host the live project at some place like www.mydomain.com). Make sure to enable Passenger for the Trac domain and set the directory to /home/username/trac.mydomain.com/public. It’s important that all of these domains use the SAME username.
- Go to the Goodies > Subversion panel and setup the SVN repository, making sure to check the box to also set up a Trac install. This will setup the Trac install inside of /home/username/trac.mydomain.com/public and also create a directory /home/username/trac_mydomain_com_public_trac with all of the Trac resources necessary.
- cd into /home/username/trac.mydomain.com/public and create admin users with the following:
trac-admin . permission add adminusername TRAC_ADMIN
- SSH into the new user’s account. Download the Trac AccountManager plugin from trac-hacks.org:
svn co http://trac-hacks.org/svn/accountmanagerplugin/0.11 accountmanager
- cd into the accountmanager directory and build the plugin with the following command:
python setup.py bdist_egg
- Copy the .egg file created in the accountmanager/dist folder into /home/username/trac.mydomain.com/public/plugins
- (Optional) If you want to personalize with your own logo, upload the logo file to /home/username/trac.mydomain.com/public/chrome/site
- Edit the trac.ini file in /home/username/trac.mydomain.com/public/conf as follows:
[account-manager] password_file = /home/username/svn/mydomain.passwd password_store = HtPasswdStore [components] trac.web.auth.LoginModule = disabled acct_mgr.web_ui.LoginModule = enabled acct_mgr.web_ui.RegistrationModule = disabled [header_logo] height = your logo's height src = site/your_logo_filename.png width = your logo's width [notification] smtp_enabled = true smtp_from = firstname.lastname@example.org smtp_replyto = email@example.com<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">
- Edit the .htaccess file in /home/username/trac.mydomain.com/public to allow your logo file to be shown by adding the following line after the line that says
# Keep the graphics and style sheet the way they are RewriteCond $1 !^chrome/site(.*).png$
Note that on that last step, if your logo file is some other file type, e.g. gif, that you should swap out .png for .gif or whatever.
That should do it! Not that difficult, and doesn’t require any major hacks to the default infrastructure provided by Dreamhosts’s one-click-install. Of course it always takes me much longer than it should since I have to figure it out again every time I do it.