Changes between Version 60 and Version 61 of TracOnOsx
- Timestamp:
- Oct 26, 2015, 7:55:20 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracOnOsx
v60 v61 18 18 '''Note:''' the [http://fink.sourceforge.net/faq/usage-fink.php?phpLang=en#unstable unstable tree] in Fink is actually often advisable over stable since it includes more up-to-date packages. 19 19 20 '''Warning:''' If you wish to use Pysqlite2/SQLite3 you should either create your Trac project after installing pysqlite2-py24 or you will need to manually convert your Trac project database from SQLite2 to SQLite3. Trac tries to load Pysqlite2/SQLite3 in preference to Pysqlite/SQLite2. If your database is SQLite2 and you have Pysqlite2/SQLite3, you will get errors about your database being unknown or encrypted.21 {{{ 20 '''Warning:''' If you wish to use Pysqlite2/SQLite3, you should either create your Trac project after installing pysqlite2-py24 or you will need to manually convert your Trac project database from SQLite2 to SQLite3. Trac tries to load Pysqlite2/SQLite3 in preference to Pysqlite/SQLite2. If your database is SQLite2 and you have Pysqlite2/SQLite3, you will get errors about your database being unknown or encrypted. 21 {{{#!sh 22 22 $ mv trac.db trac2.db 23 23 $ sqlite trac2.db .dump | sqlite3 trac.db … … 28 28 Start by making sure your Fink base system is the most current: 29 29 30 {{{ 30 {{{#!sh 31 31 $ fink selfupdate 32 32 }}} 33 33 34 '''Note:''' it is recommended to have the [http://fink.sourceforge.net/doc/users-guide/packages.php?phpLang=en#src UseBinaryDist option] enabled in fink (defaults to onin newer fink installations).35 36 When it's done it 'll tell you to update the rest of your packages. It's generally ok to defer that until a little later, although it is advisable to update all your packages at that point.34 '''Note:''' it is recommended to have the [http://fink.sourceforge.net/doc/users-guide/packages.php?phpLang=en#src UseBinaryDist option] enabled in fink (defaults to `on` in newer fink installations). 35 36 When it's done it will tell you to update the rest of your packages. It's generally ok to defer that until a little later, although it is advisable to update all your packages at that point. 37 37 38 38 === Installing SQLite … … 40 40 You can install SQLite this way: 41 41 42 {{{ 42 {{{#!sh 43 43 $ fink install sqlite3 sqlite3-dev 44 44 }}} … … 54 54 Assuming you want Subversion to support secure connections, install it this way (for Mac OS X 10.4): 55 55 56 {{{ 56 {{{#!sh 57 57 $ fink install svn svn-client svn-swig-py24 58 58 }}} … … 62 62 '''Note:''' the non -ssl variants on 10.4 include SSL connection method for Mac OS X 10.4. On 10.3, however, you should do: 63 63 64 {{{ 64 {{{#!sh 65 65 $ fink install svn-ssl svn-client-ssl svn-ssl-swig-py24 66 66 }}} … … 70 70 Now is a good time to have Fink update the rest of its installed packages: 71 71 72 {{{ 72 {{{#!sh 73 73 $ fink update-all 74 74 }}} … … 78 78 It used to be that Pysqlite and Clearsilver couldn't be installed using Fink; instructions on how to manually download and install them are below. Since then however a new Fink package has appeared: 79 79 80 {{{ 80 {{{#!sh 81 81 $ fink install trac-py24 82 82 }}} … … 92 92 To initialize a Trac environment at {{{/path/to/projectenv}}} run the following commands, trac-admin will ask for an existing Subversion repository: 93 93 94 {{{ 94 {{{#!sh 95 95 $ trac-admin /path/to/projectenv initenv 96 96 $ sudo chown -R www /path/to/projectenv … … 99 99 '''Note:''' Remember to set appropriate permissions for your Subversion repository. (which are? Maybe someone could expand on this?) 100 100 101 The Apache user (by default, www) will need at the very least read-access to the repository, and write-access if you want to be able to do commits over http. However, a permission set blocking users/groups other than www from direct access to the repository is recommended. 101 The Apache user (by default, www) will need at the very least read-access to the repository, and write-access if you want to be able to do commits over http. However, a permission set blocking users/groups other than www from direct access to the repository is recommended. See [http://subversion.tigris.org/faq.html#reposperms this FAQ] at subversion.tigris.org. 102 102 103 103 Open the Apache configuration file located in {{{/sw/etc/apache2/sites-enabled/}}} (for 10.4) or {{{/etc/httpd/httpd.conf}}} (for 10.3) for editing: 104 104 105 {{{ 105 {{{#!sh 106 106 $ sudo nano -w /sw/etc/apache2/sites-enabled/000-default 107 107 }}} … … 109 109 Add the following to have Trac appear at {{{yourdomain.tld/webpath}}} (with TracPrettyUrls) and change {{{/path/to/projectenv}}} to your particular setup: 110 110 111 {{{ 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 111 {{{#!apache 112 Alias /trac/ /sw/share/trac/htdocs/ 113 114 RewriteEngine On 115 116 <Directory "/sw/share/trac/htdocs"> 117 Options Indexes MultiViews 118 AllowOverride None 119 Order allow,deny 120 Allow from all 121 </Directory> 122 123 # You need this to allow users to authenticate 124 # trac.htpasswd can be created with 125 # cmd 'htpasswd -c trac.htpasswd' (UNIX) 126 # do 'man htpasswd' to see all the options 127 <Location "/webpath/login"> 128 AuthType Basic 129 AuthName "trac" 130 AuthUserFile /path/to/projectenv/conf/trac.htpasswd 131 Require valid-user 132 </Location> 133 134 SetEnv TRAC_ENV "/path/to/projectenv/" 135 ScriptAliasMatch ^/webpath(.*) /sw/share/trac/cgi-bin/trac.cgi$1 136 136 }}} 137 137 138 138 Check that the mod_env is enabled in your config. By default, the config is commented out. This is what you are looking for: 139 139 140 {{{ 140 {{{#!apache 141 141 LoadModule env_module libexec/httpd/mod_env.so 142 142 AddModule mod_env.c … … 145 145 Now check if Apache is started, and possibly reload the configuration files: 146 146 147 {{{ 147 {{{#!sh 148 148 $ sudo /sw/sbin/apache2ctl graceful 149 149 }}} … … 157 157 Download [http://www.clearsilver.net/ Clearsilver] version 0.9.12. Compile it with Python support and install it in the Fink prefix: 158 158 159 {{{ 159 {{{#!sh 160 160 $ ./configure --prefix=/sw --with-python=/sw/bin/python2.4 --disable-ruby 161 161 $ make install … … 169 169 The file {{{setup.py}}} in the pysqlite distribution doesn't recognize the Darwin platform, so you'll have to add the following lines to {{{setup.py}}}. It should be quite obvious where, but don't put it too late in the list of operating systems it checks: 170 170 171 {{{ 171 {{{#!sh 172 172 elif sys.platform == "darwin": 173 173 include_dirs = ['/sw/include/'] … … 181 181 After that modification the installation should be: 182 182 183 {{{ 183 {{{#!sh 184 184 $ /sw/bin/python2.4 ./setup.py install 185 185 }}} … … 189 189 You should now be all set to install Trac using the TracInstall instructions. Make sure to use {{{/sw/bin/python2.4}}} when running the {{{setup.py}}} script. Most likely, you will also need to add the path to svn-python to your path both when running trac-admin from the command line: 190 190 191 {{{ 191 {{{#!sh 192 192 export PYTHONPATH=/usr/local/lib/svn-python/ 193 193 }}} … … 195 195 and in your Apache configuration: 196 196 197 {{{ 197 {{{#!apache 198 198 <Location "/cgi-bin/trac.cgi"> 199 199 SetEnv PYTHONPATH "/usr/local/lib/svn-python/" … … 203 203 An alternative to setting PYTHONPATH is to execute the following from the shell once: 204 204 205 {{{ 205 {{{#!sh 206 206 echo /usr/local/lib/svn-python/ > /sw/lib/python2.4/SVN.pth 207 207 }}} … … 214 214 I recently installed Trac on an Intel Mac and had a bit of a struggle. I was getting some very annoying `ImportError: No module named svn` errors. I noticed that some python packages install to `/Library/Python/2.3/site-packages/` and some install to `/sw/lib/python2.4/site-packages`. (I guess that's the difference between the manual installations and the Fink installations.) I found that inserting this line into `/Library/Pyhton/2.3/site-packages/Extras.pth` got everything going: 215 215 216 {{{ 216 {{{#!sh 217 217 /sw/lib/python2.4/site-packages 218 218 }}} … … 225 225 If you have problems getting Apple's personal web sharing (Apache 1.3) to run trac.cgi with the correct Python interpreter (/sw/bin/python2.4), you can place this dummy {{{trac.cgi}}} in {{{/Library/WebServer/CGI-Executables/}}}: 226 226 227 {{{ 228 #! 227 {{{#!sh 228 #!/bin/sh 229 229 /sw/bin/python2.4 /somewhere/cgi-bin/trac.cgi 230 230 }}} … … 234 234 Update your python23 installation if you still need this fix: 235 235 236 {{{ 236 {{{#!sh 237 237 $ fink install python24 238 238 }}} … … 240 240 or: 241 241 242 {{{ 242 {{{#!sh 243 243 $ fink rebuild python24 244 244 }}} … … 248 248 If using the Fink packages python24, trac-py24 and clearsilver-py24 you may get the error: 249 249 250 {{{ 251 252 }}} 253 254 when using trac-admin or viewing through a web browser , this is because the Fink clearsilver-py24 package does not appear to include its python bindingsso do a manual make of Clearsilver from the corresponding source version to the fink version, then copy the python binding to the python lib:255 256 {{{ 250 {{{#!sh 251 No module named neo_cgi 252 }}} 253 254 when using trac-admin or viewing through a web browser. This is because the Fink clearsilver-py24 package does not appear to include its python bindings, so do a manual make of Clearsilver from the corresponding source version to the fink version, then copy the python binding to the python lib: 255 256 {{{#!sh 257 257 $ cd <source dir>/python 258 258 $ sudo cp neo_cgi.so /sw/lib/python2.4/site-packages/ … … 279 279 Here is the Trac configuration from my httpd.conf: 280 280 281 {{{ 281 {{{#!apache 282 282 <VirtualHost *> 283 283 ServerName projects.<domain>.com … … 307 307 == Setting up tracd as a launchd service 308 308 309 If you use tracd to locally serve trac projects under Mac OS X Tiger, you can set it up to be automatically launched by way of Tiger's launchd service. I use tracd instead of Apache because I'm only serving Trac to myself and I don't want to modify Apache configurations. See TracOnOsxTracdAsLaunchdService for a recipe of how to set this up.309 If you use tracd to locally serve Trac projects under Mac OS X Tiger, you can set it up to be automatically launched by way of Tiger's launchd service. I use tracd instead of Apache because I'm only serving Trac to myself and I don't want to modify Apache configurations. See TracOnOsxTracdAsLaunchdService for a recipe of how to set this up.