1.1 --- a/tools/Apache/config.py Fri Jan 13 17:42:13 2006 +0000
1.2 +++ b/tools/Apache/config.py Fri Jan 13 17:42:49 2006 +0000
1.3 @@ -46,13 +46,12 @@
1.4 """
1.5
1.6 mod_python_template = """
1.7 -Alias %s "%s"
1.8 -
1.9 -<Directory "%s">
1.10 - AddHandler python-program %s
1.11 +<Location "%s">
1.12 + SetHandler python-program
1.13 PythonHandler %s
1.14 PythonDebug On
1.15 -</Directory>
1.16 + PythonPath "['%s'] + sys.path"
1.17 +</Location>
1.18 """
1.19
1.20 if __name__ == "__main__":
1.21 @@ -62,14 +61,12 @@
1.22 apache_site_dir = sys.argv[3]
1.23 site_name = sys.argv[4]
1.24 url_path = sys.argv[5]
1.25 - if app_type == "mod_python":
1.26 - suffix = sys.argv[6]
1.27 - elif app_type != "CGI":
1.28 + if app_type not in ("mod_python", "CGI"):
1.29 print "Please specify either CGI or mod_python as the application type."
1.30 sys.exit(1)
1.31
1.32 except IndexError:
1.33 - print "config.py CGI|mod_python <app-location> <apache-site-dir> <site-name> <url-path> [<suffix>]"
1.34 + print "config.py CGI|mod_python <app-location> <apache-site-dir> <site-name> <url-path>"
1.35 print
1.36 print "CGI configures a CGI application"
1.37 print "mod_python configures a mod_python application"
1.38 @@ -85,11 +82,6 @@
1.39 print
1.40 print "<url-path> is the path at which your application will be published"
1.41 print "eg. /cgi/simple"
1.42 - print
1.43 - print "mod_python options:"
1.44 - print
1.45 - print "<suffix> is the ending which published resources in the application should have"
1.46 - print "eg. .simple"
1.47 sys.exit(1)
1.48
1.49 # Derived information.
1.50 @@ -112,7 +104,7 @@
1.51 sessions_dir = os.path.join(handler_dir, "WebStack-sessions")
1.52
1.53 elif app_type == "mod_python":
1.54 - template = mod_python_template % (url_path, handler_dir, handler_dir, suffix, handler_name)
1.55 + template = mod_python_template % (url_path, handler_name, handler_dir)
1.56 server_root = apache_server.get_server_root_from_config() or apache_site_dir
1.57 sessions_dir = os.path.join(server_root, "WebStack-sessions")
1.58