| 1 | = Trac Installation Guide = |
| 2 | |
| 3 | The Trac web-based project management tool is implemented as a server |
| 4 | side cgi-program. Trac is written in the Python programming language |
| 5 | and uses SQLite as an embedded database. For HTML rendering, Trac uses the Clearsilver template system. |
| 6 | |
| 7 | |
| 8 | == Requirements == |
| 9 | |
| 10 | To install Trac, the following software packages must be installed: |
| 11 | |
| 12 | * [http://www.python.org/ Python], version >= 2.1. |
| 13 | * Please keep in mind, that for RPM-based systems you will also need python-devel and python-xml packages. |
| 14 | * [http://subversion.tigris.org/ Subversion], version >= 0.37. (>=1.0.1 recommended) |
| 15 | * [http://subversion.tigris.org/ Subversion Python bindings]. |
| 16 | * [http://pysqlite.sf.net/ PySQLite], version >= 0.4.3 (>= 0.5 for better performance) |
| 17 | * [http://clearsilver.net/ Clearsilver], version >= 0.9.3 |
| 18 | * A CGI-capable web server (we QA-test on [http://httpd.apache.org/ Apache2] ) |
| 19 | |
| 20 | == Installing Trac == |
| 21 | {{{ |
| 22 | $ python ./setup.py install |
| 23 | }}} |
| 24 | |
| 25 | This will byte-compile the python source code and install it in the {{{site-packages}}} directory |
| 26 | of your python installation. The directories {{{cgi-bin}}}, {{{templates}}}, {{{htdocs}}} and {{{wiki-default}}} are all copied to $prefix/share/trac/ . |
| 27 | |
| 28 | The script will also install the [wiki:TracAdmin trac-admin] command-line tool, used to create and maintain project |
| 29 | environments. Trac-admin is the ''command center'' of Trac. |
| 30 | |
| 31 | '''Note:''' you'll need root permissions or equivalent for this step. |
| 32 | |
| 33 | For more information on installing Trac on specific platforms, see: |
| 34 | |
| 35 | * TracOnOsx |
| 36 | * TracOnMandrakelinux |
| 37 | * TracOnGentoo |
| 38 | * TracOnFreeBsd |
| 39 | * TracOnNetBsd |
| 40 | * TracOnDebian |
| 41 | * TracOnWindows |
| 42 | * TracOnRedhat |
| 43 | |
| 44 | === Advanced Users === |
| 45 | To install Trac in a different location, and other advanced installation options, run: |
| 46 | {{{ |
| 47 | $ python ./setup.py --help |
| 48 | }}} |
| 49 | |
| 50 | == Creating a Project Environment == |
| 51 | |
| 52 | ''Trac Environment'' is the backend storage format where Trac stores |
| 53 | information like wiki pages, tickets, reports, settings, etc. |
| 54 | A Trac environment consist of a directory containing an SQLite database, |
| 55 | human-readable configuration file, log-files and attachments. |
| 56 | |
| 57 | A new Trac environment is created with {{{trac-admin}}}: |
| 58 | |
| 59 | {{{ |
| 60 | $ trac-admin /path/to/projectenv initenv |
| 61 | }}} |
| 62 | '''Note:''' The web server user need write permission to the environment |
| 63 | directory and all the files inside. |
| 64 | |
| 65 | [wiki:TracAdmin trac-admin] will ask you where your subversion repository is located and |
| 66 | where it can find the trac templates directory (the default value should be fine). |
| 67 | |
| 68 | == Configuring Apache == |
| 69 | |
| 70 | Copy (or symlink) "{{{trac/cgi-bin/trac.cgi}}}" to |
| 71 | you web servers {{{/cgi-bin/}}} directory. You can also configure apache |
| 72 | to use the "{{{trac/cgi-bin/}}}" directory directly if you like, it's a matter of taste. |
| 73 | |
| 74 | Finally edit the apache config and add this config snippet, with filenams edited to match your installation: |
| 75 | |
| 76 | {{{ |
| 77 | Alias /trac/ "/usr/share/trac/htdocs/" #or where you installed the trac docs |
| 78 | #You have to allow people to read the files in htdocs |
| 79 | <Directory "/usr/share/trac/htdocs/"> |
| 80 | Options Indexes MultiViews |
| 81 | AllowOverride None |
| 82 | Order allow,deny |
| 83 | Allow from all |
| 84 | </Directory> |
| 85 | |
| 86 | |
| 87 | # Trac need to know where the database is located |
| 88 | <Location "/cgi-bin/trac.cgi"> |
| 89 | SetEnv TRAC_ENV "/path/to/projectenv" |
| 90 | </Location> |
| 91 | |
| 92 | # You need this to allow users to authenticate |
| 93 | # trac.htpasswd can be created with |
| 94 | # cmd 'htpasswd -c trac.htpasswd' (UNIX) |
| 95 | # do 'man htpasswd' to see all the options |
| 96 | <Location "/cgi-bin/trac.cgi/login"> |
| 97 | AuthType Basic |
| 98 | AuthName "trac" |
| 99 | AuthUserFile /somewhere/trac.htpasswd |
| 100 | Require valid-user |
| 101 | </location> |
| 102 | }}} |
| 103 | |
| 104 | '''Note:''' When creating a new environment, {{{trac-admin}}} will print a config snippet customized for your project. |
| 105 | |
| 106 | == Using Trac == |
| 107 | |
| 108 | You should now have a working Trac installation at: |
| 109 | |
| 110 | http://<yourhostname>/cgi-bin/trac.cgi |
| 111 | |
| 112 | There you should be able to browse your subversion repository, create tickets, |
| 113 | view the timeline etc. Keep in mind that anonymous users (not logged in) |
| 114 | can only access a restricted subset of all Trac features. |
| 115 | |
| 116 | Please continue to TracPermissions to learn how to grant additional privileges to authenticated users. |
| 117 | |
| 118 | For further user-documentation, see TracGuide. |
| 119 | |
| 120 | ''Enjoy!'' |
| 121 | |
| 122 | ---- |
| 123 | See also: TracGuide, TracPermissions, TracOnFreeBsd, TracOnNetBsd, TracOnOsx, TracOnMandrakelinux, TracOnDebian, TracOnGentoo |