By Rupert
Posts tagged trac
Long Time No Trac
Nov 25th
Its been a while I haven’t setup an svn repository for SCM. Anyhow, here are the steps just in case I forget again and again…
1. Add a new trac setting in /etc/apache2/sites-available/default
2. Copy a template
cp -Rf /var/www/trac/trac-template /var/www/localdumplings
3. Restart Apache2
4. Resync the repository
trac-admin localdumpling resync
Trac slow on updating or creating tickets
Mar 9th
This has been a productivity hogger for us for quite a few weeks and we really had no clue at it first. What I noticed was after enabling logging on trac.ini:
[logging] log_file = trac.log log_level = CRITICAL log_type = file
was that every post was being sent to an SMTP server.
Installing Subversion on Debian
Jan 27th
I was greeted with “No space left on device” on my cron log. Turns out that my svn server obviously ran out of disk space. The old svn server was running on CentOS4.3, Subversion 1.3.2, Trac-0.11.devxxx. I decided to migrate the svn data to a new server, so I installed Debian4.01 on a small server with 72 GB HD, no partitions (just / and swap, so the svn have room to grow…). Here are the steps I took for the migration:
A. A fresh start…
1. Installed Debian. Fixed network and ssh.
2. apt-get install apache2
3. apt-get install subversion
4. apt-get install python python-setuptools python-mysqldb python-subversion
5. apt-get install libapache2-svn libapache2-mod-python
B. Making SVN work…
1. svnadmin create /repos –fs-type fsfs
2. Since I have a fresh apache configuration, I edited it accordingly from /etc/apache2/mods-available/dav_svn.conf:
#SVN dir <location> DAV svn SVNPath /repos SVNAutoversioning on AuthType Basic AuthName "SVN - Your Project" AuthUserFile /repos/svn-auth-file Require valid-user </location>
3. Restart apache
4. To test if svn is running, import a project inside the repository.
svn import -m "initial import" /tmp/project http://127.0.0.1/repos/project
C. Migrating the data
After I got my fresh debian svn machine, I need to move the svn data and trac to the new server. http://svnbook.red-bean.com/nightly/en/svn.reposadmin.html
1. Transfer /repos/svn-auth-file and /repos/svn-authorization-file to the new server
2. Transferred trac.tar.gz (/var/www/trac) to the new server
To move the svn data from one server to another, I tried the ff choices…
1. svnadmin dump /repos /reposbak. Will work if disk space is not an issue. My /repos is 25 GB, and my other 30 GB partition was wiped out, even though the dump was not finished yet.
2. svnadmin hotcopy --clean-logs /repos /repos2. Accdg to the docs, this is exactly the same repository without the BdB logs. I then transferred the hotcopy from choice 2 above to the new server and works flawlessly to my surprise. So now, I still have all my revisions
http://bealers.com/2008/01/01/installing-trac-on-debian-etch/
http://trac.edgewall.org/wiki/TracOnDebianSarge
http://trac.edgewall.org/wiki/TracUpgrade
http://trac.edgewall.org/wiki/TracInstall
http://trac.edgewall.org/wiki/TracModPython
Installing Trac on CentOS4
Jun 27th
There is a problem with clearsilver on CentOS systems. I get neo_cgi.so module not found. Don’t force yourself, it would simply not work (Trac0.10.4 on CentOS, not unless we try the DAG repositories).
So, I have to use Trac 0.11, setuptools and Genshi.
Prerequisites:
- Must have python 2.3+
- Must have mod_python-3.3.1.tgz
- Must have httpd2.0.x+ or httpd2.2.x
A. Core Trac Installation
1. Install setuptools-0.6c6-py2.3.egg. Download the setuptools according to your python distribution and simply run:
sh setuptools-0.6c4-py2.3.egg
2. Install Genshi. There are numerous ways of installing Genshi.
easy_install Genshi
or
#wget http://ftp.edgewall.com/pub/genshi/Genshi-0.4.2-py2.3.egg
#chmod +x Genshi-0.4.2-py2.3.egg
#easy_install Genshi-0.4.2-py2.3.egg
3. Install Trac 0.11. We need to install trac from svn
#svn co http://svn.edgewall.org/repos/trac/trunk trac
#python ./setup.py install
This would install trac-admin and tracd in /usr/bin.
Trac Post Intall
#mkdir -p /var/www/trac
#cd /var/www/trac
#trac-admin /var/www/trac/poimgr initenv
#chown -Rf nobody:root /var/www
#chmod -Rf 755 /var/www
Just accept the defaults for now, we can change it later on /var/www/trac/poimgr/conf/trac.ini.
C. Apache Configuration
LoadModule python_module /usr/local/apache2/modules/mod_python.so <location> SetHandler mod_python PythonHandler trac.web.modpython_frontend PythonOption TracEnv /var/www/trac/poimgr PythonOption TracUriRoot /trac/poimgr #Order deny,allow #Deny from all #Allow from 192.168.1.0/24 AuthType Basic AuthName "TRAC-POIMGR" AuthUserFile "/repos/svn-auth-file" require valid-user </location>
Notes:
http://www.yolinux.com/TUTORIALS/LinuxSubversionAndTracServer.html
Depending on your installation, you may encounter some problems. I had problems with expat errors:
ExpatError (null): line 1,column 0.
Turns out that it was confused between the link libraries of apache and that of python.
#ps aux | grep http | head -3 #sof -p 29982 | grep expat # strings libexpat.so.0.1.0 | grep expat_ expat_1.95.2 # strings /usr/lib/python2.3/lib-dynload/pyexpat.so | grep expat_ expat_1.95.7 Quickfix is to use symbolic links: #cd /usr/local/apache2/lib/ #cp -Rf /usr/lib/libexpat.so.0.5.0 /usr/local/apache2/lib/ #ln -s libexpat.so.0.5.0 libexpat.so #ln -s libexpat.so.0.5.0 libexpat.so.0 #su -l #/etc/init.d/httpd restart
Configuring Trac.
1. I have to move /etc/svn-auth-file to /repos-auth-file. Change the permissions so “nobody” could access it.
2. How to configure my users? Well, since its an intranet application and my trac-users and developers is both in the svn-auth-file, I need a way to configure users easily. Follow these steps from trac-hack.
easy_install http://trac-hacks.org/svn/accountmanagerplugin/trunk
Role base authorisation in trac
trac-admin /var/www/trac/poiclient permission remove anonymous \ TICKET_CREATE TICKET_MODIFY WIKI_CREATE WIKI_MODIFY for n in rupert andrew; do trac-admin /var/www/trac/{app_name} permission add $n TRAC_ADMIN done for n in rupert andrew; do trac-admin /var/www/trac/{app_name} permission add $n WIKI_DELETE done trac-admin /var/www/trac/poiclient permission add authenticated \ BROWSER_VIEW CHANGESET_VIEW FILE_VIEW LOG_VIEW MILESTONE_VIEW \ REPORT_SQL_VIEW REPORT_VIEW ROADMAP_VIEW SEARCH_VIEW \ TICKET_CREATE TICKET_MODIFY TICKET_VIEW TIMELINE_VIEW \ WIKI_CREATE WIKI_MODIFY WIKI_VIEW
3. Here’s my trac.ini. Things to look at is the notification and account-manager.
4. Deleting a Trac Ticket:
# sqlite3 trac.db
delete from ticket_custom where ticket = [ticketID];
delete from ticket_change where ticket = [ticketID];
delete from ticket where id = [ticketID];
Other References:
http://www.dscpl.com.au/wiki/ModPython/Articles/ExpatCausingApacheCrash
http://www.yolinux.com/TUTORIALS/LinuxSubversionAndTracServer.html
Trac and Multiple Subversion Repositories
Future Work:
http://insurrection.tigris.org/
Comments