---

Apache 2.2.15 / SSL, Subversion 1.6.9, Trac 0.11.6 on openSuSE 11.x

This article describes the installation of a Subversion Repository Server including Trac Project Managment on openSuSE 11.x 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.x Server, runlevel3.
* No graphical system is required because it is only a REPOSITORY server and nothing more.

Systemrequirements:

Install these packages with openSuSE "YaST"

  • autoconf
  • bison
  • ctags
  • flex
  • gcc, gcc-c++
  • glibc, glibc-devel
  • libtool
  • liblzo2, lzo-devel
  • libxml2, libxml2-devel
  • libopenssl-devel
  • openssl
  • make
  • gdbm, gdbm-devel
  • hdf5, hdf5-devel
  • sqlite3, sqlite3-devel, libsqlite3
  • python, python-devel, python-doc, python-setuptools, python-XML, python-zypp, python-sqlite2

  We start now:

Download, compile and install Apr 1.3.12

$>cd /usr/local/src
# download the lastest "Apr" version.
$>wget http://gd.tuwien.ac.at/infosys/servers/http/apache/dist/apr/apr-1.3.12.tar.gz
...
$>tar xzvf apr-1.3.12.tar.gz
$>cd apr-1.3.12
...
$>./configure --prefix=/usr
$>make
$>make test
$>make install

Download, compile and install Apr-Util 1.3.9

$>cd /usr/local/src
# download the lastest "Apr-util" version.
$>wget http://gd.tuwien.ac.at/infosys/servers/http/apache/dist/apr/apr-util-1.3.9.tar.gz
...
$>tar xzvf apr-util-1.3.9.tar.gz
$>cd apr-util-1.3.9
...
$>./configure --prefix=/usr --with-apr=/usr
$>make
$>make test
$>make install

Download, compile and install Apache 2.2.15

