Edgewall Software

Version 28 (modified by JoshuaFranklin, 18 years ago) ( diff )

Installing Trac on Red Hat Linux

Succesful installs were reported on the these flavours of Red Hat:


Packages Needed & Preparation

The following are the packages needed to install Trac 0.9.3 successfully:

  • clearsilver-0.9.3.tar.gz
  • httpd-2.0.52.tar.bz2
  • pysqlite-1.0.1.tar.gz
  • Python-2.3.5.tar.bz2
  • SilverCity-0.9.5.tar.gz
  • sqlite-2.8.16.tar.gz
  • subversion-1.3.0.tar.gz
  • swig-1.3.21.tar.gz
  • trac-0.9.3.tar.gz

You need Python-2.3.5 because the version in Red Hat Linux 9 is Python-2.2.2-26 After obtaining the packages, put all the packages in /usr/local/RH9 directory (You need to create RH9 directory yourself)

You must add the following line to the "/etc/ld.so.conf" file:

/usr/local/lib

Installation

Install Python

$ cd /usr/local/RH9
$ tar xjf Python-2.3.5.tar.bz2
$ cd Python-2.3.5
$ ./configure
$ make
$ make install
$ /sbin/ldconfig

Install Apache

$ cd /usr/local/RH9
$ tar xjf httpd-2.0.52.tar.bz2
$ cd httpd-2.0.52
$ ./configure
$ make
$ make install
$ /sbin/ldconfig

Install SWIG

$ cd /usr/local/RH9
$ tar xzf swig-1.3.21.tar.gz
$ cd SWIG-1.3.21
$ ./configure --with-python=/usr/local/bin/python
$ make
$ make install
$ make -k runtime
$ make install-runtime
$ /sbin/ldconfig

Install Subversion

$ cd /usr/local/RH9
$ tar xzf subversion-1.3.0.tar.gz
$ cd subversion-1.3.0;./configure --disable-mod-activation --enable-swig-bindings=python \
    --with-apr=/usr/local/apache2/bin/apr-config --with-apr-util=/usr/local/apache2/bin/apu-config \
    --with-apxs=/usr/local/apache2/bin/apxs --without-berkeley-db --with-zlib --with-swig=/usr/local
(Edit the Makefile to point PYTHON and -I/usr/include/python2.2 path to your installed Python, typically /usr/local/bin)
$ make
$ make install
$ make swig-py
$ make install-swig-py
$ /sbin/ldconfig

Install Sqlite

$ cd /usr/local/RH9
$ tar xzf sqlite-2.8.16.tar.gz
$ cd sqlite-2.8.16
$ ./configure
$ make
$ make install
$ /sbin/ldconfig

Install SilverCity

$ cd /usr/local/RH9
$ tar xzf SilverCity-0.9.5.tar.gz
$ cd SilverCity-0.9.5
$ python setup.py build
$ python setup.py install
$ /sbin/ldconfig

Install ClearSilver

$ cd /usr/local/RH9
$ tar xzf clearsilver-0.9.3.tar.gz
$ cd clearsilver-0.9.3
$ ./configure  --with-python=/usr/local/bin/python --with-apache=/usr/local/apache2
$ make
$ make install
$ cd python
$ python setup.py install
$ /sbin/ldconfig

Install PySqlite

$ cd /usr/local/RH9
$ tar xzf pysqlite-1.0.1.tar.gz
$ cd pysqlite
$ python setup.py build
$ python setup.py install
$ /sbin/ldconfig

Install Trac

$ cd /usr/local/RH9
$ tar xzf trac-0.9.3.tar.gz
$ cd trac-0.9.3
$ python setup.py build
$ python setup.py install
$ /sbin/ldconfig

Finalize Installation

Fix libsvn paths

This will create symbolic a link for then libsvn library to the Python 2.3 library

$ cd /usr/local/lib/python2.3/site-packages
$ ln -s /usr/local/lib/svn-python svn-python
$ ln -s /usr/local/lib/svn-python/svn svn
$ ln -s /usr/local/lib/svn-python/libsvn libsvn
$ /sbin/ldconfig

Create the Subversion repository

