Edgewall Software

Changes between Version 82 and Version 83 of TracOnUbuntu


Ignore:
Timestamp:
Sep 30, 2011, 4:41:54 AM (13 years ago)
Author:
anonymous
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • TracOnUbuntu

    v82 v83  
    11= Trac on Ubuntu =
     2[[PageOutline]]
     3= Installing Trac on Ubuntu
     4This is a short recipe to install and configure virtual `Apache2` host with `Trac`
     5== What are Ubuntu packages needed
     6Typical procedure to install Trac under Ubuntu with its default dependencies (default - choosed by apt) is
     7{{{#!sh
     8apt-get install python python-babel
     9apt-get install trac
     10}}}
     11Ensure that python version matches Trac latest, otherwise apt will install older Trac version which matches your old python package installed. Also take into account that `python-babel` should be always installed before `trac` if you wish to see it internationalized.
     12=== Upgrade python packages
     13Ubuntu pre-packaged python resources are not always newest, and you may consider to upgrade them with `easy_install` or `pip`
     14- Upgrade with `easy_install`
     15{{{#!sh
     16easy_install Babel
     17easy_install Trac
     18}}}
     19- Upgrade with `pip` (another python installer, namely `python-pip`)
     20{{{#!sh
     21apt-get install python-pip
     22pip install --upgrade Babel
     23pip install --upgrade Trac
     24}}}
     25== Configuring virtual host
     26Here is shown sample virtual host configuration running under `apache2` (one file) with minimal, "entry level" settings.
     27Config file created at `apache2` known place for site configs (see below), and then configured site can be "enabled" to run.
    228
     29The following considerations used within this config, yours may vary, so adjust them below appropriately at your own
     30- `trac.local` is a hostname of virtual host
     31- `/var/local/trac` is a directory (Trac project) at that host
     32- `/var/local/trac/.htpasswd` is a password file created with `htpasswd` utility
     33- `ru_RU.UTF8` is a locale ident
     34=== Prepare configuration
     35First you need to
     36- create directory for Trac project and change its access permissions to that under which `apache2` runs (`www-data` in most cases)
     37- initialize `Trac` environment within that directory
     38- create `apache2` htpasswd entry for authorized web user access within this directory
     39- add to Trac this authorized web user with administartive privileges over Trac
     40{{{#!sh
     41mkir -p /var/local/trac && chown www-data: /var/local/trac
     42htpasswd -c /var/local/trac/.htpasswd adminusername
     43trac-admin /var/local/trac initenv
     44trac-admin /var/local/trac permission add adminusername TRAC_ADMIN
     45}}}
     46Create config file with any text editor (`vi` in this example):
     47{{{#!sh
     48vi /etc/apache2/sites-available/trac
     49}}}
     50Enter the following copy-paste into this file:
     51{{{#!text/html
     52<VirtualHost *:80>
     53        ServerName trac.local
     54        <Location />
     55           SetHandler mod_python
     56           PythonInterpreter main_interpreter
     57           PythonHandler trac.web.modpython_frontend
     58           PythonOption TracEnv /var/local/trac
     59           PythonOption TracEnvParentDir /var/local/trac
     60           PythonOption TracUriRoot /
     61           PythonOption TracEnv /var/local/trac
     62            # PythonOption TracEnvIndexTemplate /var/local/trac/templates/index-template.html
     63           PythonOption TracLocale ru_RU.UTF8
     64           PythonOption PYTHON_EGG_CACHE /tmp
     65           Order allow,deny
     66           Allow from all
     67        </Location>
     68        <Location /login>
     69          AuthType Basic
     70          AuthName "myproject"
     71          AuthUserFile /var/local/trac/.htpasswd
     72          Require valid-user
     73        </Location>
     74</VirtualHost>
     75}}}
     76=== Enable prepared configuration
     77{{{#!sh
     78a2enmod python
     79a2ensite trac
     80service apache restart
     81}}}
     82= done.
    383{{{
    484#!div class=important