I am trying to create a trac installation on my private server in order to use it for project management. I followed the instructions for installation and connecting to the apache server that can be found at the official trac installation guide but when I try to access trac I get error 404. When I disable ScriptAlias, I get 403 Access Denied. Here are the details:

My setup is like that: ArchLinux i686 running in headless mode (I connect to it via ssh) and connected wirelessly to my home network's router. I chose to connect trac and apache with FastCGI

A trac user to contain everything trac related.

$ sudo ls /home/trac
cgi-bin  env  htdocs

env is where the projects are located cgi-bin and htdocs were generated with the trac-admin $TARGET $DESTINATION deploy command.

A httpd user to contain the DocumentRoot for the apache server:

$ sudo ls /home/httpd
ftp  http

I gave ownership to everythin in /home/trac, recursively, to httpd and the http group (insecure, I know, but I wanted to test it out first in the simplest way possible):

sudo chown -R http.httpd /home/trac

I made the following modifications to httpd.conf:


LoadModule fcgid_module modules/mod_fcgid.so


User httpd
Group http

Changed DocumentRoot to this everywhere:

DocumentRoot "/home/httpd/http"

And finally I enabled virtual hosts:

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

Here is the httpd-vhosts.conf:

<VirtualHost *:80>
ServerAdmin myemail@email.com
DocumentRoot "/home/trac/"
ServerName SERVER_IP
ErrorLog "/var/log/httpd/trac.error.log"
CustomLog "/var/log/httpd/trac.access.log" combined

<Location />
    Order deny,allow
    Deny from all
    Allow from
<Location /env>
    Order deny,allow
    Allow from all
    AuthName "Trac Projects"
    AuthType Basic
    AuthUserFile /home/trac/.htpasswd
    Satisfy Any
    Require valid-user
ScriptAlias /env /home/trac/cgi-bin/trac.fcgi

Note that I have made the trac.fcgi owned by http as well as explicitly set the permissions ot make it executable.

When ScriptAlias is commented, I get 403 Access Denied for the root, SERVER_IP, as well as SERVER_IP/env or any other directory in the path. When the line is not commented, I get 403 Access Denied for the root and 404 Object Not Found for everything else.

The sources that I used to arrive at this point are first the tracinstall guide and then the outdated arch linux install guide when the first one did not work (produced the same results that I am describing, only I was able to arrive at the dummy page in the DocumentRoot, and even with the script alias enabled the SERVER_IP/env was Access Denied 403). Here is the httpd.conf as it is way too big to post here: httpd.conf

I think that this is a permission problem but my because of my limited experience with apache I cannot seem to reach a solution.

Thanks in advance.

P.S. Since I am controlling the whole thing through ssh, logged in as a different user, I had to give httpd ownership of its http and ftp directories after I created them. I am not sure if this matters though.


1 Answer 1


Note, there is a dedicated FastCGI setup wiki page linked in the generic installation guide. Note too, that wsgi is the recommended setup for Trac these days.

But if you want it for private use only, I doubt seriously, that this is all worth the hassle. It might be educational, right, but I bet that the standalone setup with tracd will bring you up and running Trac itself in a few minutes.

Related to access/authentication, you should have at least one user in your /home/trac/.htpasswd, and the same user (prefer lower-case, no fancy stuff like spaces, etc.) must be registered in Trac and given appropriate permission. For the start you should add the first user as Trac admin using trac-admin like

$> trac-admin /home/trac permission add <username> TRAC_ADMIN

Replace username with your choice and as usual you should have at least another user with regular permission (after login permissions of the authenticated group apply).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy