1 | | See TracOnOsxDarwinPorts |
| 1 | See TracOnOsxDarwinPorts= Using MacPorts (what used to be known as DarwinPorts) = |
| 2 | |
| 3 | Installation steps: |
| 4 | |
| 5 | 1. sudo port install apache2 |
| 6 | 1. sudo port install subversion +mod_dav_svn |
| 7 | 1. sudo port install trac |
| 8 | |
| 9 | Optional: |
| 10 | 1. sudo port install mod_python25 |
| 11 | |
| 12 | Note that you must ensure that you have installed the right version of mod_python for the python version upon which trac depends. As of late August, 2007 this is python25, and thus you have to use mod_python25. |
| 13 | |
| 14 | After installing mod_python you may need to add |
| 15 | {{{LoadModule python_module modules/mod_python.so}}} to your httpd.conf file. |
| 16 | |
| 17 | |
| 18 | Here is the trac configuration from my httpd.conf |
| 19 | |
| 20 | {{{ |
| 21 | <VirtualHost *> |
| 22 | # |
| 23 | # recall that ServerName has to be a read DNS name and |
| 24 | # match your VirtualHost spec (esp. if you are running on a special port) |
| 25 | # |
| 26 | ServerName projects.<domain>.com |
| 27 | |
| 28 | DocumentRoot "/Projects/Trac" |
| 29 | |
| 30 | # |
| 31 | # don't forget to give httpd permission to read your trac docs and your trac root! |
| 32 | # |
| 33 | <Directory "/opt/local/share/trac/htdocs/"> |
| 34 | Order allow,deny |
| 35 | Allow from all |
| 36 | </Directory> |
| 37 | |
| 38 | <Directory "/Projects/Trac"> |
| 39 | Order allow,deny |
| 40 | Allow from all |
| 41 | </Directory> |
| 42 | |
| 43 | # |
| 44 | # trac mod_python configuration |
| 45 | # |
| 46 | |
| 47 | # we must first indicate where the doc supplementary |
| 48 | # files are so that trac's internal documentation works |
| 49 | # |
| 50 | Alias /trachtdocs/ "/opt/local/share/trac/htdocs/" |
| 51 | <Location /trac> |
| 52 | # then we indicate that, for this location, mod_python is in use |
| 53 | SetHandler mod_python |
| 54 | PythonInterpreter main_interpreter |
| 55 | |
| 56 | # next, we indicate where the "main()" is for mod_python |
| 57 | PythonHandler trac.web.modpython_frontend |
| 58 | |
| 59 | # and now we configure trac via a few mod_python env variables. |
| 60 | PythonOption TracUriRoot "/trac" |
| 61 | PythonOption TracEnvParentDir "/Projects/Trac" |
| 62 | </Location> |
| 63 | |
| 64 | # |
| 65 | # trac authenticates with URLs of the form .../login, |
| 66 | # so we must match appropriately according to our TracUriRoot above |
| 67 | # |
| 68 | <LocationMatch /trac/[[:alnum:]]+/login> |
| 69 | # for this example, only basic file-based authentication is demonstrated, |
| 70 | # but don't forget that many rich forms of authentication are available |
| 71 | # including LDAP, DBM, groupfile, etc. |
| 72 | AuthType Basic |
| 73 | AuthName "<domain's> Trac" |
| 74 | AuthUserFile "/opt/local/etc/trac-auth-file" |
| 75 | Require valid-user |
| 76 | </LocationMatch> |
| 77 | </VirtualHost> |
| 78 | }}} |
| 79 | |
| 80 | |
| 81 | == If you installed Subversion without Berkeley DB support == |
| 82 | |
| 83 | If you installed Subversion without Berkeley DB support and the rest as above you get an Trac error: |
| 84 | |
| 85 | {{{ |
| 86 | TracError: Unsupported version control system "svn". Check that the Python bindings for "svn" are correctly installed. |
| 87 | }}} |
| 88 | |
| 89 | The reason is that the Subversion python bindings have been installed with the Berkeley DB support. |
| 90 | |
| 91 | Either start again and follow the above instructions exactly or fix as follows: |
| 92 | |
| 93 | 1. sudo port uninstall trac |
| 94 | 1. sudo port uninstall subversion-python25bindings |
| 95 | 1. sudo port install subversion-python25bindings +no_bdb |
| 96 | 1. sudo port install trac |
| 97 | |