1

I have the below Apache configuration. The following services are on each port:

8022 - Apache. Testing port, in the long run it will be port 80.

8002 - XDV, a themeing proxy which sits in front of a number of other services.

8202 - Trac, Python based bug tracker, which is one of the services xdv needs to sit in front of, hence the separation.

8082 - Plone CMS. Not shown in apache. XDV proxies requests to it.

The idea is that all requests come via Apache (8022), through the xdv proxy (8002) which applies a theme to each of the content sources (8082 & 8202)

However, I've noticed that during testing, if I access the Trac site via 8202, the 8022 site errors with RuntimeError: instance.__dict__ not accessible in restricted mode and will not work again till Apache is restarted. 8202 still works regardless of if 8022 is erroring or accessed.

This seems related to this Trac bug. But I'm not using mod_python and WSGIProcessGroup and WSGIApplicationGroup are the same value.

Why is this happening Is there a better way to set-up Apache? Namely the wsgi element?

In a previous iteration of this setup was within the 8022 host, but this meant it also served from this port and avoided the proxy

<VirtualHost foo.bar.com:8022>
        ServerName foo.bar.com
        ServerAlias foo.bar.com

        ProxyRequests Off
        <Proxy *>
            Order deny,allow
            Allow from all
        </Proxy>

        ProxyPreserveHost On

        RewriteEngine On
        RewriteCond %{HTTP:Authorization} ^(.*)
        RewriteRule ^/(.*) http://0.0.0.0:8002/$1 [P]


</VirtualHost>


<VirtualHost foo.bar.com:8202>
        ServerName foo.bar.com
        ServerAlias foo.bar.com

        <Directory "/home/web/foo/parts/trac/tracwsgi/cgi-bin">
                WSGIDaemonProcess trac stack-size=524288 python-path=/usr/lib/python2.5/site-packages
                WSGIScriptAlias /trac /home/web/foo/parts/trac/tracwsgi/cgi-bin/trac.wsgi
                WSGIProcessGroup %{GLOBAL}
                WSGIApplicationGroup %{GLOBAL}
                Options +Indexes FollowSymLinks
                AllowOverride None
                Allow from all
                Order allow,deny
        </Directory>

        <Location "/trac">
                AuthBasicProvider ldap
                AuthType Basic
                AuthzLDAPAuthoritative off
                AuthName "Login"
                AuthLDAPURL "ldap://127.0.0.1:389/dc=foo-bar,dc=org?uid"
                AuthLDAPBindDN "cn=admin, dc=foo-bar, dc=org"
                AuthLDAPBindPassword secretword
                require valid-user
        </Location>

</VirtualHost>

1 Answer 1

3

To start with, you should have:

WSGIProcessGroup trac

and not %{GLOBAL} as you have.

The way you have it, still running in embedded mode and some other Apache module, or embedded WSGI application could be interfering.

2
  • Meh. Coulda sworn I had it that way previously! Just changed back, got an Apache error regarding WSGIDaemonProcess location. Moved the whole block our and put between the two Virtual hosts and it seems fine. Will mark as chosen answer when it's been stable a few hours....
    – Jon Hadley
    Sep 14, 2010 at 9:43
  • You only needed to move WSGIDaemonProcess out and inside of VirtualHost would have been fine. Didn't notice it was in the Directory when it shouldn't have been. Sep 14, 2010 at 21:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .