Edgewall Software

Version 3 (modified by anonymous, 18 years ago) ( diff )

Trac + SVN Installation on Mac OS X Server 10.4.7

Requirements

Mac OS X Server 10.4.7 + XCode 2.3 (Download)

Trac0.9.6
Python2.3.5 (as installed with OS X 10.4.7)
Apache2.0.58
mod_python3.2.8
Swig1.3.29
Subversion1.3.2
SQLite3.1.3 (as installed with OS X 10.4.7)
PySQLite2.2.2
Clearsilver0.10.3
Docutils0.4

Preliminaries

Install Mac OS X Server 10.4.7 and XCode 2.3

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

Binairies Installation

The order of installation it's very important respect it, please!

Swig

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

Apache 2

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

mod_python

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

Subversion

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 \
    --enable-swig-bindings=no --with-apr=/usr/local/apache2 --with-apr-util=/usr/local/apache2
make
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

PySQLite

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

Clearsilver

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

Docutils

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

Trac + SVN Configuration

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

You may need to manage access rights on the trac env directory tree. This may be done by first creating a unix group dedicated to this trac project, e.g. 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 the 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 nobody /var/trac
sudo chmod -R 770 /var/trac
sudo chgrp -R nobody /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 is ok, play with it a little:

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 exist) 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

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>

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

<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
</Location>

Trac and SVN .htpasswd

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

create the .htpasswd in /var/trac/your_project/, for exampe:

[users]
YourName:8d2yxeC7vAkiQ
HisName:7$4k2Ci4QoVFc

[users] is important for the AuthzSVNAccessFile.

For generate password you can use this web site

SVN authz

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

[groups]
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

Note: See TracWiki for help on using the wiki.