Trac Installation on centOS -Hire Python Developers India

Looking to Hire Python Developers India?

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 Hire Python Developers India

[bash] #python setup.py install [/bash]

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

[bash]#python virtualenv.py ENV[/bash]
[bash]#virtualenv ENV[/bash]

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

[bash]#source ./ENV/bin/activate[/bash]

(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

[bash]#deactivate[/bash]

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

[bash]#easy_install Genshi[/bash]

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

[bash]#easy_install Babel==0.9.5
#easy_install Trac
#easy_install -U Trac
#easy_install -U Trac==dev[/bash]

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)

[bash]#mkdir /var/www/trac[/bash]

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

[bash]#chown -R apache.apache /var/www/trac[/bash]

2.Create an environment

[bash]#trac-admin /var/www/myproject initenv[/bash]

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

[bash]#tracd –port 8000 /var/www/trac/myproject[/bash]

(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

[bash]#trac-admin /var/www/myproject permission add admin TRAC_ADMIN[/bash]

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

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

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 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *