十二月 17, 2006 於 午後 2:10
· 歸檔於 Trac, ubuntu
Prerequisites
Installation
- Install Package
$ sudo apt-get install trac
- Create the Trac Environments Directory
$ sudo mkdir /home/trac
$ sudo chown www-data:www-data /home/trac
- Setup Apache2
<VirtualHost servername:443>
ServerName servername
ServerAdmin admin@servername
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem
DocumentRoot /var/www/trac
<Directory />
Options None
AllowOverride None
allow from all
</Directory>
# Trac settings
<Directory "/var/www/trac">
Options +FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/trac/projects">
AllowOverride None
Options ExecCGI -MultiViews +FollowSymLinks
AddHandler cgi-script .cgi
Order allow,deny
Allow from all
</Directory>
# for multiple projects
RewriteEngine on
RewriteRule ^/projects/+$ /projects/index.html [L]
RewriteCond /home/trac/$1 -d
RewriteRule ^/projects/([[:alnum:]_]+)(/?.*) /projects/trac.c
gi$2 [S=1,E=TRAC_ENV:/home/trac/$1]
RewriteRule ^/projects/(.*) /projects/index.html
# You need this to allow users to authenticate
# trac.htpasswd can be created with
# cmd 'htpasswd -c trac.htpasswd' (UNIX)
# do 'man htpasswd' to see all the options
<LocationMatch "/projects/[[:alnum:]_]+/login">
AuthType Basic
AuthName "trac"
require group dev
</locationMatch>
ErrorLog /var/log/apache2/trac_error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/trac_access.log combined
ServerSignature On
</VirtualHost>
- Setup Trac web home directory (/var/www/trac)
- index.html
- projects/
- trac.cgi -> /usr/share/trac/cgi-bin/trac.cgi
- trac -> /usr/share/trac/htdocs
- Restart Apache
$ sudo chown -R www-data /usr/share/trac
$ sudo apache2 -k restart
- Creating Environments
$ sudo mkdir /home/trac
$ sudo trac-admin /home/trac/YourProjectNameHere initenv
$ sudo chown -R www-data /home/trac/YourProjectNameHere
- The “trac-admin” command shown above prompted me to enter:
- the project name (YourProjectNameHere)
- the path to svn repository (/home/svn/YourProjectNameHere)
- the path to the Trac templates directory (/usr/share/trac/templates)
- …
- Access your project
https://servername/project/YourProjectNameHere
Reference Link:
TracOnUbuntu – The Trac Project – Trac
固定網址