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
5 comments:
Hi, useful post.
If possible I would like to know, if a similar setup can get rid of Berkeley DB.
In my case I already have a working installation of subversion using FS and I would like to install trac, but install from port fails and while trying to install first devel/apr-svn it start downloading and installing db42.
Thanks
I'll have to see what I can do, give me just a bit to play around with it and I'll let you know. Feel free to hit me up on #freenode, I can generally be found lurking around #snort, #inprotect or a few others :-)
Cheers,
J
I followed this thinking it look thorough and clear - however its pants.
Build failing all over the place installing ports that conflict with later ports and incomplete configuration
Can you tell me exactly where you experienced the issue? I have performed many installations using the exact steps mentioned and also am aware of several of my readers that have been successful with it. Of course if something has changed in the ports tree recently, this is a possibility.
I will be running a test install with the latest ports tree tomorrow to test this and will followup.
Again, if you can please provide details of the build failure(s) and architecture etc...
Cheers,
JJC
Thanks a ton :)
after hours of pulling my hair with svn and trac, your guide finally made me setup the whole stuff in matter of few mins..thanks .
Post a Comment