Installing Trac on DreamHost
Posted by Johan on 08/17/2006
One of the things I really liked at TextDrive was the built-in support for Trac. Alas, DreamHost does not have Trac support by default. After reviewing the Trac section of the DreamHost wiki, I found an awesome tutorial by Nathaniel Tucker on installing Trac from scratch on DreamHost.
Overall, the tutorial is very straightforward, but there were a couple of glitches here and there that I thought I would highlight in this post. I decided to only install the WebAdmin Trac plugin and enable pretty URLs (both optional steps). It shouldn’t matter much, but I’m on bazooka.dreamhost.com and it has Python 2.3 installed by default.
Please note that you may want to allocate a block of about 2 hours to complete this process, since compilation times for e.g. Subversion tend to be rather long, at least on bazooka.dreamhost.com.
Clearsilver
Replace:
sed -i "s@/usr/local/bin/python@/usr/bin/env python@g" \
scripts/document.py
PYTHON_SITE=`/home/{username}/packages/bin/python -c \
"import sys; print [path for path in sys.path if \
path.find('site-packages') != -1][0]"` \
./configure --with-python=/home/{username}/packages/bin/python \
--prefix=$HOME/packages \
--disable-ruby --disable-java --disable-apache --disable-csharp --disable-perl
With:
sed -i "s@/usr/local/bin/python@/usr/bin/env python@g" \
scripts/document.py
PYTHON_SITE=`/usr/bin/python -c \
"import sys; print [path for path in sys.path if \
path.find('site-packages') != -1][0]"` \
./configure --with-python=/usr/bin/python \
--prefix=$HOME/packages \
--disable-ruby --disable-java --disable-apache --disable-csharp --disable-perl
Update [August 30, 2006]: Note: the
{username} part above is to be replaced with your DreamHost shell
user, e.g. jsmith. (Thank you, Natmaster)
SWIG
A quicker way of downloading the required SWIG tar ball.
Replace:
Get http://easynews.dl.sourceforge.net/sourceforge/swig/swig-1.3.29.tar.gz into your home directory.
With:
wget http://internap.dl.sourceforge.net/sourceforge/swig/swig-1.3.29.tar.gz
WebAdmin Plugin
The easy_install script did not work unless the Egg package ended with .egg (i.e. not .zip). So, I just renamed the zip file to have a .egg extension.
wget http://trac.edgewall.org/attachment/wiki/WebAdmin/TracWebAdmin-0.1.1dev_r2765-py2.3.egg.zip?format=raw
mv http://trac.edgewall.org/attachment/wiki/WebAdmin/TracWebAdmin-0.1.1dev_r2765-py2.3.egg.zip?format=raw TracWebAdmin-0.1.1dev_r2765-py2.3.egg.zip?format=raw TracWebAdmin-0.1.1dev_r2765-py2.3.egg
Note: Once installed, this plugin will appear as an “Admin” tab in the Trac UI for all users who have been given admin rights (see trac-admin section of the original tutorial).
Other Gottchas
File Permissions
If something isn’t working, go through all relevant files and directories nand make sure your file permissions are set to be readable by the web server, also double-check that the Trac user you are using has Trac admin rights, if you’re using the WebAdmin plugin.
Quick permission changing example:
cd target_directory
find . -perm 700 -print|xargs chmod 755
Setting Trac user permissions (from original tutorial):
trac-admin $HOME/trac_sites/{your trac project id}
permission add admins TRAC_ADMIN
permission add {username} admins
Note: In this case, you would repeat this process for each Trac project.
Typos
I started off by using the CGI version over FCGI to not complicate things. Although, because I did so, I forgot to update parts of the .htaccess file in each project directory. So, make sure you’re referencing “fcgi” and not “cgi” if you decide to use FGCI.
Note that if you’re using FCGI, you would want to enable it in the DreamHost control panel for the Trac domain you’re configuring, e.g. projects.domain.com.
It’s also easy to forget to change project name references in e.g. the index.cgi and index.fcgi files for each project, which can lead to some interesting results : )
Multiple Projects
Since I manage multiple projects, I ended up setting up a simple .htaccess file in my $HOME/projects.domain.com directory (using the DreamHost control panel or just manually). I used the same username as the one specified in the trac-admin tool with admin rights. I then created a sub-directory for each Trac project, resulting in project.domain.com/project1 etc.
Good luck with your Trac installation on DreamHost : )


Loading...
lists.apple.com)
Hello, this is natmaster, the author of the guide you reference here. I am curious as to the reasoning behind your Clearsilver installation changes. You explain what {username} means, but you instruct users to get rid of those references?
I would like to fix any issues with my guide, so users do not have to look through many pages when they run into troubles. Thanks for posting your ideas to the web. :)
Ah; I see my mistake. I’m not sure how it slipped in there :-) I’ve removed the reference to replacing the {username}. The reasoning behind the ClearSilver change in the first place was that I found relying on the default system installation of Python easier and more appropriate, at least on bazooka.dreamhost.com. Thank you for the correction!
I also rely on the python installation to run. However, as I am not root, I cannot install necessary modules - which is why I reference my bin directory in some instances, so they can be installed in a place easily accessible.