better cgihandler, issue 670, thanks Mark Kirkwood

This commit is contained in:
Massimo Di Pierro
2012-02-19 22:47:31 -06:00
parent bf56190fc3
commit a8145a6ad4
2 changed files with 44 additions and 1 deletions
+1 -1
View File
@@ -1 +1 @@
Version 1.99.4 (2012-02-19 22:40:59) stable
Version 1.99.4 (2012-02-19 22:47:06) stable
+43
View File
@@ -5,6 +5,49 @@
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
This is a CGI handler for Apache
Requires apache+[mod_cgi or mod_cgid].
In httpd.conf put something like:
LoadModule cgi_module modules/mod_cgi.so
ScriptAlias / /path/to/cgihandler.py/
Example of httpd.conf ------------
<VirtualHost *:80>
ServerName web2py.example.com
ScriptAlias / /users/www-data/web2py/cgihandler.py/
<Directory /users/www-data/web2py>
AllowOverride None
Order Allow,Deny
Deny from all
<Files cgihandler.py>
Allow from all
</Files>
</Directory>
AliasMatch ^/([^/]+)/static/(.*) \
/users/www-data/web2py/applications/$1/static/$2
<Directory /users/www-data/web2py/applications/*/static/>
Order Allow,Deny
Allow from all
</Directory>
<Location /admin>
Deny from all
</Location>
<LocationMatch ^/([^/]+)/appadmin>
Deny from all
</LocationMatch>
CustomLog /private/var/log/apache2/access.log common
ErrorLog /private/var/log/apache2/error.log
</VirtualHost>
----------------------------------
"""
import os