views:

80

answers:

1

Hi, I have apache vhost configured with SSL and mod_wsgi its working fine:

< VirtualHost 127.0.0.1:443 >

#[...]
SSLEngine on 
#[...]
WSGIScriptAlias / /home/maciek/workspace/imid2py/wsgihandler.py
WSGIDaemonProcess web2py user=maciek group=www-data \ 
              home=/home/maciek/workspace/imid2py/  \
              processes=10 maximum-requests=500

< Location "/" >

   #[...]
   WSGIProcessGroup web2py

< /Location >

< /VirtualHost >

However, I need to allow connections to specific url over http without ssl. So basically I want _the_same_ WSGI daemon to be visible on two virtual hosts: one with ssl, one without. I want this to be same daemon, because I use some common variables in memory. A way around is possible (ex, storing them in db) but painstaking.

< VirtualHost 127.0.0.1:80>

    <Location "/welcome/default/handleRequest">
            WSGIProcessGroup web2py  #I want this to be the same daemon as above
    </Location>

< /VirtualHost >

How can I configure wsgi/apache to do that? Is it possible?

+2  A: 

This is covered by web2py documentation in web2py book. Go read the sections of that book. See links at:

http://code.google.com/p/modwsgi/wiki/IntegrationWithWeb2Py

Graham Dumpleton
That's a very useful link, I didn't know it before. Your blog posts are very insightful and helpful. This one specifically solves my problem:http://blog.dscpl.com.au/2009/08/more-on-those-problems-with-example.htmlThanks!
macieksk
I have one more question: "ports 80 and 443 are generally paired together for a site, mod_wsgi makes an exception in this case and will actually assign requests for the WSGI application through either port to run in the same sub interpreter" -- Can I achieve this effect for different pair of ports? (ex. 5443 and 8080)?
macieksk
You can control which sub interpreters requests are run in using the WSGIApplicationGroup directive. See 'http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIApplicationGroup'.
Graham Dumpleton