Lets face it… Installing Trac is a headache not because it’s extremely complicated but because it’s a eyesore to configure. Since the Ubuntu Community Docs changes rapidly, it gets really annoying to follow just because the wiki tutorial you follow today may not be the same one you use from a month from now, despite the revision options. I guess that’s why my head exploded and it’s the reason I wrote this tutorial. I have a few friends who wanted SVN and Trac installed for their Robot Project they are working on. So I created a VM for Hardy and created a Trac for them. Things broke and went for a wrong turn but it worked….(mostly because of the snapshot feature of VMware product line)
If I can get VMware Server to work with my current Gentoo 2.6.26 Kernel or there’s a VirtualBox demand (which is currently working for me), I will throw it up here…but for now I’ll just leave instructions.
Let’s fetch Trac & Apache!
sudo apt-get install apache2 libapache2-mod-python libapache2-svn python-setuptools subversion python-subversion
sudo easy_install Trac |
sudo apt-get install apache2 libapache2-mod-python libapache2-svn python-setuptools subversion python-subversion
sudo easy_install Trac
Make some trac dirs and set the permissions for it..
sudo mkdir /var/lib/trac
sudo chown www-data:www-data /var/lib/trac |
sudo mkdir /var/lib/trac
sudo chown www-data:www-data /var/lib/trac
Let’s edit the apache2 files
Remember to edit the commented areas for LDAP
sudo nano /etc/apache2/sites-available/trac |
sudo nano /etc/apache2/sites-available/trac
<virtualhost *>
ServerAdmin webmaster@localhost
ServerName trac.example.com
DocumentRoot /var/www
ErrorLog /var/log/apache2/error.trac.log
CustomLog /var/log/apache2/access.trac.log combined
<location /projects>
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /var/lib/trac
PythonOption TracUriRoot /projects
PythonOption PYTHON_EGG_CACHE /tmp
</location>
# use the following for one authorization for all projects
<locationmatch "/projects/[^/]+/login">
AuthType Basic
AuthName "Authorization Required"
AuthBasicProvider ldap
AuthLDAPURL "ldap://localhost:389/ou=People,dc=test,dc=local?uid" #Change this for your LDAP
AuthLDAPGroupAttribute memberUid
AuthLDAPGroupAttributeIsDN off
AuthzLDAPAuthoritative on
Require ldap-group cn=admin,ou=Group,dc=test,dc=local #Change this again for your LDAP
</locationmatch>
</virtualhost> |
<virtualhost *>
ServerAdmin webmaster@localhost
ServerName trac.example.com
DocumentRoot /var/www
ErrorLog /var/log/apache2/error.trac.log
CustomLog /var/log/apache2/access.trac.log combined
<location /projects>
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /var/lib/trac
PythonOption TracUriRoot /projects
PythonOption PYTHON_EGG_CACHE /tmp
</location>
# use the following for one authorization for all projects
<locationmatch "/projects/[^/]+/login">
AuthType Basic
AuthName "Authorization Required"
AuthBasicProvider ldap
AuthLDAPURL "ldap://localhost:389/ou=People,dc=test,dc=local?uid" #Change this for your LDAP
AuthLDAPGroupAttribute memberUid
AuthLDAPGroupAttributeIsDN off
AuthzLDAPAuthoritative on
Require ldap-group cn=admin,ou=Group,dc=test,dc=local #Change this again for your LDAP
</locationmatch>
</virtualhost>
Lets enable the apache site
sudo a2dissite default
sudo a2ensite trac
sudo /etc/init.d/apache2 reload |
sudo a2dissite default
sudo a2ensite trac
sudo /etc/init.d/apache2 reload
We need a SVN Repository…. (Rename YourProjectNameHere to your liken in the svnadmin line)
sudo mkdir /var/lib/svn
sudo svnadmin create /var/lib/svn/(YourProjectNameHere) |
sudo mkdir /var/lib/svn
sudo svnadmin create /var/lib/svn/(YourProjectNameHere)
SVN Permissions
sudo chown -R www-data /var/lib/svn
sudo chown -R www-data /usr/share/trac
sudo /etc/init.d/apache2 reload |
sudo chown -R www-data /var/lib/svn
sudo chown -R www-data /usr/share/trac
sudo /etc/init.d/apache2 reload
Let setup Trac (Also again…change YourProjectNameHere to your liken)
Trac Admin will ask some questions so keep it consistent
(i.e. the project name: YourProjectNameHere, the path to SVN repository [/var/lib/svn/YourProjectNameHere])
sudo mkdir /var/lib/trac
sudo trac-admin /var/lib/trac/(YourProjectNameHere) initenv
sudo chown -R www-data /var/lib/trac |
sudo mkdir /var/lib/trac
sudo trac-admin /var/lib/trac/(YourProjectNameHere) initenv
sudo chown -R www-data /var/lib/trac
And your done…head to link below if there wasn’t any errors and login :)
http://localhost/projects
You might want to change up the ou=Group in the apache2 config to your specs of what group should able to use the trac…
The link I used for this tutorial (but my tutorial is modified):
If anyone wants a awesome tutorial on how to install and configure LDAP check out the link below. I might make even a tutorial based on it to make things simpler :).
As always, leave a comment if you need help with this project……
Cheers!
tgeorge
Shout out to Hannah and Pete :)