Recently had some serious trouble running Trac on Apache2 with mod_fcgid. An included Doxygen page spent hours loading and the Apache error log contained lines like this:

[Sat Apr 21 21:38:26 2012] [warn] [client 88.65.186.160] mod_fcgid: can't apply process slot for /home/webX/trac/htdocs/favicon.ico
[Sat Apr 21 21:42:01 2012] [warn] [client 66.249.66.247] mod_fcgid: read data timeout in 40 seconds
[Sat Apr 21 21:42:01 2012] [error] [client 66.249.66.247] Premature end of script headers: trac.fcgi

The cause I finally discovered was that I had mixed up several ways of running Trac (mod_python, mod_fastcgi, mod_fcgid) while testing performance, so the lines in my Trac vhost looked like this (including the disabled lines):

<VirtualHost x.y.z.w:80>
    ServerName domain.org
    ServerAlias www.domain.org

    DocumentRoot /home/webX/trac/htdocs
    Alias /chrom/common /usr/share/pyshared/trac/htdocs
    Alias /chrome/site /home/webX/trac/htdocs
    Alias /favicon.ico /home/webX/trac/htdocs/favicon.ico

    <Directory "/usr/share/pyshared/trac/htdocs">
        Order allow,deny
        Allow from all
    </Directory>
    <Directory /home/webX/trac/htdocs>
        Order allow,deny
        Allow from all
    </Directory>

    ScriptAlias / /home/webX/trac/fcgi/trac.fcgi/
#   <Location />
#       SetHandler fcgid-script
#       Options ExecCGI
#       Allow from all
#   </Location>

    <Location "/login">
        AuthType Basic
        AuthName "Trac"
        AuthUserFile "/home/webX/trac/passwd.htaccess"
        Require valid-user
    </Location>

    CustomLog /var/log/apache2/domain.org.access.log combined
    ErrorLog /var/log/apache2/domain.org.error.log
</VirtualHost>

Removed the superfluous <Location> - Block and trouble was gone :)