1. Debugging with PhpED and DBG

    January 20, 2008 by bealers

    As long-term PhpED user I’ve always been well aware that I was not making the most of some of the more powerful features of my IDE, particularly the debugging capabilities. Well this week I finally got debugging set-up properly and as per most of my other blog posts I’m listing what I did here for future reference and just in case it helps anyone else. (more…)


  2. Multiple project Trac set-up

    January 3, 2008 by bealers

    I’ve already installed Trac and I now want to be able to set-up multiple projects with the minimum of fuss.

    My requirements are:

    • Not having to mess with the Apache configuration every time I add a new project because I don’t want to have to restart apache
    • Make some simple modifications to the stanadard trac.ini so that, for example, the logo at the top links to the home of that trac project
    • Improve upon the default authentication where logging out involves closing the browser (which is a drag when accessing multiple projects)
    • Change the default wiki page text

    The most important job is to get Apache set-up properly. I’m using mod_python so:
    apt-get install libapache2-mod-python

    I then set-up a VirtualHost for http://my.trac.url, thus:

    <VirtualHost *>
    DocumentRoot /var/www/my.trac.docroot
    ServerName my.trac.url
    ServerAdmin webmaster@my.trac.url
    LogFormat "%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\""
    TransferLog /var/log/apache2/trac-access.log
    ErrorLog /var/log/apache2/trac-error.log

    <LocationMatch "/.+/">
    SetHandler mod_python
    PythonInterpreter main_interpreter
    PythonHandler trac.web.modpython_frontend
    PythonPath "sys.path + ['/export/trac']”
    PythonOption TracEnvParentDir /export/trac
    PythonOption TracUriRoot /
    </LocationMatch>

    </VirtualHost>

    Note the LocationMatch. From the docs:

    This will instruct Apache to use mod_python for all locations different from root while having the possibility of placing a custom home page for root in your DocumentRoot folder.

    Therefore in /var/www/my.trac.docroot I’ve placed a one line PHP script that redirects users to our main website url.

    After restarting Apache I then set-up a new project ‘project1′ as per my mini Trac install how-to and visiting http://my.trac.url/project1/ gives me the vanilla Trac interface so we know it’s all working.

    The rest of the configuration is with Trac itself and is down to personal requirements and mine are already listed above. I’ve scripted everything I need to do to get a new project up and running and don’t intend to go though it all here. You can however download it and use it for your own purposes. You use this at your own risk and you should bear in mind the following cavets:

    • Assumes that the Account Manager plugin is already installed. I did easy_install http://trac-hacks.org/svn/accountmanagerplugin/trunk
    • The first user input is used as the Trac project name AND should match the name of the already set-up svn project
    • I’m using MySQL on the backend
    • A few of the trac.ini settings at the end are hard-coded though it is easy to change them

    I’m a lot more impressed with this version of Trac than the much older version we were using before and with the above set-up I can now have a project up and running within a few minutes.
    Related
    http://trac.edgewall.org/wiki/TracModPython
    http://trac-hacks.org/wiki/AccountManagerPlugin


  3. Installing Trac on Debian etch

    January 1, 2008 by bealers

    The following is a no-frills install guide for getting Trac up and running on a Debian ‘etch’ Linux system.

    The assumption is that you’ve already got mysql and subversion working and have created a subversion repository (tip: apt-get install mysql-server subversion).

    The first thing that we need to do is install Python, easy_install and the mysql & python bindings:
    apt-get install python python-setuptools python-mysqldb python-subversion

    To install trac via the easy_install command I suggest that you see what is the newest version of trac:
    svn list http://svn.edgewall.com/repos/trac/tags

    I then picked the newest tag and then installed:
    easy_install http://svn.edgewall.com/repos/trac/tags/trac-0.11b1

    I want to use the - note: experimental - MySQL support so I create a mysql db and create a trac user:

    mysql> create database trac;
    mysql> grant all on trac.* to trac@localhost identified by 'password';

    To test it is all working I create our first project:

    trac-admin /export/trac/MY_PROJECT initenv

    A number of self explanitory questions are asked, here are selected answers:

    Database connection string [sqlite:db/trac.db]> mysql://trac:password@localhost:3306/trac
    Path to repository [/path/to/repos]> /export/svn/MY_SVN_REPOSITORY

    Finally, test it is working:
    tracd --port 8000 /export/trac/MY_PROJECT

    Visiting http://server:8000/MY_PROJECT gives me the standard trac web interface and I can browse the SVN repository. There, that wasn’t too bad was it? We do still need to get it all sensibly configured so once I’ve done that I’ll post another article.

    Related:
    http://trac.edgewall.org/wiki/TracInstall


/div>