Thank you Massimo.  Your script as is didn't work for me (I use debian
lenny).  Apache complained about not recognizing virtual hosts and
that there was a duplicate of the wgsi deamon (I suppose only one
deamon should be named web2py).  I had to modify it to make it work.
(But still not desirable, more on this later).   In case, this might
be helpful to others, here's my Apache's configuration:

(Note, I run the daemon process using myaccount not as www-data; this
deviates from the official web2py suggestion)

<VirtualHost *:80>
  WSGIDaemonProcess web2py user=myaccount group=myaccount \
                           display-name=%{GROUP}
  WSGIProcessGroup web2py
  WSGIScriptAlias / /home/myaccount/web2py/wsgihandler.py

  <Directory /home/myaccount/web2py>
    AllowOverride None
    Order Allow,Deny
    Deny from all
    <Files wsgihandler.py>
      Allow from all
    </Files>
  </Directory>

  <Location /admin>
  Deny from all
  </Location>

  <LocationMatch ^/appadmin>
  Deny from all
  </LocationMatch>

  CustomLog /var/log/apache2/access.log common
  ErrorLog /var/log/apache2/error.log
</VirtualHost>


Now for each app and domain name, I have one of these:

<VirtualHost *:80>
  ServerName *.mydomain.com
  ServerAlias *.mydomain.com

  AliasMatch ^/static/(.*) \
           /home/myaccount/web2py/applications/app/static/$1

  <Directory /home/myaccount/web2py/applications/app/static/>
    Options -Indexes
    Order Allow,Deny
    Allow from all
  </Directory>
</VirtualHost>



This seems to work for me.  One caveat is that I can access the other
apps from any of the domains.



Reply via email to