I have pulled together a set of notes on how to set up TRAC+SVN on
apache2 under Leopard server.  Not sure if anyone else wants to see
them, but I thought they might be helpful.

Here they are, in wiki format.

Charlie

= Trac On Mac OSX 10.5 Leopard =

The following instructions were based on the notes at
http://sonzea.com/articles/subversion-trac.html, and extended to
address the issues I encountered.

In order to get Trac with SVN running on Leopard, I followed the
following steps:

 1. Create a user account (subversion) for file storage and enable
sudo.
     * Use the Workgroup Administrator application and create the user
"Subversion" (with short name "subversion")
     * Log in as an Administrator and edit the sudo file  (using
```sudo visudo```)
 1. Set up a simple test SVN repository.
{{{
 % cd /Users/subversion; svnadmin create test-repo
}}}
 1. Test that the SVN repository works
{{{
 % cd /tmp
 % svn co file:///Users/subversion/test-repo
 % cd test-repo
 % svn mkdir tags branches trunk
 % svn ci -m "Initial structure"
}}}
 1. With that simple repository, time to set up apache to get HTTP
access to this (via DAV).  Later, this will facilitate moving the HTTP-
based authentication against the Mac OSX server directory. To do this,
create a file ```httpd-subversion.conf``` in ```/private/etc/apache2/
extra``` with the following contents:
{{{
 DavLockDB var/DavLock
 LoadModule dav_svn_module     libexec/apache2/mod_dav_svn.so
 LoadModule authz_svn_module   libexec/apaache2/mod_authz_svn.so

 <Location /test-repo>
    DAV svn
    SNVPath /Users/subversion/test-repo
 </Location>
}}}
 1. Add in a line into the ```httpd.conf``` file right after the SSL
lines that reads:
{{{
   #
   # Subversion
   Include /private/etc/apache2/extra/httpd-subversion.conf
   # End of Subversion
   #
}}}
 1. Restart apache and verify access to ```http://localhost/test-
repo```
{{{
 sudo apachectl graceful-stop
 sudo apachectl start
}}}
 1. Using Server Admin, enable SSL and restart Apache.  This creates
the required SSL files.
 1. Enable access via both port ```80``` and ```443``` by changing ```/
etc/apache2/sites/virtual_host_global.conf``` to end with:
{{{
   Listen *:80
   Listen *:443
}}}
 1. Ensure that there are both ```0000_any_80_.conf``` and
```0000_any_443_.conf`` files.  If either are *.conf.default, rename
them, and then restart apache
{{{
 % mv 0000_any_80_.conf.default 0000_any_80_.conf
 % mv 0000_any_443_.conf.default 0000_any_443_.conf
 % sudo apachectl graceful-stop
 % sudo apachectl start
}}}
 1. Check SSL operation, by going to ```https://localhost/``` and
```http://localhost/```
 1. Change the SVN repository to require SSL, by adding the following
lines in the ```httpd-subversion.conf```
{{{
 SSLRequireSSL
}}}
 1. Now, make subversion require a valid user, validated against the
Open Directory accounts using ```apple_auth_module```
(```mod_auth_apple.so```).  Change ```extra/httpd-subversion.conf```
to the following, restart apache and test again.
{{{
DavLockDB var/DavLock

LoadModule auth_basic_module libexec/apache2/mod_auth_basic.so

LoadModule dav_module           libexec/apache2/mod_dav.so
LoadModule dav_fs_module        libexec/apache2/mod_dav_fs.so
LoadModule dav_svn_module       libexec/apache2/mod_dav_svn.so
LoadModule authz_svn_module     libexec/apache2/mod_authz_svn.so
LoadModule apple_auth_module    libexec/apache2/mod_auth_apple.so
<Location /test-repo>
    DAV svn
    SVNPath /Users/subversion/test-repo
    AuthType Basic
    AuthName "SVN Repository"
    AuthuserFile /dev/null
    AuthBasicAuthoritative Off
    Require valid-user
    SSLRequireSSL
</Location>
}}}
 1. To install TRAC, download trac 0.11b1 from http://trac.edgewall.org,
unpack, and install:
{{{
 % gunzip Trac-0.11b1.tar.gz
 % tar xf Trac-0.11b1.tar
 % cd Trac-0.11b1
 % sudo python ./setup.py install
}}}
 1. Create a trac environment
{{{
 % trac-admin /Users/subversion/trac initenv
 % sudo chown -R www /Users/subversion/trac
}}}
 1. Test this trac environment is running, by using the tracd first.
Since the directory is now owned by www, the sudo is required.  Use
Safari to check this by opening http://localhost:8000
{{{
 % sudo tracd --port 8000 /Users/subversion/trac
}}}
 1. To set up TRAC to run under Apache (so we can get a single
authentication system in place), we need to create ```httpd-
fastcgi.conf``` under ```/private/etc/apache2/extra``` with the
following content:
{{{
# Enable FASTCGI for .fcgi files
<IfModule mod_fastcgi.c>
    AddHandler fastcgi-script .fcgi
   FastCgiIpcDir var/run/fastcgi
</IfModule>

LoadModule fastcgi_module libexec/apache2/mod_fastcgi.so
}}}
 1. Configure apache to react to ```/trac``` references using fastcgi
with the following content in ```httpd-trac.conf``` (also in ```/
private/etc/apache2/extra```
{{{
#
ScriptAlias /trac /Users/subversion/Trac-0.11b1/cgi-bin/trac.fcgi
FastCgiConfig -initial-env TRAC_ENV=/Users/subversion/trac

<Location "/trac">
    SetEnv TRAC_ENV "/Users/subversion/trac"
    SSLRequireSSL
</Location>

<Directory "/Users/subversion/Trac-0.11b1/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
}}}
 1. Modify ```httpd.conf``` to include these files, adding the
following lines just below the line for subversion (as added above)
{{{
##
## TRAC
##
Include /private/etc/apache2/extra/httpd-fastcgi.conf
Include /private/etc/apache2/extra/httpd-trac.conf
##
## End of TRAC changes
###
}}}
 1. Test this by restarting apache and accessing ```http://localhost/
trac```
 1. Modify TRAC to require an authenticated user.  Change the content
in ```httpd-trac.conf``` (in ```/private/etc/apache2/extra```) to that
shown below and restart apache:
{{{
#
ScriptAlias /trac /Users/subversion/Trac-0.11b1/cgi-bin/trac.fcgi
FastCgiConfig -initial-env TRAC_ENV=/Users/subversion/trac

<Location "/trac">
    SetEnv TRAC_ENV "/Users/subversion/trac"
    AuthType Basic
    AuthName "SVN Repository"
    AuthuserFile /dev/null
    AuthBasicAuthoritative Off
    Require valid-user
    SSLRequireSSL
</Location>

<Directory "/Users/subversion/Trac-0.11b1/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
}}}
 1. To enable the !WebAdmin page to all authenticated users, use the
following commands:
{{{
 % sudo trac-admin .
    > permission add authenticated TRAC_ADMIN
    > quit
}}}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to