[[PageOutline(2-4)]] = Trac + SVN Installation on Mac OS X Server 10.4.7 == Requirements Mac OS X Server 10.4.7 + XCode 2.3; [http://developer.apple.com/tools/xcode/ download]. ||[http://trac.edgewall.org/wiki/TracDownload#LatestStableRelease Trac]||0.9.6|| ||[http://www.python.org/ Python]||2.3.5 (as installed with OS X 10.4.7)|| ||[http://httpd.apache.org/ Apache]||2.0.58|| ||[http://www.modpython.org/ mod_python]||3.2.8|| ||[http://www.swig.org/ Swig]||1.3.29|| ||[http://subversion.tigris.org/ Subversion]||1.3.2|| ||[http://www.sqlite.org/ SQLite]||3.1.3 (as installed with OS X 10.4.7)|| ||[http://pysqlite.org/ PySQLite]||2.2.2|| ||[http://clearsilver.net/ Clearsilver]||0.10.3|| ||[http://docutils.sourceforge.net/ Docutils]||0.4|| == Preliminaries == 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. === Swig {{{ cd ./configure --with-python=/usr/bin/python make sudo make install }}} === Apache2 {{{ cd ./configure --enable-mods-shared=most --enable-ssl --with-mpm=worker --without-berkeley-db –-enable-so make sudo make install }}} === mod_python {{{ cd ./configure --with-apxs=/usr/local/apache2/bin/apxs --with-python=/usr/bin/python make sudo make install }}} === Subversion {{{ cd ./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 make sudo make install }}} Swig svn python bindings: {{{ cd 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 sudo python setup.py install }}} === Clearsilver '''Note''': ClearSilver has been replaced by the [http://genshi.edgewall.org/ Genshi templating engine] as of Trac 0.11. {{{ cd ./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 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 [http://developer.apple.com/internet/opensource/cvsoverview.html 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: {{{ SetHandler mod_python PythonHandler trac.web.modpython_frontend PythonOption TracEnv /var/trac/your_project AuthType Basic AuthName "emersion" AuthUserFile /var/trac/your_project/.htpasswd Require valid-user 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] YourName:8d2yxeC7vAkiQ HisName:7$4k2Ci4QoVFc }}} {{{[users]}}} is important for the AuthzSVNAccessFile. To generate a password, you can use [http://www.engr.sjsu.edu/daluu/scripts/htpasswd.php 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 [http://svnbook.red-bean.com/en/1.2/svn-book.html#svn.serverconfig.httpd.authz 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 Trac [http://localhost:80/your_project] * for SVN direct access [http://localhost:80/your_project/svn] For external access please make your own apache's configuration. === Author thibaud.guillaume-gentil at epfl.ch