Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 69 lines (48 sloc) 1.465 kb
#!/usr/bin/env python
# -*- coding: utf-8 -*-
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <>
License: LGPLv3 (
This is a CGI handler for Apache
Requires apache+[mod_cgi or mod_cgid].
In httpd.conf put something like:
LoadModule cgi_module modules/
ScriptAlias / /path/to/
Example of httpd.conf ------------
<VirtualHost *:80>
ScriptAlias / /users/www-data/web2py/
<Directory /users/www-data/web2py>
AllowOverride None
Order Allow,Deny
Deny from all
Allow from all
AliasMatch ^/([^/]+)/static/(.*) \
<Directory /users/www-data/web2py/applications/*/static/>
Order Allow,Deny
Allow from all
<Location /admin>
Deny from all
<LocationMatch ^/([^/]+)/appadmin>
Deny from all
CustomLog /private/var/log/apache2/access.log common
ErrorLog /private/var/log/apache2/error.log
import os
import sys
import wsgiref.handlers
path = os.path.dirname(os.path.abspath(__file__))
sys.path = [path]+[p for p in sys.path if not p==path]
import gluon.main
Jump to Line
Something went wrong with that request. Please try again.