$ svnadmin create --fs-type=fsfs /var/svn

Create the Trac environment

You will see the following message below and follow what my options showed:

$ trac-admin /var/trac initenv
/usr/local/lib/python2.3/site-packages/libsvn/core.py:5: RuntimeWarning: Python C API version mismatch for module _core: This Python has API version 1012, module _core has version 1011.
  import _core
/usr/local/lib/python2.3/site-packages/libsvn/fs.py:5: RuntimeWarning: Python C API version mismatch for module _fs: This Python has API version 1012, module _fs has version 1011.
  import _fs
/usr/local/lib/python2.3/site-packages/libsvn/delta.py:5: RuntimeWarning: Python C API version mismatch for module _delta: This Python has API version 1012, module _delta has version 1011.
  import _delta
/usr/local/lib/python2.3/site-packages/libsvn/repos.py:5: RuntimeWarning: Python C API version mismatch for module _repos: This Python has API version 1012, module _repos has version 1011.
  import _repos
Creating a new Trac environment at /var/trac

Trac will first ask a few questions about your environment
in order to initalize and prepare the project database.

 Please enter the name of your project.
 This name will be used in page titles and descriptions.

Project Name [My Project]> (Your project name)

 Please specify the absolute path to the project Subversion repository.
 Repository must be local, and trac-admin requires read+write
 permission to initialize the Trac database.

Path to repository [/var/svn/test]> /var/svn

 Please enter location of Trac page templates.
 Default is the location of the site-wide templates installed with Trac.

Templates directory [/usr/local/share/trac/templates]> (Press enter here)
Creating and Initializing Project
(Output removed)
Project database for 'My Project' created.

 Customize settings for your project using the command:

   trac-admin /var/trac

 Don't forget, you also need to copy (or symlink) "trac/cgi-bin/trac.cgi"
 to you web server's /cgi-bin/ directory, and then configure the server.

 If you're using Apache, this config example snippet might be helpful:

    Alias /trac "/wherever/you/installed/trac/htdocs/"
    <Location "/cgi-bin/trac.cgi">
        SetEnv TRAC_ENV "/var/trac"
    </Location>

    # You need something like this to authenticate users
    <Location "/cgi-bin/trac.cgi/login">
        AuthType Basic
        AuthName "My Project"
        AuthUserFile /somewhere/trac.htpasswd
        Require valid-user
    </Location>

 The latest documentation can also always be found on the project website:
 http://projects.edgewall.com/trac/

Congratulations!

Configuration

Configuring Apache

Add the following section into your "/usr/local/apache/conf/httpd.conf" file

Alias /trac "/usr/local/share/trac/htdocs/"
<Location "/cgi-bin/trac.cgi">
   SetEnv TRAC_ENV "/var/svn/trac_project_env"
</Location>

# You need something like this to authenticate users
<Location "/cgi-bin/trac.cgi/login">
   AuthType Basic
   AuthName "My Project"
   AuthUserFile /var/trac/conf/htpasswd
   Require valid-user
</Location>

Configuring passwords

Create the "trac.htpasswd" file

$ cd /var/trac/conf
$ /usr/local/apache2/bin/htpasswd -c htpasswd admin

You can add more users by using: /usr/local/apache2/bin/htpasswd htpasswd username

Configuring file permissions

Change the permissions on the Trac environment so Apache has read/write access to the trac.db file

$ chmod -Rv a+rw /var/trac

Copy trac.cgi

Copy trac.cgi to the directory /usr/local/apache2/cgi-bin

$ cd /usr/local/apache2/cgi-bin
$ cp /usr/local/share/trac/cgi-bin/trac.cgi .

Congratulations

Start Apache and point your web browser at "localhost/cgi-bin/trac.cgi"

$ /usr/local/apache2/bin/httpd

Please mail me if you need additional environments to compile and install on: dragoncity99@…

I would like to updated my "Original How-To in Plain Text" as well.


NOTE: It is also possible to install sqlite3 instead of sqlite2 and have a successful Trac installation on RH9. Just make sure to install Pysqlite version 1.1.7. -A.H.

Back to platform index: TracInstallPlatforms

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.