this article describes the installation of a subversion repository server including trac project managment on a open suse 11.0 server. what is trac ? trac is an enhanced wiki and issue tracking system for software development projects. an
this article describes the installation of a subversion repository server including trac project managment 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. butif we want to use the trac project managment we must compile the wholething 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
opensslopenssl-develautconflibtoolflexbisonlibapr0gcc-c++gcc, makeglibc-develctagslzo, lzo-develgdbm, gdbm-devellibxml2-develsqlite, sqlite-develpython, python-devel, python-doc, python-setuptools, python-xml now we start:download, compile and install apache 2.2.9 $>cd /usr/local/src
$>wget http://gd.tuwien.ac.at/infosys/servers/http/apache/dist/httpd/httpd-2.2.9.tar.gz
...
$>tar xzvf httpd-2.2.9.tar.gz
$>cd httpd-2.2.9
$>./configure --prefix=/usr/local/apache2 --enable-mods-shared=all ssl dav_lock --enable-maintainer-mode --enable-dav --enable-dav-fs --enable-dav-lock --enable-cgi --enable-deflate --enable-auth-digest --enable-rewrite --enable-actions --enable-so --enable-ssl=/usr/ssl
...
$>make
$>make install
now we generate an ssl certificate for the webserver:$>cd /usr/local/apache2/conf
$>mkdir ssl.crt ssl.key
$>openssl req -new -x509 -days 3650 -keyout ./ssl.key/server.key -out ./ssl.crt/server.crt -subj '/cn=host.domain certificate'
...
$>cp ssl.key/server.key ssl.key/server.key.org
$>openssl rsa -in ssl.key/server.key.org -out ssl.key/server.key
...
$>chmod 400 ssl.key/server.key
$>chmod 400 ssl.key/server.key.org
download, compile and install mod_python-3.3.1 $>cd /usr/local/src
$>wget http://mirror.deri.at/apache/httpd/modpython/mod_python-3.3.1.tgz
...
$>tar xzvf mod_python-3.3.1.tar.gz
$>cd mod_python-3.3.1
$>./configure --with-apxs=/usr/local/apache2/bin/apxs
...
$>make
$>make install
download, compile and install ruby 1.8.7 $>cd /usr/local/src
$>wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
...
$>tar xzvf ruby-1.8.7.tar.gz
$>cd ruby-1.8.7
$>./configure
...
$>make
$>make install
download, compile and install swig 1.3.36 $>cd /usr/local/src
$>wget http://downloads.sourceforge.net/swig/swig-1.3.36.tar.gz?modtime=1214350580&big_mirror=0
...
$>tar xzvf swig-1.3.36.tar.gz
$>cd swig-1.3.36
$>./configure --with-python=/usr/bin/python --with-perl=/usr/bin/perl --with-ruby=/usr/local/bin/ruby --without-php4
...
$>make
$>make check
$>make install
download, compile and install neon 0.28.3 $>cd /usr/local/src
$>wget http://www.webdav.org/neon/neon-0.28.3.tar.gz
...
$>tar xzvf neon-0.28.3.tar.gz
$>cd neon-0.28.3
$>./configure --with-expat --with-libxml2 --with-ssl --with-libs=/usr/ssl --enable-shared=yes
...
$>make
$>make install
download, compile and install pysqlite 2.4.1 $>cd /usr/local/src
$>wget http://initd.org/pub/software/pysqlite/releases/2.4/2.4.1/pysqlite-2.4.1.tar.gz
...
$>tar xzvf pysqlite-2.4.1.tar.gz
$>cd pysqlite-2.4.1
$>python setup.py build
$>python setup.py install
download, compile and install subversion 1.5.2 $>cd /usr/local/src
$>wget http://subversion.tigris.org/downloads/subversion-1.5.2.tar.gz
...
$>tar xzvf subversion-1.5.2.tar.gz
$>cd subversion-1.5.2
$>rm -rf /usr/local/lib/libsvn*
$>rm -rf /usr/local/lib/svn-python/*
$>rm -rf /usr/local/lib/libexpat* /lib/libexpat* /usr/lib/libexpat*
$>sh ./autogen.sh
$>./configure --with-ssl=/usr/ssl --with-neon=/usr/local --with-apr=/usr/local/apache2 --with-apr-util=/usr/local/apache2 --with-apxs=/usr/local/apache2/bin/apxs --with-zlib=/usr/lib --with-swig=/usr/local/bin/swig python2=/usr/bin/python perl=/usr/bin/perl --without-jdk --without-jikes --without-junit
...
$>make
$>make install
$>make swig-py
$>make install-swig-py
$>make swig-pl
$>make install-swig-pl
$>echo /usr/local/lib/svn-python > /usr/lib/python/site-packages/svn-python.pth
download, compile and install clearsilver 0.10.5 $>cd /usr/local/src
$>wget http://www.clearsilver.net/downloads/clearsilver-0.10.5.tar.gz
...
$>tar xzvf clearsilver-0.10.5
$>cd clearsilver-0.10.5
$>vi scripts/document.py (change the first line to /usr/bin/python instead of /bin/env python)
...
$>./configure --with-apache=/usr/local/apache2 --with-python=/usr/bin/python --with-ruby=/usr/local/bin/ruby --with-perl=/usr/bin/perl --disable-csharp --disable-java --enable-gettext
...
$>make
$>make install
$>cd python
$>make install #(that should install the python bindings for clearsilver)
download, compile and install docutils 0.5 $>cd /usr/local/src
$>wget http://prdownloads.sourceforge.net/docutils/docutils-0.5.tar.gz?download
...
$>tar xzvf docutils-0.5.tgz
$>cd docutils-0.5
$>python setup.py build
$>python setup.py install
$>cd /tools
$>./buildhtml.py ../
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 thesite-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 createand 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
setenv trac_env /data/repos-new/myproject
------------------
(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 thebrowse 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:
------------------
dav svn
svnpath /data/repos-new/myproject
authtype basic
authname subversion repository
authuserfile /data/repos-new/svn-auth-file
require valid-user
------------------
(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: sslrandomseed startup builtin
sslrandomseed connect builtin
listen 443
addtype application/x-x509-ca-cert .crt
addtype application/x-pkcs7-crl .crl
sslpassphrasedialog builtin
sslsessioncache dbm:/usr/local/apache2/logs/ssl_scache
sslsessioncachetimeout 300
sslmutex file:/usr/local/apache2/logs/ssl_mutex
documentroot /usr/local/apache2/htdocs
servername server.domain:443
serveradmin email@domain.com
errorlog /usr/local/apache2/logs/error_log
transferlog /usr/local/apache2/logs/access_log
sslengine on
sslciphersuite all:!adh:!export56:rc4+rsa:+high:+medium:+low:+sslv2:+exp:+enull
sslcertificatefile /usr/local/apache2/conf/ssl.crt/server.crt
sslcertificatekeyfile /usr/local/apache2/conf/ssl.key/server.key
ssloptions +stdenvvars
ssloptions +stdenvvars
setenvif user-agent .*msie.* /
nokeepalive ssl-unclean-shutdown /
downgrade-1.0 force-response-1.0
customlog /usr/local/apache2/logs/ssl_request_log /
%t %h %{ssl_protocol}x %{ssl_cipher}x /%r/ %b
rewriteengine on
rewritecond %{request_method} ^(trace|track)
rewriterule .* - [f]
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
and start apache2 now.
