| 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 store it's data in a sqlite database. |
| 6 | |
| 7 | == Dependencies == |
| 8 | |
| 9 | The following dependencies have to be installed: |
| 10 | |
| 11 | * [http://www.python.org/ Python], version >= 2.1. |
| 12 | * [http://subversion.tigris.org/ subversion], version >= 0.37. |
| 13 | * [http://pysqlite.sf.net/ pysqlite], version >= 0.4.3 (>= 0.5 for better performance) |
| 14 | * [http://clearsilver.net/ ClearSilver], version >= 0.9.3 |
| 15 | * A CGI-capable web server (only tested with Apache) |
| 16 | |
| 17 | == Installing Trac == |
| 18 | {{{ |
| 19 | $ python ./setup.py install |
| 20 | }}} |
| 21 | |
| 22 | This will byte-compile the python source code and install it in the {{{site-packages}}} directory |
| 23 | of your python installation. The directories {{{templates}}}, {{{htdocs}}} and {{{wiki-default}}} |
| 24 | will be copied into $prefix/share/trac/ . |
| 25 | |
| 26 | == Initializing the database == |
| 27 | |
| 28 | Trac stores wiki pages, tickets and other information in a sqlite database. |
| 29 | Sqlite databases are just ordinary files on the hard drive, no database server |
| 30 | is required. |
| 31 | |
| 32 | A new trac database can be created like this: |
| 33 | |
| 34 | {{{ |
| 35 | $ trac-admin /path/to/mydatabase.db initdb |
| 36 | }}} |
| 37 | |
| 38 | NOTE: The database file have to be located in a directory where the web server |
| 39 | user has write permission to both the file and the directory. |
| 40 | |
| 41 | {{{[wiki:TracAdmin trac-admin]}}} will ask you where your subversion repository is located and |
| 42 | where it can find the trac templates directory (the default value should be fine). |
| 43 | |
| 44 | == Configuring Apache == |
| 45 | |
| 46 | copy (or symlink) "{{{trac/cgi-bin/trac.cgi}}}" to |
| 47 | you web servers {{{/cgi-bin/}}} directory. Of course you can configure apache |
| 48 | to use the "{{{trac/cgi-bin/}}}" directory directly if you like. |
| 49 | |
| 50 | Finally adjust the filenames and add this config snippet to your web server: |
| 51 | |
| 52 | {{{ |
| 53 | Alias /trac/ "/where/you/put/trac/htdocs/" |
| 54 | # Trac need to know where the database is located |
| 55 | <Location "/cgi-bin/trac.cgi"> |
| 56 | SetEnv TRAC_DB "/somewhere/myproject.db" |
| 57 | </Location> |
| 58 | |
| 59 | # You need this to allow users to authenticate |
| 60 | <Location "/cgi-bin/trac.cgi/login"> |
| 61 | AuthType Basic |
| 62 | AuthName "trac" |
| 63 | AuthUserFile /somewhere/trac.htpasswd |
| 64 | Require valid-user |
| 65 | </location> |
| 66 | }}} |
| 67 | |
| 68 | == What next? == |
| 69 | |
| 70 | You should now have a working Trac installation at: |
| 71 | |
| 72 | http://<yourhostname>/cgi-bin/trac.cgi |
| 73 | |
| 74 | There you should be able to browse your subversion repository, create tickets, |
| 75 | view the timeline etc. Keep in mind that anonymous users (before logging in) |
| 76 | are only able to see/use a subset of all the features provided by Trac. |
| 77 | Please read TracPermissions on how to grant additional privileges to authenticated users. |
| 78 | |
| 79 | Enjoy! |
| 80 | |
| 81 | |
| 82 | See also: TracGuide, TracOnNetBsd, TracOnOsx |