TRAC has trouble with Ubuntu's {{{WartyWarthog}}} release; it needs versions of python-SQLite and clearsilver that aren't available on Warty. So I upgraded my fresh Warty to the {{{HoaryHedgehog}}} release. A fresh Hoary install should be ok but I didn't test that.
To upgrade I changed my etc\apt\sources.list to look like the one found [http://www.ubuntulinux.org/wiki/GuideToHoary/view?searchterm=hoary%20sources.list here,] or [wiki:TracOnUbuntu#sources.list] then ran the following commands:
{{{
sudo apt-get update
sudo apt-get upgrade
}}}
You can take a nice long break while Hoary is downloaded and installed.
Once that's done, we have a brand-new Hoary install. The rest of these instructions look painful, but really the hardest part is now over. With a fast net connection, you can do the rest of this in about ten minutes.
We need to install a few more things:
{{{
sudo apt-get install openssh-server
sudo apt-get install trac
sudo apt-get install libapache2-svn
}}}
Configure Apache for DAV (svn needs it) by editing '''/etc/apache2/sites-available/default'''. When you're done the file will look like this (I think my changes are pretty obvious - they are preceded by the comment lines IN ALL CAPS):
{{{
NameVirtualHost *
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# Commented out for Ubuntu
#RedirectMatch ^/$ /apache2-default/
## ---THESE LINES FROM ORIGINAL FILE WERE COMMENTED OUT---
# ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
#
# AllowOverride None
# Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
# Order allow,deny
# Allow from all
#
## ---END OF COMMENTS---
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
## ---THESE LINES WERE ADDED TO THE ORIGINAL FILE---
Alias /trac "/usr/share/trac/htdocs"
ScriptAlias /cgi-bin/ /usr/share/trac/cgi-bin/
SetEnv TRAC_ENV "/var/trac/project"
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
# You need something like this to authenticate users
AuthType Basic
AuthName "NIM"
AuthUserFile /var/www/trac.htpasswd
Require valid-user
#SVN dir
DAV svn
SVNParentPath /var/svn
## ---END OF ADDITIONS---
}}}
We need to enable the apache2 DAV mod with the following command:
{{{
sudo ln -s /etc/apache2/mods-available/dav.load /etc/apache2/mods-enabled/dav.load
}}}
I installed my Subversion repository at '''/var/svn/project'''. So I did a quick starting config of subversion with the following commands:
{{{
mkdir /var/svn
mkdir /var/svn/project
mkdir /tmp/project
mkdir /tmp/project/branches
mkdir /tmp/project/tags
mkdir /tmp/project/trunk
svnadmin create /var/svn/project
svn import /tmp/project file:///var/svn/project -m "initial import"
rm -rf /tmp/project
}}}
Some permissions changes and an apache restart are now needed:
{{{
sudo chown -R www-data /var/trac/project
sudo chown -R www-data /var/svn/project
sudo chown -R www-data /usr/share/trac
sudo apache2 -k restart
}}}
Test by going to !http://servername/svn/project
If this works, your Subversion install is up and running! Now let's finish the Trac install.
I put my trac environment at /var/trac/project. I'm not using the mod_python extentions at the moment. First I ran
{{{
mkdir /var/trac
trac-admin /var/trac/project initenv
}}}
The "trac-admin" command above prompted me to enter the project name (''project''), the path to the trac environment (''var/trac/project''), and the path to the Trac templates directory (''usr/share/trac/templates''); then it printed out a bunch of stuff. If there are no errors you should now be able to surf to your Trac site at '''!http://servername/cgi-bin/trac.cgi'''
At the time I did my install, there was one glitch in the Ubuntu Universe Trac installer. It doesn't install the neo_cgi.so file needed in the python2.4 directory space. So when I surfed to my Trac site, I got a complaint specifically about this missing file. I was able to fix this by symlinking the python2.3 version like so:
{{{
sudo ln -s /usr/lib/python2.3/site-packages/neo_cgi.so /usr/lib/python2.4/site-packages/neo_cgi.so
}}}
OPTIONAL: create a redirect file called /var/www.index.html with this one line:
{{{
}}}
... with this change, you can get to Trac with '''!http://servername''' instead of the more cumbersome '''!http://servername/cgi-bin/trac.cgi'''
== sources.list ==
{{{
## Main & restricted
deb http://archive.ubuntu.com/ubuntu hoary main restricted
deb-src http://archive.ubuntu.com/ubuntu hoary main restricted
## Universe
deb http://archive.ubuntu.com/ubuntu hoary universe
deb-src http://archive.ubuntu.com/ubuntu hoary universe
## Security
deb http://security.ubuntu.com/ubuntu hoary-security main restricted
deb-src http://security.ubuntu.com/ubuntu hoary-security main restricted
}}}