Project management: Trac

Table of Contents

Configuration
CGI script of Apache
Add repository

CGI script of Apache

by ross at 17:45:36 on January 13, 2012

(Re)install Apache with suEXEC enabled

# cd /usr/ports/www/apache22
# make config
  • Check SUEXEC

Add to /etc/make.conf:

.if ${.CURDIR:M*/www/apache22}
SUEXEC_DOCROOT=/
.endif

If Apache is already installed:

# make build deinstall reinstall clean

Otherwise:

# make install clean

Prepare webroot

Init /home/trac/projectname as shown on previous page.

# mkdir /home/www/projectname.example.com
# mkdir /home/www/projectname.example.com/logs
# trac-admin /home/trac/projectname deploy /home/www/projectname.example.com

# cd /home/www/projectname.example.com
# chmod a+x cgi-bin/*
# htpasswd -c .htpasswd admin
# htpasswd .htpasswd user1
# htpasswd .htpasswd user2
# htpasswd .htpasswd user3
# chmod 640 .htpasswd

# chown -R projectname:projectname /home/www/projectname.example.com
# chgrp www /home/www/projectname.example.com/.htpasswd

Virtual host

<VirtualHost *:80>
        ServerName projectname.example.com
        ServerAdmin root@example.com
        DocumentRoot /home/www/projectname.example.com/htdocs
        Alias /chrome/common /home/www/projectname.example.com/htdocs/common
        Alias /chrome/site /home/www/projectname.example.com/htdocs/site
        ScriptAlias / /home/www/projectname.example.com/cgi-bin/trac.cgi/

        ErrorLog "/home/www/projectname.example.com/logs/projectname.example.com-error.log"
        CustomLog "/home/www/projectname.example.com/logs/projectname.example.com-access.log" combined

        SuexecUserGroup projectname projectname

        <Location "/login">
                AuthType Basic
                AuthName "Project Name"
                AuthUserFile /home/www/projectname.example.com/.htpasswd
                Require valid-user
        </Location>
</VirtualHost>

<Directory "/home/www/projectname.example.com/htdocs">
        Options Indexes MultiViews
        AllowOverride None
        Order Allow,Deny
        Allow from all
</Directory>
<Directory "/home/www/projectname.example.com/cgi-bin">
        Options ExecCGI
        AllowOverride None
        Order Allow,Deny
        Allow from all
</Directory>
# service apache22 restart

Navigate to http://projectname.example.com

Comments