These instructions were written for a '''fresh install''' of Ubuntu(Hoary). I used the Ubuntu [http://www.ubuntulinux.org/support/documentation/faq/installation-custom/view?searchterm=server%20install Custom install] which creates a very bare-bones system - no X server or other niceties. Just the ticket for a lightweight, nimble server! These instructions should work OK under other conditions (full install, existing systems) as well. FYI, Trac has trouble with Ubuntu's {{{WartyWarthog}}} release; it needs versions of python-SQLite and clearsilver that aren't available on Warty (see #468 & #1104). So I upgraded my fresh Warty install to the {{{HoaryHedgehog}}} release. A fresh Hoary install should be ok but I didn't test that. To upgrade from Warty to Hoary, I changed my '''/etc/apt/sources.list''' to look like this: {{{ ## Main & restricted deb http://archive.ubuntu.com/ubuntu hoary main restricted deb-src http://archive.ubuntu.com/ubuntu hoary main restricted ## Universe (needed for the Trac install) 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 }}} ... then ran the following commands to actually perform the update: {{{ sudo apt-get update sudo apt-get -y 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 10-15 minutes. We need to install a few more things: {{{ 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--- }}} I installed my Subversion repository at '''/var/svn/project'''. So I did a quick starting config of subversion with the following commands: {{{ sudo mkdir /var/svn sudo mkdir /var/svn/project sudo mkdir /tmp/project sudo mkdir /tmp/project/branches sudo mkdir /tmp/project/tags sudo mkdir /tmp/project/trunk sudo svnadmin create /var/svn/project sudo svn import /tmp/project file:///var/svn/project -m "initial import" sudo rm -rf /tmp/project }}} Some permissions changes and an apache restart are now needed: {{{ sudo chown -R www-data /var/svn/project sudo chown -R www-data /usr/share/trac sudo apache2 -k restart }}} Test by web-browsing to '''!http://servername/svn/project''' If you see a simple web page which says '''Revision 1: /''' and lists ''branches'', ''tags'', and ''trunk'', your Subversion install is up and running! Now let's finish the Trac install (but don't go on to Trac install until you have the above working properly). I put my trac environment at /var/trac/project. Of course you could use any other path or name - something a little more descriptive of ''your'' project would probably be a good idea. First I ran these commands: {{{ sudo mkdir /var/trac sudo trac-admin /var/trac/project initenv sudo chown -R www-data /var/trac/project }}} The "trac-admin" command above prompted me to enter: * the project name (''project'') * the path to svn repository (''var/svn/project'') * the path to the Trac templates directory (''usr/share/trac/templates'') ... then it prints 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 the error '''!ImportError: No module named neo_cgi'''. 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 }}} ''Viola! Your Trac system & website should be up and running.'' ---- 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'''