First things first, let's build Apache and Subversion with the appropriate options:
secure# cd /usr/ports/www/apache22Now, let's prepare and build or repository
secure# make WITH_AUTH_MODULES=yes WITH_DAV_MODULES=yes \
WITH_SSL_MODULES=yes WITH_BERKELEYDB=db42 install clean
secure# cd /usr/ports/devel/subversion
secure# make -DWITH_SVNSERVE_WRAPPER -DWITH_MOD_DAV_SVN \
-DWITH_APACHE2_APR install clean
secure# mkdir -p /svn/reposAfter we build our repo and set permissions for www to access them, we need to setup our apache to use dav_svn_module and authz_svn_module. You will need to edit /usr/local/etc/apache22/httpd.conf and modify as noted in the excerpt from mine. Note the commented out dav_module (don't forget to do this or it's gonna break stuff later on)
secure# svnadmin create /svn/repos
secure# chown -R www:www /svn/repos
.....Next we will be creating our /usr/local/etc/apache22/Includes/svn.conf
LoadModule usertrack_module libexec/apache22/mod_usertrack.so
LoadModule unique_id_module libexec/apache22/mod_unique_id.so
LoadModule setenvif_module libexec/apache22/mod_setenvif.so
LoadModule version_module libexec/apache22/mod_version.so
LoadModule ssl_module libexec/apache22/mod_ssl.so
LoadModule mime_module libexec/apache22/mod_mime.so
LoadModule dav_module libexec/apache22/mod_dav.so
LoadModule status_module libexec/apache22/mod_status.so
LoadModule autoindex_module libexec/apache22/mod_autoindex.so
LoadModule asis_module libexec/apache22/mod_asis.so
LoadModule info_module libexec/apache22/mod_info.so
.......
LoadModule alias_module libexec/apache22/mod_alias.so
LoadModule rewrite_module libexec/apache22/mod_rewrite.so
#LoadModule dav_module libexec/apache22/mod_dav.so
LoadModule dav_svn_module libexec/apache22/mod_dav_svn.so
LoadModule authz_svn_module libexec/apache22/mod_authz_svn.so
secure# vi /usr/local/etc/apache22/Includes/svn.confCreate our auth file using htpasswd
DAV svn
SVNPath /svn/repos
AuthType Basic
AuthName "Feloo Subversion Repository"
AuthUserFile /etc/svn-auth-file
Require valid-user
secure# htpasswd -cm /etc/svn-auth-file JJCBuild Trac from the ports tree
secure# cd /usr/ports/www/trac && make install cleanCreate and initialize our environment
secure# mkdir -p /trac/projects/Build mod_python3
secure# trac-admin /trac/projects initenv
secure# chown -R www:www /trac/projects/
secure# cd /usr/ports/www/mod_python3 && make install cleanAdd one last module to our /usr/local/etc/apache22/httpd.conf
secure# vi /usr/local/etc/apache22/httpd.confDefine our trac location in /usr/local/etc/apache22/Includes/trac.conf (you'll have to create it)
LoadModule python_module libexec/apache22/mod_python.so
secure# vi /usr/local/etc/apache22/Includes/trac.conf
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /trac/projects
PythonOption TracUriRoot /trac
AuthType Basic
AuthName "JJC Trac Projects"
AuthUserFile /etc/svn-auth-file
Require valid-user
Now, start (or restart) your apache daemon
apachectl startYou should now be able to access Trac at http://theinstallediporhostname/trac
Cheers,
JJC