installing trac

Installing the trac (http://trac.edgewall.org/) project to manage bugs and possibly even features/specifications for your projects. First install the trac dependencies

apt-get install python python-central python-setuptools 
python-pysqlite2 python-subversion libjs-jquery python-genshi 
python-tz python-pygments

use easy_install to install the latest version of trac (we had issues with the apt-get version and attachments)

easy_install -n http://svn.edgewall.org/repos/trac/tags/trac-0.11.4

create the directories that will contain our trac project files

mkdir /opt/trac 
mkdir -p /opt/trac/.trac-base/egg-cache 
cd /opt/trac

create the trac project

trac-admin trac-example initenv

create a password file and setup initial users

htpasswd /opt/htpasswd

make sure apache owns the trac directories

chown -R www-data:www-data /opt/trac

configure apache to handle trac as the root site

vim /opt/apache2/sites-enabled/trac

<VirtualHost *:80>
        Alias /trac/ /usr/share/trac/htdocs 
 
        ErrorLog /var/log/apache2/error.trac.log 
        CustomLog /var/log/apache2/access.trac.log combined 
 
         <Location "/">
                SetHandler mod_python 
                PythonInterpreter main_interpreter 
                PythonHandler trac.web.modpython_frontend 
                PythonOption TracEnvParentDir /opt/trac/ 
                PythonOption TracUriRoot / 
                PythonOption PYTHON_EGG_CACHE /opt/trac/.trac-base/egg-cache 
         </Location>

        # use the following for one authorization for all projects 
        # (names containing "-" are not detected): 
         <Location "/">
            AuthType Basic 
            AuthName "trac" 
            AuthUserFile /opt/htpasswd 
            Require valid-user 

        </Location>

</VirtualHost>

restart apache

/etc/init.d/apache2 restart

check the system with your browser by navigating to http://localhost/

 

Filed under  //

Comments [0]