Hi all,

I recently decided to try to switch from tracd to an apache-powered 
fast-cgi solution to try to get https-support. I started with an attempt at 
wsgi but left when I ran into a problem that I think was related to a 
Python-version mis-match between wsgi and Trac. My setup is a Synology NAS 
(basically unix).

I created a new project at /trac/, which I can successfully host with 
tracd. I generated the steps to create the necessary .cgi, .fcgi and 
.wsgi-files as described here <http://trac.edgewall.org/wiki/TracCgi>. I 
can run the .fcgi-file through Python and it returns a bunch of HTML-code 
that I think looks good. However, when I try to get Apache to serve the 
.fcgi I get the following output in my browser.

Oops...

Trac detected an internal error:

[Errno 22] Invalid argument

Traceback (most recent call last):
  File "/trac/cgi-bin/trac.fcgi", line 32, in <module>
    fcgi_frontend.run()
  File 
"/opt/local/lib/python2.7/site-packages/Trac-1.0.1-py2.7.egg/trac/web/fcgi_frontend.py",
 line 53, in run
    WSGIServer(dispatch_request, **params).run()
  File 
"/opt/local/lib/python2.7/site-packages/Trac-1.0.1-py2.7.egg/trac/web/_fcgi.py",
 line 1081, in run
    clientSock, addr = sock.accept()
error: [Errno 22] Invalid argument


I'm a beginner with Apache and fcgi, but I think I'm beginning to get the 
hang off it
The Apache log says nothing. Were do I start? I suspect I'm missing 
something major. Can it be a version mis-match here as well?

Cheers


I have the following configuration in Apache

<IfModule mod_fastcgi.c>
        AddHandler fastcgi-script .fcgi
        #FastCgiIpcDir /var/lib/apache2/fastcgi
</IfModule>
LoadModule fastcgi_module /opt/libexec/mod_fastcgi.so

<VirtualHost *:8010>

        ServerName www.example.com
        ServerAlias example.com
        ServerAdmin [email protected]

        DocumentRoot /trac

        <Directory /trac>
                Order allow,deny
                Allow from all
        </Directory>

        ScriptAlias /trac /trac/cgi-bin/trac.fcgi/
        #DefaultInitEnv TRAC_ENV /path/to/env/trac/

        <Directory /trac>
                SetEnv trac.env_path /trac
                Order allow,deny
                Allow from all
        </Directory>

</VirtualHost>

The .fcgi-file reads

#!/opt/bin/python2.7
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2004 Jonas Borgström <[email protected]>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists of voluntary contributions made by many
# individuals. For the exact contribution history, see the revision
# history and logs, available at http://trac.edgewall.org/log/.
#
# Author: Jonas Borgström <[email protected]>

try:
    import os
    import pkg_resources
    if 'TRAC_ENV' not in os.environ and \
       'TRAC_ENV_PARENT_DIR' not in os.environ:
        os.environ['TRAC_ENV'] = '/volume1/trac/projects/test-project'
    if 'PYTHON_EGG_CACHE' not in os.environ:
        if 'TRAC_ENV' in os.environ:
            egg_cache = os.path.join(os.environ['TRAC_ENV'], '.egg-cache')
        elif 'TRAC_ENV_PARENT_DIR' in os.environ:
            egg_cache = os.path.join(os.environ['TRAC_ENV_PARENT_DIR'],
                                     '.egg-cache')
        pkg_resources.set_extraction_path(egg_cache)
    from trac.web import fcgi_frontend
    fcgi_frontend.run()
except SystemExit:
    raise
except Exception, e:
    print 'Content-Type: text/plain\r\n\r\n',
    print 'Oops...'
    print
    print 'Trac detected an internal error:'
    print
    print e
    print
    import traceback
    import StringIO
    tb = StringIO.StringIO()
    traceback.print_exc(file=tb)
    print tb.getvalue()

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to