| 33 | '''More notes for Trac 0.8 on Debian Woody:''' |
| 34 | |
| 35 | Notice, this is what worked for me on a '''new''' Woody system I built just to host Trac (in a VMware image, yet!), so I was able to be a little free with modifications I made. Be more careful if you are adding Trac to a system you use for other tasks - don't blame me if these instructions break something! |
| 36 | |
| 37 | These instructions ignore the above and start at the very beginning. |
| 38 | |
| 39 | * Subversion really wants Apache2 installed. If you run {{{apache2 -v}}} and get an error, you'll need to install Apache2. |
| 40 | I removed apache 1.3 and installed Apache2 with the following: |
| 41 | {{{ |
| 42 | apt-get install apache2-common apache2-doc apache2-mpm-worker libapache2-svn |
| 43 | apt-get remove apache |
| 44 | apache2 -k start |
| 45 | }}} |
| 46 | * Trac 0.8 runs better with Python 2.2 and python-xml (without them, diffs and attachment uploading may not work): |
| 47 | {{{ |
| 48 | apt-get install python 2.2 python-xml |
| 49 | cd /usr/bin |
| 50 | mv python python.orig |
| 51 | ln -s python2.2 python |
| 52 | cp -R /usr/lib/python2.1/site-packages /usr/lib/python2.2 |
| 53 | apache2 -k restart |
| 54 | }}} |
| 55 | * After completing these pre-requisites, I added the following to /etc/apt/sources.list |
| 56 | {{{ |
| 57 | deb http://ftp.edgewall.com/pub/debian woody trac |
| 58 | deb http://people.debian.org/~adconrad woody subversion |
| 59 | }}} |
| 60 | and ran |
| 61 | {{{ |
| 62 | apt-get install trac |
| 63 | }}} |
| 64 | * Getting Subversion working: |
| 65 | |
| 66 | I decided to keep my Subversion project at /var/svn/project. Here are the commands I entered to get SVN up and running: |
| 67 | {{{ |
| 68 | mkdir /var/svn |
| 69 | mkdir /var/svn/project |
| 70 | mkdir /tmp/project |
| 71 | mkdir /tmp/project/branches |
| 72 | mkdir /tmp/project/tags |
| 73 | mkdir /tmp/project/trunk |
| 74 | svnadmin create /var/svn/project |
| 75 | rm -rf /tmp/project |
| 76 | svn import /tmp/project file:///var/svn/project -m "initial import" |
| 77 | }}} |
| 78 | I added the following to /etc/apache2/sites-available/default: |
| 79 | {{{ |
| 80 | #SVN dir |
| 81 | <Location /svn> |
| 82 | DAV svn |
| 83 | SVNParentPath /var/svn |
| 84 | </Location> |
| 85 | }}} |
| 86 | Then I fixed permissions and restarted apache2: |
| 87 | {{{ |
| 88 | chown /var/svn/nim www-data |
| 89 | chown -R /var/svn/nim/* www-data |
| 90 | apache2 -k restart |
| 91 | }}} |
| 92 | I was able to test by going to !http://servername.foo.com/svn/project where I could see the empty directories as imported. I did not move on to the next step until this worked right! |
| 93 | |
| 94 | * Getting Trac running: |
| 95 | |
| 96 | I put my trac environment at /var/trac/project. I'm not using the mod_python extentions at the moment. First I ran |
| 97 | {{{ |
| 98 | trac-admin /var/trac/project initenv (will prompt you for several things and print lots of output) |
| 99 | }}} |
| 100 | Then I edited /etc/apache2/sites-available/default. I commented out the existing {{{ScriptAlias}}} and {{{<Directory "/usr/lib/cgi-bin">}}} directives, and added this at the end: |
| 101 | {{{ |
| 102 | Alias /trac "/usr/share/trac/htdocs" |
| 103 | ScriptAlias /cgi-bin/ /usr/share/trac/cgi-bin/ |
| 104 | <Location "/cgi-bin/trac.cgi"> |
| 105 | SetEnv TRAC_ENV "/var/trac/project" |
| 106 | </Location> |
| 107 | |
| 108 | <Directory "/usr/share/trac/htdocs"> |
| 109 | Options Indexes MultiViews |
| 110 | AllowOverride None |
| 111 | Order allow,deny |
| 112 | Allow from all |
| 113 | </Directory> |
| 114 | |
| 115 | # You need something like this to authenticate users |
| 116 | <Location "/cgi-bin/trac.cgi/login"> |
| 117 | AuthType Basic |
| 118 | AuthName "project" |
| 119 | AuthUserFile /var/www/trac.htpasswd |
| 120 | Require valid-user |
| 121 | </Location> |
| 122 | }}} |
| 123 | Now to fix the permissions, add a couple of users, and restart Apache: |
| 124 | {{{ |
| 125 | cd /var/www |
| 126 | htpasswd -c trac.htpasswd user1 (you'll be prompted for the password) |
| 127 | htpasswd trac.htpasswd bar user2 (you'll be prompted for the password) |
| 128 | apache2 -k restart |
| 129 | }}} |
| 130 | Finally, test by going to !http://servername.foo.com/cgi-bin/trac.cgi |
| 131 | |
| 132 | On my installation, I do get some errors ("Python C API version mismatch for module ''blah''") when I run trac-admin at the commandline. This is probably because I didn't upgarde to Python2.2 until ''after'' I installed Trac. Hopefully these errors will be avoided by upgradng Python first, but in any case they don't seem to hurt Trac at all. Everything works perfectly! ''bryan@lockwoods.us'' |
| 133 | |
| 134 | |