$>cd /usr/local/src
# download the lastest "Apache2" version.
$>wget http://gd.tuwien.ac.at/infosys/servers/http/apache/dist/httpd/httpd-2.2.15.tar.gz
...
$>tar xzvf httpd-2.2.15.tar.gz
$>cd httpd-2.2.15
...
$>./configure --prefix=/usr/local/apache2 --with-apr=/usr --with-apr-util=/usr --with-ssl=/etc/ssl
--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/include/ssl --with-mpm=worker
$>make
$>make install

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
# download the lastest "mod_python" version.
$>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
...
$>vi /usr/local/src/mod_python-3.3.1/src/connobject.c
$>replace in line 142 (and save)
$>!(b == APR_BRIGADE_SENTINEL(b) ||
$>with
$>!(b == APR_BRIGADE_SENTINEL(bb) ||
...
$>./configure --with-apxs=/usr/local/apache2/bin/apxs --with-flex=/usr/bin/flex
--with-python=/usr/bin/python --enable-modules=most --enable-mods-shared=most
...
$>make
$>make install

Download, compile and install Ruby 1.8.7-p248

$>cd /usr/local/src
# download the lastest "Ruby" version.
$>wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p248.tar.gz
...
$>tar xzvf ruby-1.8.7-p248.tar.gz
$>cd ruby-1.8.7-p248
$>./configure --prefix=/usr
...
$>make
$>make install

Download, compile and install Swig 1.3.40

$>cd /usr/local/src
# download the lastest "Swig" version.
$>wget http://switch.dl.sourceforge.net/sourceforge/swig/swig-1.3.40.tar.gz
...
$>tar xzvf swig-1.3.40.tar.gz
$>cd swig-1.3.40
$>./configure --prefix=/usr --with-python=/usr/bin/python --with-perl5=/usr/bin/perl
--with-ruby=/usr/bin/ruby --with-php=/usr/bin/php --with-ocaml=/usr/bin/ocaml
--without-php4 --without-guile --disable-ccache
...
$>make
$>make install

Download, compile and install Neon 0.29.3

$>cd /usr/local/src
# download the lastest "Neon" version.
$>wget http://www.webdav.org/neon/neon-0.29.3.tar.gz
...
$>tar xzvf neon-0.29.3.tar.gz
$>cd neon-0.29.3
$>./configure --prefix=/usr --with-expat --with-libxml2 --with-ssl=openssl --enable-shared=yes
...
$>make
$>make install

Download, compile and install Pysqlite 2.5.6

$>cd /usr/local/src
# If you're using Python 2.5 or 2.6, you already have everything you need!!
# If you're using Python 2.3 or 2.4 and need pysqlite.
# download the lastest "Pysqlite" version.
$>wget http://oss.itsystementwicklung.de/download/pysqlite/2.5/2.5.6/pysqlite-2.5.6.tar.gz
...
$>tar xzvf pysqlite-2.5.6.tar.gz
$>cd pysqlite-2.5.6
$>python setup.py build
$>python setup.py install

Download, compile and install Subversion 1.6.9

$>cd /usr/local/src
# download the lastest "Subversion" version.
$>wget http://subversion.tigris.org/downloads/subversion-1.6.9.tar.gz
...
$>tar xzvf subversion-1.6.9.tar.gz
$>cd subversion-1.6.9
...
# If you have any Subversion libraries around from previous 'make installs', clean them up first!
# rm -f /usr/local/lib/libsvn*
# rm -f /usr/local/lib/libapr*
# rm -f /usr/local/lib/libexpat*
# rm -r /usr/local/lib/svn-python/*
...
$>sh ./autogen.sh
$>./configure --with-ssl --with-neon=/usr --with-swig=/usr/bin/swig --with-apr=/usr
--with-apr-util=/usr --with-apxs=/usr/local/apache2/bin/apxs --with-zlib=/usr/lib
PYTHON2=/usr/bin/python PERL=/usr/bin/perl --enable-maintainer-mode
...
$>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
# download the lastest "Clearsilver" version.
$>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 first line to "/usr/bin/env python" if needed)
...
$>./configure --with-apache=/usr/local/apache2 --with-python=/usr/bin/python
--with-ruby=/usr/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 Genshi 0.5.1

$>cd /usr/local/src
# download the lastest "Genshi" version.
$>wget http://ftp.edgewall.com/pub/genshi/Genshi-0.5.1.tar.gz
...
$>tar xzvf Genshi-0.5.1.tar.gz
$>cd Genshi-0.5.1
$>python setup.py build
$>python setup.py install

Download, compile and install Docutils snapshot (snapshot version of Docutils (0.6) is compatible with Python 3)

$>cd /usr/local/src
# download the lastest "Docutils" version.
$>wget http://docutils.sourceforge.net/docutils-snapshot.tgz
...
$>tar xzvf docutils-snapshot.tgz
$>cd docutils
$>python setup.py build
$>python setup.py install
$>cd /tools
$>./buildhtml.py ../

Download, compile and install Trac 0.11.6

$>cd /usr/local/src
# download the lastest "Trac" version.
$>wget http://ftp.edgewall.com/pub/trac/Trac-0.11.6.tar.gz
...
$>tar xzvf Trac-0.11.6.tar.gz
$>cd Trac-0.11.6.tar.gz
$>python ./setup.py install
...
$>cd /usr/local/apache2/htdocs
$>rm trac
$>ln -s /usr/local/lib/python2.6/site-packages/Trac-0.11.6-py2.6.egg/trac/htdocs/ trac
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
$>if you get the follwoing message "Syntax error on line xxx of /usr/local/apache2/conf/httpd.conf:
Cannot load /usr/local/apache2/modules/mod_dav_svn.so into server: libsvn_repos-1.so.0:
cannot open shared object file: No such file or directory
$> do a "ldconfig" to load the libs.
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:

SSLRandomSeed startup builtin
SSLRandomSeed connect builtin

<IfDefine SSL>
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

<VirtualHost _default_:443>
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

<FilesMatch "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/usr/local/apache2/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
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]
</VirtualHost>

</IfDefine>

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

Start Apache2 now and have fun :)

http://www.fedorawiki.de/index.php/SSH_Authentifizierung_sicher_verwenden.

<<<------------>>> that`s it <<<------------>>>