Edgewall Software

Trac + SVN Installation on Mac OS X Server 10.4.7


Mac OS X Server 10.4.7 + XCode 2.3; download.

Python2.3.5 (as installed with OS X 10.4.7)
SQLite3.1.3 (as installed with OS X 10.4.7)


Install Mac OS X Server 10.4.7 and XCode 2.3.

Download all binaries and untar it for example in the folder /usr/local/temp.

Binairies Installation

Note: The order of installation is important.


cd <swig-distribution-top-dir>
./configure --with-python=/usr/bin/python
sudo make install


cd <apache2-distribution-top-dir>
./configure --enable-mods-shared=most --enable-ssl --with-mpm=worker --without-berkeley-db –-enable-so
sudo make install


cd <mod_python-distribution-top-dir>
./configure --with-apxs=/usr/local/apache2/bin/apxs --with-python=/usr/bin/python
sudo make install


cd <subversion-distribution-top-dir>
./configure -prefix=/usr/local  --without-berkeley-db --enable-swig-bindings=python \
    --with-swig=/usr/local/bin/swig PYTHON2=/System/Library/Frameworks/Python.framework/Versions/2.3/ \
    --mandir=/usr/local/share/man --with-ssl  --with-apxs=/usr/local/apache2/bin/apxs --with-zlib \
    --with-apr=/usr/local/apache2 --with-apr-util=/usr/local/apache2
sudo make install

Swig svn python bindings:

cd <subversion-distribution-top-dir>
make swig-py
sudo make install-swig-py
echo /usr/local/lib/svn-python > /Library/Python/2.3/site-packages/svn-python.pth


cd <pysqlite-distribution-top-dir>
sudo python setup.py install


Note: ClearSilver has been replaced by the Genshi templating engine as of Trac 0.11.

cd <clearsilver-distribution-top-dir>
./configure --prefix=/usr/local --with-python=/usr/bin/python --disable-ruby
# >>> here modify first line of scripts/document.py to use same python  (#!/usr/bin/ python)
sudo make install 


cd <docutils-distribution-top-dir>
sudo python setup.py install

Trac + SVN Configuration

First choose a location for your subversion repository, eg /var/svn/your_project, and one for you Trac environment, eg /var/trac/your_project.

You may need to manage access rights on theTtrac env directory tree. This may be done by first creating a UNIX group dedicated to this trac project, eg trac, and assigning the various users to this group. The apache www user should be one of these. If you need a nice description of how to do this, look at Apple CVSOverview, then search for the text "create a new group" or "NetInfo Manager".

In my configuration Apache2 is the nobody user, so you can try:

sudo chgrp -R www /var/trac
sudo chmod -R 770 /var/trac
sudo chgrp -R www /var/svn
sudo chmod -R 770 /var/svn

SVN Repository

svnadmin create /var/svn/your_project

Subversion executables are installed into /usr/local/bin, which is not in the default path in Mac OS X Server v10.4. To add /usr/local/bin to a user's default path, create a .profile file in your home directory or simply add the line if you already have a .profile file:

cd ~
echo 'export PATH="$PATH:/usr/local/bin"' >> .profile

To make sure the repository works fine, try for example the following:

cd /tmp
mkdir proj
cd proj
mkdir trunk branches tags
cd ..
svn import proj file:///var/svn/your_project -m "Import First"
rm -r proj
svn co file:///var/svn/your_project proj
cd proj
svn update 

Trac Environment

trac-admin /var/trac/your_project initenv

Your trac-admin binary may not be in your search path if trac-admin isn't found, try:

cd ~
echo 'export PATH="$PATH:/System/Library/Frameworks/Python.framework/Versions/Current/bin/trac*"' >> .profile

Apache2 Configuration and Right Access

Apache httpd.conf

Open and edit httpd.conf in /usr/local/apache2/conf.

Add this module (if not already existent) at line ~265:

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

LoadModule python_module modules/mod_python.so

Change the process user of Apache (nobody becomes www) at line ~300:

User www

Add and configure access to Trac and SVN path at line ~1040:

<Location /your_project/>
   SetHandler mod_python
   PythonHandler trac.web.modpython_frontend 
   PythonOption TracEnv /var/trac/your_project

<Location "/your_project/login">
  AuthType Basic
  AuthName "emersion"
  AuthUserFile /var/trac/your_project/.htpasswd
  Require valid-user

<Location /your_project/svn>
    DAV svn
    SVNPath /var/svn/eMersion 
    AuthzSVNAccessFile /var/svn/your_project/conf/authz
    AuthType Basic
    AuthName "Reférentiel Subversion"
    AuthUserFile /var/trac/your_project/.htpasswd
    Require valid-user

Trac and SVN .htpasswd

Trac and SVN can share the same .htpasswd, but you can separate it if you want.

Create the .htpasswd in /var/trac/your_project/, for example:


[users] is important for the AuthzSVNAccessFile.

To generate a password, you can use this web site.

SVN authz

Edit the file authz in /var/svn/your_project/conf/, for example:

admin = YourName

@admin = rw
HisName = r
* =

For more details on this configuration's file please read this.

Start Apache2

Now you can start Apache2:

sudo /usr/local/apache2/bin/apachectl start

You can check if everything is working well:

For external access please make your own apache's configuration.


thibaud.guillaume-gentil at epfl.ch

Last modified 7 years ago Last modified on Feb 21, 2015, 9:52:58 PM
Note: See TracWiki for help on using the wiki.