Trac
From Gentoo Linux Wiki
| Please format this article according to the Style Guidelines and Wikification suggestions, then remove this notice {{Wikify}} from the article.
Reason(s):
|
Contents |
[edit] Introduction
To use the Trac not only as a wiki you need a running svn repository.
[edit] Installation
[edit] Preconditions
You need to have the following packages installed.
[edit] Trac
To install the www-apps/trac package you have to execute the command below as root.
[edit] Configuration
[edit] Create Environment
First you need to initiate a trac environment with the trac-admin tool.
Now you follow the instructions.
[edit] Backends
[edit] sqlite
| Code: trac-admin /var/lib/trac/my_trac initenv |
|
sqlite:db/trac.db |
sqlite - database type
db/trac.db - relative path to the database of our trac environment
Set the read and write permission for the sqlite db to the apache user.
[edit] postgres
Create a user who is allowed to create schemas in a database.
Create the database where the user above is allowed to create schemas and tables
Now you can initiate the trac environment.
Connection string
| Code: trac-admin /var/lib/trac/my_trac initenv |
|
postgres://user:pass@localhost:5432/dbname?schema=schemaname |
or (Unix Socket)
| Code: trac-admin /var/lib/trac/my_trac initenv |
|
postgres://user:pass@/dbname?host=/path/to/unix/socket/dir&schema=schemaname |
[edit] mysql (unstable)
Connection string
| Code: trac-admin /var/lib/trac/my_trac initenv |
|
mysql://dbuser:dbpass@host:port/dbname |
or (Unix Socket)
| Code: trac-admin /var/lib/trac/my_trac initenv |
|
mysql://user:pass@/dbname?host=/path/to/unix/socket |
Create the database
[edit] Single Project
[edit] mod_python
[edit] default host
<LocationMatch "/trac">
SetEnv PYTHON_EGG_CACHE /var/lib/trac/egg-cache
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /var/lib/trac/
PythonOption TracUriRoot /trac/
</LocationMatch>
<LocationMatch "/trac/[^/]+/login">
AuthType Basic
AuthName "Trac Server"
AuthUserFile /var/svn/conf/svnusers
Require valid-user
</LocationMatch>
[edit] vhost
<LocationMatch "/">
SetEnv PYTHON_EGG_CACHE /var/lib/trac/egg-cache
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /var/lib/trac/
PythonOption TracUriRoot /
</LocationMatch>
<LocationMatch "/[^/]+/login">
AuthType Basic
AuthName "Trac Server"
AuthUserFile /var/svn/conf/svnusers
Require valid-user
</LocationMatch>
[edit] cgi/fastcgi
[edit] default host
[edit] vhost
[edit] Multiple Projects
[edit] mod_python
[edit] default host
<LocationMatch "/trac">
SetEnv PYTHON_EGG_CACHE /var/lib/trac/egg-cache
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /var/lib/trac/
PythonOption TracUriRoot /trac/
</LocationMatch>
<LocationMatch "/trac/[^/]+/login">
AuthType Basic
AuthName "Trac Server"
AuthUserFile /var/svn/conf/svnusers
Require valid-user
</LocationMatch>
[edit] vhost
<LocationMatch "/">
SetEnv PYTHON_EGG_CACHE /var/lib/trac/egg-cache
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /var/lib/trac
PythonOption TracUriRoot /
</LocationMatch>
<LocationMatch "/[^/]+/login">
AuthType Basic
AuthName "Trac Server"
AuthUserFile /var/svn/conf/svnusers
Require valid-user
</LocationMatch>
[edit] cgi/fastcgi
[edit] default host
[edit] vhost
[edit] Permissions
For the Authorization we use the AuthBasic from Apache here. You can use other methods, too.
At first you need to create the "svnusers" passwd file for the apache.
Now you have to change the permissions for the file /var/svn/conf/svnusers.
Now you need to give one or more of your created users admin permission. This you must do it for every trac environment.
At this point you are able to configure the rest with the TRAC_ADMIN Account over the webinterface of trac.
[edit] Recommend Trac Plugins/Macros
[edit] Recent Links
Originally written by: J0inty - 20.11.2008
