If you have just one application all you need to do is set the web2py WSGI
script alias and serve files from the web2py folder excluding admin parts.
WSGIDaemonProcess web2py display-name=%{GROUP}
WSGIProcessGroup web2py
WSGIScriptAlias /prefix /var/www/web2py/wsgihandler.py
<Directory /var/www/web2py>
Options +FollowSymLinks
AllowOverride None
Order Allow,Deny
Deny from all
<Files wsgihandler.py>
Allow from all
</Files>
</Directory>
AliasMatch ^/prefix/([^/]+)/static/(.*)
/var/www/web2py/applications/$1/static/$2
<Directory /var/www/web2py/applications/*/static/>
Order Allow,Deny
Allow from all
</Directory>
<LocationMatch ^/prefix/([^/]+)/appadmin>
Deny from all
</LocationMatch>
<LocationMatch ^/prefix/admin>
Deny from all
</LocationMatch>
</VirtualHost>
Then set path prefix and the default application in your web2py/routes.py
file:
routers = dict(
# base router
BASE = dict(
default_application = "app",
path_prefix = "prefix",
),
)
As a result you will get "domain/prefix" pointing to the default
application "app".