Trac and Subversion on Site5 (Updated again)

Technology No Comments

Before I try and take all the glory I need to thank Chandra who did most of the work. All I’ve done is modify it for just Site5. You can find her article at http://chandraonline.net/blog/?p=17

Site5 allows multiple accounts in trac but only a single account in subversion because it’s through ssh rather than through webdav.

Site5 comes with subversion and Python installed so most of the work is already done. Before we start I’m going to make a couple of assumptions.

  1. Our repository will be at ~/repos
  2. Trac will be installed at ~/trac
  3. Trac projects will be stored at ~/trac-projects
  4. We are only going to setup a single version of trac.
  5. We want to access trac from http://www.example.com/trac

1. Contact Support

Contact Support and get them to add you to the compilers group and change my environment so I can access /usr/include. When I requested this it took less than 5 minutes for them to respond.

2. Installing ClearSilver (0.10.3):

Download http://www.clearsilver.net/downloads/clearsilver-0.10.3.tar.gz and upload it to your server using ftp.
$ tar xzvf clearsilver-0.10.3.tar.gz
$ mv clearsilver-0.10.3 clearsilver-0.10.3-dist
$ cd clearsilver-0.10.3-dist
$ ./configure –prefix=$HOME/clearsilver-0.10.3 –with-python –disable-ruby –disable-java –disable-perl –disable-csharp
$ make ; make install –prefix=$HOME/clearsilver-0.10.3

3. Install Trac

Download Trac http://ftp.edgewall.com/pub/trac/trac-0.9.5.tar.gz and upload it to your server using ftp.
$ tar xzvf trac-0.9.5.tar.gz
$ mv trac-0.9.5 trac-0.9.5-dist
$ cd trac-0.9.5-dist
$ python setup.py build
$ python setup.py install –prefix=/home/??????/trac
$ cp ~/clearsilver-0.10.3-dist/python/neo_cgi.so ~/trac/lib/python2.3/site-packages/
4. Setup a Subversion Repository

$ svnadmin create ~/repos

5. Setup a Trac Environment

$ trac-admin $HOME/trac-projects initenv

6. Create the link between Subversion and Trac.

$ mkdir ~/trac/contrib/
$ svn cat http://svn.edgewall.com/repos/trac/trunk/contrib/trac-post-commit-hook > trac-post-commit-hook
$ create a ~/repos/hooks/post-commit with the following content (replace ???????? with you details):
#!/bin/sh
REPOS=”$1″
REV=”$2″
LOG=`/usr/bin/svnlook log -r $REV $REPOS`
AUTHOR=`/usr/bin/svnlook author -r $REV $REPOS`
TRAC_ENV=’/home/????????/trac-projects’
TRAC_URL=’http://www.????????.com/trac/’

/usr/bin/python /home/????????/trac/contrib/trac-post-commit-hook \
-p “$TRAC_ENV” \
-r “$REV” \
-u “$AUTHOR” \
-m “$LOG” \
-s “$TRAC_URL”

7. Setup Webaccess

$ mkdir $HOME/public_html/trac
$ cd trac
# create a projects.cgi with the following content (replace ???????? with you details):
#!/bin/bash
export PATH=”/home/????????/trac/bin”:$PATH
export PYTHONPATH=”/home/????????/trac/lib/python2.3/site-packages”
export TRAC_ENV=”/home/????????/trac-projects”
/home/????????/trac/share/trac/cgi-bin/trac.cgi
$ chmod +x projects.cgi
$ ln -sf $HOME/python/share/trac/htdocs trac-static
# edit $HOME/trac-projects/conf/trac.ini and add the following under [trac]
htdocs_location = /trac-static

Using Site5 Backend create users and passwords on the directory.

If you find and mistakes in this document please feel free to leave a comment or email me.

Update April 2008: The comments were lost when I migrated this post to a new blog. I’ve tried to answer the questions here.

  1. When I setup Trac it only supported SQLite so I don’t know how to set it for for MySQL. I would personally recommend SQLite anyway as it will probably be faster on Site5.
  2. This version of Trac doesn’t have pretty URLs so you have to click on the CGI script that you created. If there is a problem you might want to move projects.cgi to cgi-bin
  3. When you install ClearSilver make sure you use “python setup.py install –prefix=$HOME/trac” if you miss the prefix then there will be problems later on.
  4. Subversion over http/https isn’t possible at Site5 because they Frontpage extensions which are incompatible with subversion module for apache.
  5. If you have only just found this page you may want to install Trac 0.11 instead of 0.10 because then you don’t have to install ClearSilver.

SiteAdvisor

Technology No Comments

What is it?

SiteAdvisor is a tool-bar that becomes part of your browser and does two things:

  1. When you visit a site there is a button that goes green (good), yellow (caution), red (bad) or gray (untested). This rating has nothing to do with any content on the page but rather it has to do with the web-sites conduct. Do they have pop-ups, install spyware, email spam, etc.
  2. It dynamically changes search results and puts the sites rating next to the link to the site. This means you don’t even need to visit the site to know if it’s good or bad.
  3. If you click on the ratings you can find out the reason behind it as well as lots of additional email about the site.

Why use it?

Spyware, popup blockers and antivirus tools are great but if you never need them in the first place then that’s even better. I’ve installed this product onto a numbers of friends computers and after installing it the number of problems with their computers dropped dramatically. I think the best thing about it is that it’s really easy to understand. Green is good. Red is bad. It works really well for people who treat computers like magic boxes and for people who understand computers it’s a useful tool.

Links

SiteAdvisor for Firefox

SiteAdvisor for Internet Explorer