This article describes the installation of a subversion Repository server including TracProjectManagment on a openSUSE 11.0 Server.
What is Trac?
Trac is an enhanced wiki and issue tracking system for software development projects.
An integrated system for managing software projects.
An enhanced wiki.
A flexible web-based issue tracker.
An interface to the Subversion revision control system.
Have a look at their homepage:Trac Project Managment.
Normally any linux distribution comes with precompiled packages. But
if we want to use the Trac Project Managment we must compile the whole
thing ourself.
System Description:
Standard openSUSE 11.0 Server, runlevel3.
No graphical system is required because it is a Repository server and nothing more ;-)
<!-- ------------------------------------------------------------------------- //--> Systemrequirements:
Install the follwing packages via openSUSE "YaST"
<!-- ------------------------------------------------------------------------- //--> Download, compile and install Trac 0.11.1
$>cd /usr/local/src
$>wget http://ftp.edgewall.com/pub/trac/Trac-0.11.1.tar.gz
...
$>tar xzvf Trac-0.11.1.tar.gz
$>cd Trac-0.11.1.tar.gz
$>python ./setup.py install
...
$>cd /usr/local/apache2/htdocs
$>ln -s /usr/local/share/trac/htdocs trac (we link the trac stuff to apache2 htdocs)
<!-- ------------------------------------------------------------------------- //-->
This will byte-compile the python source code and install it in the
site-packages directory of your python installation. The directories cgi-bin, templates, htdocs, wiki-default are all copied to $prefix/share/trac.
The script will also install the trac-admin command-line tool, used to create
and maintain project environments. "trac-admin" is the command center of Trac.
<!-- ------------------------------------------------------------------------- //--> Create "user" and "group" for Subversion:
$>groupadd svn-grp
$>useradd svn -G svn-grp -s /bin/bash
$>passwd svn (some password for user svn)
<!-- ------------------------------------------------------------------------- //--> Now we create a Subversion Repository:
$>mkdir /data
$>mkdir /data/repos-new
$>chown -R svn.svn-grp /data/*
...
$>now login as user "svn" !!! (you are now user svn) !!!
$>svnadmin create /data/repos-new/MyProject --fs-type fsfs
$>svn mkdir file:///data/repos-new/MyProject/trunk -m "trunk"
...
$>su root (type password for root, you are now user root) !!!
<!-- ------------------------------------------------------------------------- //--> Create a Trac Enviorment from the Repository:
$>trac-admin /data/repos-new/MyProjectTrac initenv
change: Project Name [My Project]> to MyProject,
change: Path to Repository [/var/svn/test] to /data/repos-new/MyProject
$>chgrp -R svn-grp /data/repos-new/
$>chmod -R 770 /data/repos-new/
<!-- ------------------------------------------------------------------------- //--> Now enable the Project Enviorment and start Apache2:
Change and add the following lines to your configuration:
$>vi /usr/local/apache2/conf/httpd.conf
(change the Apache user to "svn")
(change the Apache group to "svn-grp")
...
add the following lines to point to your project:
------------------
SetEnv PYTHON_EGG_CACHE /home/svn
ScriptAlias /trac /usr/share/trac/cgi-bin/trac.cgi
<Location "/trac">
SetEnv TRAC_ENV "/data/repos-new/MyProject"
</Location>
------------------
(save the configuration and start Apache2 like)
$>/usr/local/apache2/bin/apachectl start
Open your webbrowser and type "http://yourip-or-domain/trac".
If everything is perfect you can see the welcome message. Also have a look at the "Browse Source" button, there you can see the added subversion "trunk" directory.
<!-- ------------------------------------------------------------------------- //--> Authentication for user login:
Change and add the following lines to your configuration:
$>cd /data/repos-new
$>touch svn-auth-file
$>chown svn.svn-grp svn-auth-file
$>chmod 440 svn-auth-file
...
add all user who should have access to the Repository via:
$>htpasswd2 -cb /data/repos-new/svn-auth-file user password
and change the Location settings in httpd.conf:
------------------
<Location /trac>
DAV svn
SVNPath /data/repos-new/MyProject
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /data/repos-new/svn-auth-file
Require valid-user
</Location>
------------------
(save the configuration and restart Apache2)
$>/usr/local/apache2/bin/apachectl stop
$>/usr/local/apache2/bin/apachectl startssl
Don`t forget to change "ssl.conf" and "httpd.conf" if you use ssl! sample ssl.conf:
<!-- ------------------------------------------------------------------------- //--> If you get fault messages from Apache2?
* If you get the following: Cannot load /usr/local/apache2/modules/mod_dav_svn.so into server...
Add to /usr/local/apache2/httpd.conf "LoadModule" lines:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
. And add "/usr/local/lib" to /etc/ld.so.conf and then run /etc/ldconfig.
...
* If you get the following:
ExtractionError: Can't extract file(s) to egg cache\n\nThe following error
occurred while trying to extract file(s) to the Python egg\ncache:\n\n
[Errno 13] Permission denied: '/root/.python-eggs'\n\nThe Python egg cache
directory is currently set to:\n\n /root/.python-eggs\n\nPerhaps your
account does not have write access to this directory?
You can\nchange the cache directory by setting the PYTHON_EGG_CACHE environment\nvariable
to point to an accessible directory.\n.
Add following line to /usr/local/apache2/bin/envvars:
export PYTHON_EGG_CACHE=/home/svn