| 1 | [[PageOutline(2-4)]] |
| 2 | = Trac + SVN Installation on Mac OS X Server 10.4.7 = |
| 3 | |
| 4 | == Requirements == |
| 5 | |
| 6 | Mac OS X Server 10.4.7 + XCode 2.3 ([http://developer.apple.com/tools/xcode/ Download]) |
| 7 | |
| 8 | ||[http://projects.edgewall.com/trac/ Trac]||0.9.6|| |
| 9 | ||[http://www.python.org/ Python]||2.3.5 (as installed with OS X 10.4.7)|| |
| 10 | ||[http://httpd.apache.org/ Apache]||2.0.58|| |
| 11 | ||[http://www.modpython.org/ mod_python]||3.2.8|| |
| 12 | ||[http://www.swig.org/ Swig]||1.3.29|| |
| 13 | || [http://subversion.tigris.org/ Subversion]||1.3.2|| |
| 14 | ||[http://www.sqlite.org/ SQLite]||3.1.3 (as installed with OS X 10.4.7)|| |
| 15 | ||[http://pysqlite.org/ PySQLite]||2.2.2|| |
| 16 | ||[http://clearsilver.net/ Clearsilver]||0.10.3|| |
| 17 | ||[http://docutils.sourceforge.net/ Docutils]||0.4|| |
| 18 | |
| 19 | == Preliminaries == |
| 20 | |
| 21 | Install Mac OS X Server 10.4.7 and XCode 2.3 |
| 22 | |
| 23 | Download all binaries and untar it in the folder {{{/usr/local/temp}}} (for example) |
| 24 | |
| 25 | == Binairies Installation == |
| 26 | '''The order of installation it's very important respect it, please!''' |
| 27 | |
| 28 | === Swig === |
| 29 | |
| 30 | {{{ |
| 31 | cd <swig-distribution-top-dir> |
| 32 | ./configure --with-python=/usr/bin/python |
| 33 | make |
| 34 | sudo make install |
| 35 | }}} |
| 36 | |
| 37 | === Apache 2 === |
| 38 | |
| 39 | {{{ |
| 40 | cd <apache2-distribution-top-dir> |
| 41 | ./configure --enable-mods-shared=most --enable-ssl --with-mpm=worker --without-berkeley-db –-enable-so |
| 42 | make |
| 43 | sudo make install |
| 44 | }}} |
| 45 | |
| 46 | === mod_python === |
| 47 | |
| 48 | {{{ |
| 49 | cd <mod_python-distribution-top-dir> |
| 50 | ./configure --with-apxs=/usr/local/apache2/bin/apxs --with-python=/usr/bin/python |
| 51 | make |
| 52 | sudo make install |
| 53 | }}} |
| 54 | |
| 55 | === Subversion === |
| 56 | |
| 57 | {{{ |
| 58 | cd <subversion-distribution-top-dir> |
| 59 | ./configure -prefix=/usr/local --without-berkeley-db --enable-swig-bindings=python \ |
| 60 | --with-swig=/usr/local/bin/swig PYTHON2=/System/Library/Frameworks/Python.framework/Versions/2.3/ \ |
| 61 | --mandir=/usr/local/share/man --with-ssl --with-apxs=/usr/local/apache2/bin/apxs --with-zlib \ |
| 62 | --enable-swig-bindings=no --with-apr=/usr/local/apache2 --with-apr-util=/usr/local/apache2 |
| 63 | make |
| 64 | sudo make install |
| 65 | }}} |
| 66 | |
| 67 | swig svn python bindings |
| 68 | |
| 69 | {{{ |
| 70 | cd <subversion-distribution-top-dir> |
| 71 | make swig-py |
| 72 | sudo make install-swig-py |
| 73 | echo /usr/local/lib/svn-python > /Library/Python/2.3/site-packages/svn-python.pth |
| 74 | }}} |
| 75 | |
| 76 | === PySQLite === |
| 77 | |
| 78 | {{{ |
| 79 | cd <pysqlite-distribution-top-dir> |
| 80 | sudo python setup.py install |
| 81 | }}} |
| 82 | |
| 83 | === Clearsilver === |
| 84 | |
| 85 | {{{ |
| 86 | cd <clearsilver-distribution-top-dir> |
| 87 | ./configure --prefix=/usr/local --with-python=/usr/bin/python --disable-ruby |
| 88 | make |
| 89 | # >>> here modify first line of scripts/document.py to use same python (#!/usr/bin/ python) |
| 90 | sudo make install |
| 91 | }}} |
| 92 | |
| 93 | === Docutils === |
| 94 | |
| 95 | {{{ |
| 96 | cd < docutils-distribution-top-dir> |
| 97 | sudo python setup.py install |
| 98 | }}} |
| 99 | |
| 100 | == Trac + SVN Configuration == |
| 101 | |
| 102 | First choose a location for your subversion repository, e.g. {{{/var/svn/your_project}}}, and one for you trac environment, e.g. {{{/var/trac/your_project}}}. |
| 103 | |
| 104 | You may need to manage access rights on the trac env directory tree. This may be done by first creating a unix group dedicated to this trac project, e.g. {{{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 the [http://developer.apple.com/internet/opensource/cvsoverview.html Apple CVSOverview] (then search for the text "create a new group" or "!NetInfo Manager"). |
| 105 | |
| 106 | In my configuration Apache2 is the {{{nobody}}} user so you can try: |
| 107 | |
| 108 | {{{ |
| 109 | sudo chgrp -R nobody /var/trac |
| 110 | sudo chmod -R 770 /var/trac |
| 111 | sudo chgrp -R nobody /var/svn |
| 112 | sudo chmod -R 770 /var/svn |
| 113 | }}} |
| 114 | |
| 115 | === SVN Repository === |
| 116 | |
| 117 | {{{ |
| 118 | svnadmin create /var/svn/your_project |
| 119 | }}} |
| 120 | |
| 121 | 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): |
| 122 | |
| 123 | {{{ |
| 124 | cd ~ |
| 125 | echo 'export PATH="$PATH:/usr/local/bin"' >> .profile |
| 126 | }}} |
| 127 | |
| 128 | To make sure the repository is ok, play with it a little: |
| 129 | {{{ |
| 130 | cd /tmp |
| 131 | mkdir proj |
| 132 | cd proj |
| 133 | mkdir trunk branches tags |
| 134 | cd .. |
| 135 | svn import proj file:///var/svn/your_project -m "Import First" |
| 136 | rm -r proj |
| 137 | svn co file:///var/svn/your_project proj |
| 138 | cd proj |
| 139 | svn update |
| 140 | }}} |
| 141 | |
| 142 | === Trac Environment === |
| 143 | |
| 144 | {{{ |
| 145 | trac-admin /var/trac/your_project initenv |
| 146 | }}} |
| 147 | |
| 148 | Your {{{trac-admin}}} binary may not be in your search path - if {{{trac-admin}}} isn't found, try: |
| 149 | |
| 150 | {{{ |
| 151 | cd ~ |
| 152 | echo 'export PATH="$PATH:/System/Library/Frameworks/Python.framework/Versions/Current/bin/trac*"' >> .profile |
| 153 | }}} |
| 154 | |
| 155 | == Apache2 Configuration and Right Access == |
| 156 | |
| 157 | === apache httpd.conf === |
| 158 | |
| 159 | Open and edit {{{httpd.conf}}} in {{{/usr/local/apache2/conf}}} |
| 160 | |
| 161 | Add this module (if not already exist) at line ~265 |
| 162 | |
| 163 | {{{ |
| 164 | LoadModule dav_svn_module modules/mod_dav_svn.so |
| 165 | LoadModule authz_svn_module modules/mod_authz_svn.so |
| 166 | |
| 167 | LoadModule python_module modules/mod_python.so |
| 168 | }}} |
| 169 | |
| 170 | Add and configure access to Trac and SVN path at line ~1040 |
| 171 | |
| 172 | {{{ |
| 173 | <Location /your_project/> |
| 174 | SetHandler mod_python |
| 175 | PythonHandler trac.web.modpython_frontend |
| 176 | PythonOption TracEnv /var/trac/your_project |
| 177 | </Location> |
| 178 | |
| 179 | <Location "/your_project/login"> |
| 180 | AuthType Basic |
| 181 | AuthName "emersion" |
| 182 | AuthUserFile /var/trac/your_project/.htpasswd |
| 183 | Require valid-user |
| 184 | </Location> |
| 185 | |
| 186 | <Location /your_project/svn> |
| 187 | DAV svn |
| 188 | SVNPath /var/svn/eMersion |
| 189 | |
| 190 | AuthzSVNAccessFile /var/svn/your_project/conf/authz |
| 191 | |
| 192 | AuthType Basic |
| 193 | AuthName "Reférentiel Subversion" |
| 194 | AuthUserFile /var/trac/your_project/.htpasswd |
| 195 | Require valid-user |
| 196 | </Location> |
| 197 | }}} |
| 198 | |
| 199 | === Trac and SVN .htpasswd === |
| 200 | |
| 201 | Trac ans SVN can share the same {{{.htpasswd}}}, but you can separate it if you want. |
| 202 | |
| 203 | create the {{{.htpasswd}}} in {{{/var/trac/your_project/}}}, for exampe: |
| 204 | |
| 205 | {{{ |
| 206 | [users] |
| 207 | YourName:8d2yxeC7vAkiQ |
| 208 | HisName:7$4k2Ci4QoVFc |
| 209 | }}} |
| 210 | |
| 211 | {{{[users]}}} is important for the AuthzSVNAccessFile. |
| 212 | |
| 213 | For generate password you can use [http://www.engr.sjsu.edu/daluu/scripts/htpasswd.php this web site] |
| 214 | |
| 215 | === SVN authz === |
| 216 | |
| 217 | Edit the file {{{authz}}} in {{{/var/svn/your_project/conf/}}}, for example: |
| 218 | |
| 219 | {{{ |
| 220 | [groups] |
| 221 | admin = YourName |
| 222 | |
| 223 | [/] |
| 224 | @admin = rw |
| 225 | HisName = r |
| 226 | * = |
| 227 | }}} |
| 228 | |
| 229 | 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] |
| 230 | |
| 231 | === Start apache2 === |
| 232 | |
| 233 | Now you can start apache2: |
| 234 | |
| 235 | {{{ |
| 236 | sudo /usr/local/apache2/bin/apachectl start |
| 237 | }}} |
| 238 | |
| 239 | You can check if everything is working well: |
| 240 | |
| 241 | * for trac [http://localhost:80/your_project] |
| 242 | * for svn direct access [http://localhost:80/your_project/svn] |
| 243 | |
| 244 | For external access please make your own apache's configuration |
| 245 | |
| 246 | thibaud.guillaume-gentil [at] epfl.ch |