• How to install the Trac wiki ,Subversion and issue tracking system

    One of the wonderful wiki system i have ever seen is the Trac open source project ,you may have some problems during the installation process ,So i have written this document to facilitate the installation process as i can .
    This article is for Centos 5 – x86_64 :

    1. Add epel repository :
      rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
    2. Install Mandatory Dependencies:
      yum -y  install mysql mysql-server python setuptool babel docutils pytz  httpd mod_wsgi mod_python subversion mod_dav_svn mod_python mysql-python neon neon-devel python-devel swig MySQL-python
    3. Install Trac:
      wget http://peak.telecommunity.com/dist/ez_setup.pypython  && ez_setup.py && easy_install Trac==0.12
    4. Create Trac & subversion directories :
      mkdir -p /var/www/trac/project1 && mkdir -p /var/www/svn/svnrepos && mkdir -p /var/www/svn/auth && mkdir -p /var/www/svn/svnrepos/project1 && mkdir -p /var/www/trac/project1
    5. SVN configuration:
      svnadmin create --fs-type fsfs /var/www/svn/svnrepos/project1

      svn mkdir -m  file:///var/www/svn/svnrepos/project1/branches file:///var/www/svn/svnrepos/project1/tags file:///var/www/svn/svnrepos/project1/trunkc
      chown -R apache:apache /var/www/svn/svnrepos/project1/

      htpasswd -cb /var/www/svn/auth/svn.htpasswd raafat Password
      vi /etc/httpd/conf.d/subversion.conf

      Add the following lines:

      LoadModule dav_svn_module     modules/mod_dav_svn.so
      LoadModule authz_svn_module   modules/mod_authz_svn.so
      <Location /svn>
       DAV svn
       SVNParentPath /var/www/svn/svnrepos/
       AuthType Basic
       AuthName "project1 Authintication "
       AuthUserFile /var/www/svn/auth/svn.htpasswd
       Require valid-user
       </Location>
      chown -R apache.apache /var/www/svn/svnrepos/project1
      /etc/init.d/httpd restart

      Now ,You can access SVN via http://server_ip/svn

    6. Trac configuration:
      
       trac-admin /var/www/trac/project1 initenv

      Follow the steps after ruining the previous command.

      chown -R apache.apache /var/www/trac/project1
      htpasswd -cb /var/www/trac/.htpasswd raafat Password

      Add the following lines to /etc/httpd/conf.d/trac.conf

      <Location />
       SetHandler mod_python
       PythonHandler trac.web.modpython_frontend
       # "/var/www/svn/foobar" is the folder you gave to trac-admin initenv earlier
       PythonOption TracEnv /var/www/trac/project1
       # "/trac" is the same as the Location above
       PythonOption TracUriRoot /
       # "/tmp" should be some writable temporary directory
       SetEnv PYTHON_EGG_CACHE /tmp
       # "trac" can be any string, but must be the same for all
       # Trac instances on the same Apache install
       PythonInterpreter trac
       #PythonInterpreter main_interpreter
       </Location>
       <Location />
       AuthType Basic
       AuthName "Trac Authintication"
       AuthUserFile /var/www/trac/.htpasswd
       Require valid-user
       </Location>
    7. To show subversion in Trac system :Add the following line to trac.ini config file located in <projectenv>/conf/trac.ini
      [components]
       tracopt.versioncontrol.svn.* = enabled

      Restart Apache:

      /etc/init.d/httpd restart

    8. Now you have successfully installed Track with subversion.

    Bugs:

    You may got the following error as me 🙂 ,while restarting apache :

    Problem : ImportError: No module named trac
    Solution:cd /usr/lib/python2.4/site-packages;unzip Trac-0.12-py2.4.egg
    Note:change .egg file as you have on your system.

    I will show you how to authenticate from LDAP server and Active directory ASAP.

    Categories: Others

    Comments are currently closed.