Index: package_branches/invirt-web/cherrypy-rebased/code/auth.fcgi
===================================================================
--- package_branches/invirt-web/cherrypy-rebased/code/auth.fcgi	(revision 2736)
+++ package_branches/invirt-web/cherrypy-rebased/code/auth.fcgi	(revision 2739)
@@ -1,1 +1,3 @@
-link invirt.fcgi
+#!/bin/sh
+
+exec ./invirt.fcgi auth "$@"
Index: package_branches/invirt-web/cherrypy-rebased/code/invirt.fcgi
===================================================================
--- package_branches/invirt-web/cherrypy-rebased/code/invirt.fcgi	(revision 2736)
+++ package_branches/invirt-web/cherrypy-rebased/code/invirt.fcgi	(revision 2739)
@@ -12,5 +12,8 @@
 
 def usage():
-    print >>sys.stderr, """%s [config]
+    argv0_dir = os.path.dirname(sys.argv[0])
+    print >>sys.stderr, """%s <unauth|auth> [config]
+%s/auth.fcgi [config]
+%s/unauth.fcgi [config]
 
 Run server as FastCGI, with CherryPy config from "main.conf".
@@ -19,17 +22,18 @@
 
 Run this script as either 'auth.fcgi' or 'unauth.fcgi', to get
-the authenticated or unauthenticated site respectively.
-""" % sys.argv[0]
+the authenticated or unauthenticated site respectively, or pass
+'auth' or 'unauth' as the first parameter.
+""" % (sys.argv[0], argv0_dir, argv0_dir)
     sys.exit(2)
 
 if __name__ == "__main__":
-    if len(sys.argv) > 2:
+    if len(sys.argv) > 3 or len(sys.argv) == 1 or '-h' in sys.argv or '--help' in sys.argv:
         usage()
-    if len(sys.argv) > 1:
-        if sys.argv[1] in ('-h', '--help'):
-            usage()
-        conf_file = sys.argv[1]
+    if len(sys.argv) == 3:
+        mode = sys.argv[1]
+        conf_file = sys.argv[2]
         dev = True
     else:
+        mode = sys.argv[1]
         conf_file = os.path.join(base_dir, 'main.conf')
 
@@ -40,8 +44,10 @@
         }
 
-    if os.path.basename(sys.argv[0]).startswith('auth'):
+    if mode.startswith('auth'):
         root = main.InvirtWeb()
-    elif os.path.basename(sys.argv[0]).startswith('unauth'):
+        app_config['/']['tools.mako.module_directory'] = "/tmp/invirt-auth-web-templatecache"
+    elif mode.startswith('unauth'):
         root = main.InvirtUnauthWeb()
+        app_config['/']['tools.mako.module_directory'] = "/tmp/invirt-unauth-web-templatecache"
     else:
         usage()
Index: package_branches/invirt-web/cherrypy-rebased/code/main.conf
===================================================================
--- package_branches/invirt-web/cherrypy-rebased/code/main.conf	(revision 2736)
+++ package_branches/invirt-web/cherrypy-rebased/code/main.conf	(revision 2739)
@@ -3,5 +3,4 @@
 #auto_reload doesn't work with FastCGI
 engine.auto_reload = False
-tools.mako.module_directory = "/tmp/invirt-web-templatecache"
 tools.remote_user_login.on = True
 
Index: package_branches/invirt-web/cherrypy-rebased/code/unauth.fcgi
===================================================================
--- package_branches/invirt-web/cherrypy-rebased/code/unauth.fcgi	(revision 2736)
+++ package_branches/invirt-web/cherrypy-rebased/code/unauth.fcgi	(revision 2739)
@@ -1,1 +1,3 @@
-link invirt.fcgi
+#!/bin/sh
+
+exec ./invirt.fcgi unauth "$@"
Index: package_branches/invirt-web/cherrypy-rebased/debian/changelog
===================================================================
--- package_branches/invirt-web/cherrypy-rebased/debian/changelog	(revision 2736)
+++ package_branches/invirt-web/cherrypy-rebased/debian/changelog	(revision 2739)
@@ -1,2 +1,10 @@
+invirt-web (0.1.1) unstable; urgency=low
+
+  * Use a different Mako template cache for auth.fcgi and unauth.fcgi
+  * Use shell scripts for the auth.fcgi and unauth.fcgi so that Apache
+    will not think they are the same script.
+
+ -- Quentin Smith <quentin@mit.edu>  Sun, 20 Dec 2009 23:53:17 -0500
+
 invirt-web (0.1.0) unstable; urgency=low
 
