wiki:TestManagerForTracPluginQuickSetup

Version 10 (modified by seccanj, 7 months ago) (diff)

--

Quick startup guide for Linux

This guide will help you setup a quick and dirty environment with Apache, modwsgi and the Test Manager plugin in a few minutes. Security is based on Apache password file, with basic authentication.

Run every command as root. The example takes into account a freshly installed Debian:

  1. Download python setup tools from PyPi.
  2. Compile and install it:
    tar xvzf setuptools-0.6c11.tar.gz 
    cd setuptools-0.6c11/
    python setup.py install
    
  3. Install Trac 0.12.2 using the now available easy_install:
    easy_install Trac
    
  4. Create the needed directories to host the foo project:
    mkdir -p /var/lib/trac
    
  5. Create a foo trac project environment:
    trac-admin /var/lib/trac/foo initenv
    
  6. Create a password file for apache authentication, for example with an "admin" and a "roberto" users:
    htpasswd -c /var/lib/trac/foo/conf/passwd admin
    htpasswd /var/lib/trac/foo/conf/passwd roberto
    
  7. Grant the anonymous user TRAC_ADMIN permissions:
    trac-admin /var/lib/trac/foo permission add anonymous TRAC_ADMIN
    
  8. Run trac through tracd just to see everything worked:
    tracd -r --port 8000 /var/lib/trac/foo
    
  9. Set trace level to DEBUG in trac, and log to file, using the admin panel. The admin panel can be accessed from Trac's navigation bar.
    localhost:8000/foo/admin
    
  10. Configure apache and wsgi as follows:


'Snippet into apache2.conf:'

        WSGIScriptAlias /trac /var/lib/trac/foo/trac.wsgi
        <Directory /var/lib/trac/foo/apache>
                WSGIApplicationGroup %{GLOBAL}
                Order deny,allow
                Allow from all
        </Directory>
        <Location /trac>
                AuthType Basic
                AuthName "trac"
                AuthUserFile /var/lib/trac/foo/conf/passwd
                Require valid-user
        </Location>


'/var/lib/trac/foo/trac.wsgi:'

import os

os.environ['TRAC_ENV'] = '/var/lib/trac/foo'
os.environ['PYTHON_EGG_CACHE'] = '/var/lib/trac/foo/eggs'

import trac.web.main
application = trac.web.main.dispatch_request


  1. Grant everyone 777 on /var/lib/trac:
    chmod -R 777 /var/lib/trac
    
  2. (Re-)start apache:
    /etc/init.d/apache2 restart
    
  3. Verify trac was up and running, with basic authentication working, using the browser.
  4. Download the egg files for the TestManagerForTracPlugin from sourceforge and extract the archive:
    sourceforge.net/projects/testman4trac/files/
    
  5. Open your browser to the foo trac project, on the admin panel http://localhost/trac/foo/admin, and install TracGenericClassPlugin from the first egg file. Note: the order in which you install the plugins is important.
  6. Install the TracGenericWorkflowPlugin the same way. This asks for a database upgrade.
  7. To do it, open a command console as root and fire the command displayed in the browser. It should be something like the following:
    trac-admin /var/lib/trac/foo upgrade
    
  8. Restart apache, just to be sure its cache is updated:
    /etc/init.d/apache2 restart
    
  9. Refresh your browser (F5). The trac admin page should show the new plugin in place.
  10. Install TestManagerForTracPlugin the same way. This asks for another database upgrade.
  11. From the same command console, as root, fire again the same command as before. The also issue the command to update the documentation, which is displayed at the end of the database update. They should look like the following:
    trac-admin /var/lib/trac/foo upgrade
    trac-admin /var/lib/trac/foo wiki upgrade
    
  12. Restart apache. This time is actually required:
    /etc/init.d/apache2 restart
    
  13. Refresh your browser. The trac admin page should show the three installed plugins.
  14. Click on the Test Manager tab in Trac's top navigation bar to start using the new plugin.

Quick startup guide for Windows

  1. Install Linux
  2. Follow the Quick startup guide for Linux