Edgewall Software

Changes between Version 60 and Version 61 of TracOnOsx


Ignore:
Timestamp:
Oct 26, 2015, 7:55:20 PM (8 years ago)
Author:
figaro
Comment:

Cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • TracOnOsx

    v60 v61  
    1818'''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.
    1919
    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
    2222$ mv trac.db trac2.db
    2323$ sqlite trac2.db .dump | sqlite3 trac.db
     
    2828Start by making sure your Fink base system is the most current:
    2929
    30 {{{
     30{{{#!sh
    3131$ fink selfupdate
    3232}}}
    3333
    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'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
     36When 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.
    3737
    3838=== Installing SQLite
     
    4040You can install SQLite this way:
    4141
    42 {{{
     42{{{#!sh
    4343$ fink install sqlite3 sqlite3-dev
    4444}}}
     
    5454Assuming you want Subversion to support secure connections, install it this way (for Mac OS X 10.4):
    5555
    56 {{{
     56{{{#!sh
    5757$ fink install svn svn-client svn-swig-py24
    5858}}}
     
    6262'''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:
    6363
    64 {{{
     64{{{#!sh
    6565$ fink install svn-ssl svn-client-ssl svn-ssl-swig-py24
    6666}}}
     
    7070Now is a good time to have Fink update the rest of its installed packages:
    7171
    72 {{{
     72{{{#!sh
    7373$ fink update-all
    7474}}}
     
    7878It 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:
    7979
    80 {{{
     80{{{#!sh
    8181$ fink install trac-py24
    8282}}}
     
    9292To initialize a Trac environment at {{{/path/to/projectenv}}} run the following commands, trac-admin will ask for an existing Subversion repository:
    9393
    94 {{{
     94{{{#!sh
    9595$ trac-admin /path/to/projectenv initenv
    9696$ sudo chown -R www /path/to/projectenv
     
    9999'''Note:''' Remember to set appropriate permissions for your Subversion repository. (which are? Maybe someone could expand on this?)
    100100
    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.
     101The 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.
    102102
    103103Open the Apache configuration file located in {{{/sw/etc/apache2/sites-enabled/}}} (for 10.4) or {{{/etc/httpd/httpd.conf}}} (for 10.3) for editing:
    104104
    105 {{{
     105{{{#!sh
    106106$ sudo nano -w /sw/etc/apache2/sites-enabled/000-default
    107107}}}
     
    109109Add the following to have Trac appear at {{{yourdomain.tld/webpath}}} (with TracPrettyUrls) and change {{{/path/to/projectenv}}} to your particular setup:
    110110
    111 {{{
    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
     111{{{#!apache
     112Alias /trac/ /sw/share/trac/htdocs/
     113
     114RewriteEngine 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
     134SetEnv TRAC_ENV "/path/to/projectenv/"
     135ScriptAliasMatch ^/webpath(.*) /sw/share/trac/cgi-bin/trac.cgi$1
    136136}}}
    137137
    138138Check that the mod_env is enabled in your config. By default, the config is commented out. This is what you are looking for:
    139139
    140 {{{
     140{{{#!apache
    141141LoadModule env_module         libexec/httpd/mod_env.so
    142142AddModule mod_env.c
     
    145145Now check if Apache is started, and possibly reload the configuration files:
    146146
    147 {{{
     147{{{#!sh
    148148$ sudo /sw/sbin/apache2ctl graceful
    149149}}}
     
    157157Download [http://www.clearsilver.net/ Clearsilver] version 0.9.12. Compile it with Python support and install it in the Fink prefix:
    158158
    159 {{{
     159{{{#!sh
    160160$ ./configure --prefix=/sw --with-python=/sw/bin/python2.4 --disable-ruby
    161161$ make install
     
    169169The 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:
    170170
    171 {{{
     171{{{#!sh
    172172elif sys.platform == "darwin":
    173173    include_dirs = ['/sw/include/']
     
    181181After that modification the installation should be:
    182182
    183 {{{
     183{{{#!sh
    184184$ /sw/bin/python2.4 ./setup.py install
    185185}}}
     
    189189You 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:
    190190
    191 {{{
     191{{{#!sh
    192192export PYTHONPATH=/usr/local/lib/svn-python/
    193193}}}
     
    195195and in your Apache configuration:
    196196
    197 {{{
     197{{{#!apache
    198198<Location "/cgi-bin/trac.cgi">
    199199   SetEnv PYTHONPATH "/usr/local/lib/svn-python/"
     
    203203An alternative to setting PYTHONPATH is to execute the following from the shell once:
    204204
    205 {{{
     205{{{#!sh
    206206echo /usr/local/lib/svn-python/ > /sw/lib/python2.4/SVN.pth
    207207}}}
     
    214214  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:
    215215
    216 {{{
     216{{{#!sh
    217217/sw/lib/python2.4/site-packages
    218218}}}
     
    225225If 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/}}}:
    226226
    227 {{{
    228 #! /bin/sh
     227{{{#!sh
     228#!/bin/sh
    229229/sw/bin/python2.4 /somewhere/cgi-bin/trac.cgi
    230230}}}
     
    234234Update your python23 installation if you still need this fix:
    235235
    236 {{{
     236{{{#!sh
    237237$ fink install python24
    238238}}}
     
    240240or:
    241241
    242 {{{
     242{{{#!sh
    243243$ fink rebuild python24
    244244}}}
     
    248248If using the Fink packages python24, trac-py24 and clearsilver-py24 you may get the error:
    249249
    250 {{{
    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 {{{
     250{{{#!sh
     251No module named neo_cgi
     252}}}
     253
     254when 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
    257257$ cd <source dir>/python
    258258$ sudo cp neo_cgi.so /sw/lib/python2.4/site-packages/
     
    279279Here is the Trac configuration from my httpd.conf:
    280280
    281 {{{
     281{{{#!apache
    282282<VirtualHost *>
    283283        ServerName projects.<domain>.com
     
    307307== Setting up tracd as a launchd service
    308308
    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.
     309If 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.