Running multiple web.py application on the same domain

Showing 1-1 of 1 messages
Running multiple web.py application on the same domain Marios Zindilis 9/9/12 9:51 PM
Hello everyone,

I thought someone might be interested in this: For educational and testing purposes, I wanted to run the code examples from webpy.org (wiki, blog, ...) from a subdirectory (/test/web-py/) of my server (example.com), on which the main content is also served from a web.py app.

After some fruitless trial-and-error, I searched around found a post on serverfault.com[1] which handled a similar issue, and used that solution for my purpose. Here is the specific snippet of my apache2 configuration:

<VirtualHost *:80>
  ServerAdmin mar...@example.com
  ServerName example.com

  DocumentRoot /var/www/example.com

  # Aliases (most deeply nested URL should come first):
  Alias /test/web-py/blog /var/www/example.com/test/web-py/blog/index.py/
  Alias /test/web-py/wiki /var/www/example.com/test/web-py/wiki/index.py/
  Alias /test    /var/www/example.com/test
  Alias /      /var/www/example.com/index.py/

  AddType text/html .py

  <Directory /var/www/example.com/>
    WSGIApplicationGroup %{GLOBAL}
    AddHandler wsgi-script .py
    Options Indexes FollowSymLinks MultiViews ExecCGI
    AllowOverride None
    Order allow,deny
    allow from all
  </Directory>

  <Directory /var/www/example.com/test/>
    Options Indexes FollowSymLinks MultiViews ExecCGI
    AuthType Basic
    AuthName 'Restricter'
    AuthUserFile /etc/apache2/.htpasswd 
    Require valid-user
    AllowOverride None
    Order allow,deny
    allow from 11.22.33.44
  </Directory>

    WSGIApplicationGroup %{GLOBAL}
    AddHandler wsgi-script .py
    Options Indexes FollowSymLinks MultiViews ExecCGI
    AllowOverride None
    Order allow,deny
    allow from 11.22.33.44
  </Directory>

    WSGIApplicationGroup %{GLOBAL}
    AddHandler wsgi-script .py
    Options Indexes FollowSymLinks MultiViews ExecCGI
    AllowOverride None
    Order allow,deny
    allow from 11.22.33.44
  </Directory>

  # Possible values include: debug, info, notice, warn, error, crit,
  # alert, emerg.
  LogLevel warn

  ErrorLog /var/log/apache2/example.com/error.log
  CustomLog /var/log/apache2/example.com/access.log combined

</VirtualHost>