| 1 | 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. |
| 2 | |
| 3 | 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: |
| 4 | {{{ |
| 5 | sudo apt-get update |
| 6 | sudo apt-get upgrade |
| 7 | }}} |
| 8 | |
| 9 | You can take a nice long break while Hoary is downloaded and installed. |
| 10 | |
| 11 | 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. |
| 12 | |
| 13 | We need to install a few more things: |
| 14 | |
| 15 | {{{ |
| 16 | sudo apt-get install openssh-server |
| 17 | sudo apt-get install trac |
| 18 | sudo apt-get install libapache2-svn |
| 19 | }}} |
| 20 | |
| 21 | 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): |
| 22 | {{{ |
| 23 | NameVirtualHost * |
| 24 | <VirtualHost *> |
| 25 | ServerAdmin webmaster@localhost |
| 26 | |
| 27 | DocumentRoot /var/www/ |
| 28 | <Directory /> |
| 29 | Options FollowSymLinks |
| 30 | AllowOverride None |
| 31 | </Directory> |
| 32 | <Directory /var/www/> |
| 33 | Options Indexes FollowSymLinks MultiViews |
| 34 | AllowOverride None |
| 35 | Order allow,deny |
| 36 | allow from all |
| 37 | # This directive allows us to have apache2's default start page |
| 38 | # in /apache2-default/, but still have / go to the right place |
| 39 | # Commented out for Ubuntu |
| 40 | #RedirectMatch ^/$ /apache2-default/ |
| 41 | </Directory> |
| 42 | |
| 43 | ## ---THESE LINES FROM ORIGINAL FILE WERE COMMENTED OUT--- |
| 44 | # ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ |
| 45 | # <Directory "/usr/lib/cgi-bin"> |
| 46 | # AllowOverride None |
| 47 | # Options ExecCGI -MultiViews +SymLinksIfOwnerMatch |
| 48 | # Order allow,deny |
| 49 | # Allow from all |
| 50 | # </Directory> |
| 51 | ## ---END OF COMMENTS--- |
| 52 | |
| 53 | ErrorLog /var/log/apache2/error.log |
| 54 | |
| 55 | # Possible values include: debug, info, notice, warn, error, crit, |
| 56 | # alert, emerg. |
| 57 | LogLevel warn |
| 58 | |
| 59 | CustomLog /var/log/apache2/access.log combined |
| 60 | ServerSignature On |
| 61 | |
| 62 | Alias /doc/ "/usr/share/doc/" |
| 63 | <Directory "/usr/share/doc/"> |
| 64 | Options Indexes MultiViews FollowSymLinks |
| 65 | AllowOverride None |
| 66 | Order deny,allow |
| 67 | Deny from all |
| 68 | Allow from 127.0.0.0/255.0.0.0 ::1/128 |
| 69 | </Directory> |
| 70 | |
| 71 | ## ---THESE LINES WERE ADDED TO THE ORIGINAL FILE--- |
| 72 | Alias /trac "/usr/share/trac/htdocs" |
| 73 | ScriptAlias /cgi-bin/ /usr/share/trac/cgi-bin/ |
| 74 | <Location "/cgi-bin/trac.cgi"> |
| 75 | SetEnv TRAC_ENV "/var/trac/project" |
| 76 | </Location> |
| 77 | |
| 78 | <Directory "/usr/share/trac/htdocs"> |
| 79 | Options Indexes MultiViews |
| 80 | AllowOverride None |
| 81 | Order allow,deny |
| 82 | Allow from all |
| 83 | </Directory> |
| 84 | |
| 85 | # You need something like this to authenticate users |
| 86 | <Location "/cgi-bin/trac.cgi/login"> |
| 87 | AuthType Basic |
| 88 | AuthName "NIM" |
| 89 | AuthUserFile /var/www/trac.htpasswd |
| 90 | Require valid-user |
| 91 | </Location> |
| 92 | |
| 93 | #SVN dir |
| 94 | <Location /svn> |
| 95 | DAV svn |
| 96 | SVNParentPath /var/svn |
| 97 | </Location> |
| 98 | ## ---END OF ADDITIONS--- |
| 99 | |
| 100 | </VirtualHost> |
| 101 | |
| 102 | }}} |
| 103 | |
| 104 | We need to enable the apache2 DAV mod with the following command: |
| 105 | |
| 106 | {{{ |
| 107 | sudo ln -s /etc/apache2/mods-available/dav.load /etc/apache2/mods-enabled/dav.load |
| 108 | }}} |
| 109 | |
| 110 | I installed my Subversion repository at '''/var/svn/project'''. So I did a quick starting config of subversion with the following commands: |
| 111 | {{{ |
| 112 | mkdir /var/svn |
| 113 | mkdir /var/svn/project |
| 114 | mkdir /tmp/project |
| 115 | mkdir /tmp/project/branches |
| 116 | mkdir /tmp/project/tags |
| 117 | mkdir /tmp/project/trunk |
| 118 | svnadmin create /var/svn/project |
| 119 | svn import /tmp/project file:///var/svn/project -m "initial import" |
| 120 | rm -rf /tmp/project |
| 121 | }}} |
| 122 | |
| 123 | Some permissions changes and an apache restart are now needed: |
| 124 | {{{ |
| 125 | sudo chown -R www-data /var/trac/project |
| 126 | sudo chown -R www-data /var/svn/project |
| 127 | sudo chown -R www-data /usr/share/trac |
| 128 | sudo apache2 -k restart |
| 129 | }}} |
| 130 | |
| 131 | Test by going to !http://servername/svn/project |
| 132 | |
| 133 | If this works, your Subversion install is up and running! Now let's finish the Trac install. |
| 134 | |
| 135 | I put my trac environment at /var/trac/project. I'm not using the mod_python extentions at the moment. First I ran |
| 136 | {{{ |
| 137 | mkdir /var/trac |
| 138 | trac-admin /var/trac/project initenv |
| 139 | }}} |
| 140 | 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''' |
| 141 | |
| 142 | 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: |
| 143 | |
| 144 | {{{ |
| 145 | sudo ln -s /usr/lib/python2.3/site-packages/neo_cgi.so /usr/lib/python2.4/site-packages/neo_cgi.so |
| 146 | }}} |
| 147 | |
| 148 | OPTIONAL: create a redirect file called /var/www.index.html with this one line: |
| 149 | {{{ |
| 150 | <META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://10.0.0.102/cgi-bin/trac.cgi"> |
| 151 | }}} |
| 152 | |
| 153 | ... with this change, you can get to Trac with '''!http://servername''' instead of the more cumbersome '''!http://servername/cgi-bin/trac.cgi''' |
| 154 | |
| 155 | == sources.list == |
| 156 | {{{ |
| 157 | ## Main & restricted |
| 158 | deb http://archive.ubuntu.com/ubuntu hoary main restricted |
| 159 | deb-src http://archive.ubuntu.com/ubuntu hoary main restricted |
| 160 | |
| 161 | ## Universe |
| 162 | deb http://archive.ubuntu.com/ubuntu hoary universe |
| 163 | deb-src http://archive.ubuntu.com/ubuntu hoary universe |
| 164 | |
| 165 | ## Security |
| 166 | deb http://security.ubuntu.com/ubuntu hoary-security main restricted |
| 167 | deb-src http://security.ubuntu.com/ubuntu hoary-security main restricted |
| 168 | }}} |