A.Dependencies
1.Basic
1.1.Python 2.5 or higher
1.2.Setup tools
1.3.Genshi
1.4.sqlite database
Note:-
1.1.Python2.4 is already installed with centOS.It does not support full swing operation of Trac.So install “virtualenv” python tool.Get the tar ball from  http://pypi.python.org/pypi/virtualenv.Just untar it,get into the directory and do

 #python setup.py install 

Now it’ll be installed(Python2.7 will be automatically installed with it)!Then create an environment by

#python virtualenv.py ENV
#virtualenv ENV

Done!!!

Note:-Now new binaries will be available under ‘/root/ENV/bin‘. We’re going to use commands from this directory for further.

Activate the new virtual environment by

#source ./ENV/bin/activate

(Here ENV is the virtual environment)

From now onwards,it’ll take commands from virtual environment itself if available! Otherwise it will go for default system binaries! If you want to return to the real environment, trigger

#deactivate

1.2.Setup tools
This will be installed automatically along the installation of ‘virtualenv’.
1.3.Install Genshi by

#easy_install Genshi

1.4.Sqlite can be installed using ‘yum’.Install ‘devel’ for sqlite also!

2.mod_wsgi module for apache
For compiling mod_wsgi with apache,simply follow the instructions given in: http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide

B.Installing Trac

#easy_install Babel==0.9.5
#easy_install Trac
#easy_install -U Trac
#easy_install -U Trac==dev

C.Creating a project environment

1.Before you proceed,create a directory for keeping trac project files under a directory accessible to apache.(Here default path is used)

#mkdir /var/www/trac

Now make sure apache user can access all the directories and files under ‘trac’

#chown -R apache.apache /var/www/trac

2.Create an environment

#trac-admin /var/www/myproject initenv

Enter the name of project and database when you are prompted for. Leave database name as default if you wish to use the default database!

D.Deploying Trac

#tracd --port 8000 /var/www/trac/myproject

(include ‘-s’ for single instance)

Now open browser and go to : http://localhost:8000 . Trac web-based interface will be appeared!

E.Granting admin rights to admin user

#trac-admin /var/www/myproject permission add admin TRAC_ADMIN

Warning:- If you failed to activate virtual environment as described under section A-1.1, you will need to specify path for all the commands (For eg:/root/ENV/bin easy_install) and you may encounter an error ”  File “/usr/lib/python2.4/site-packages/_xmlplus/parsers/expat.py”, line 4, in <module> from pyexpat import * ImportError: /usr/lib/python2.4/site-packages/_xmlplus/parsers/pyexpat.so: undefined symbol: PyUnicodeUCS4_Decode”. “.

For resolving this,trigger

#export  PYTHONPATH=/path/to/lib/python2.7/site-packages/

on each shell or edit files like /etc/profile or /etc/bashrc etc to take a permanent effect. But,this is not recommended and you should activate the virtual environment instead (see A-1.1) to avoid this scenario!!  Happy doing :)

VN:F [1.9.6_1107]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.6_1107]
Rating: +2 (from 2 votes)
Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Live
  • StumbleUpon
  • Twitter
  • Yahoo! Buzz
  • Reddit
  • Technorati