summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2011-06-21 15:49:31 +0000
committerhallgren <hallgren@chalmers.se>2011-06-21 15:49:31 +0000
commite1385da05042ebec1c46e1f9029720ac0d873d77 (patch)
tree9c4537eeb996f496f087e4b23f090228deaf4ce8 /src/server
parent549cc324d7f6703c497433e85280e558bd1258b3 (diff)
gf-server: make pgf-service work the Apache mod_fastcgi
pgf-service now appears to works with Apache mod_fastcgi (under Mac OS X) in addition to lighttpd. One difference appears to be that while lighttpd passes the name of the PGF file in the SCRIPT_FILENAME variable, Apache passes it in PATH_TRANSLATED. But perhaps this depends on exactly how the fastcgi service is configured. The following is what I added to the Apache configuration file to test this: <Directory /Library/WebServer/Documents/fcgi-bin> SetHandler fastcgi-script Options +ExecCGI </Directory> Action pgf-service /fcgi-bin/pgf-service AddHandler pgf-service .pgf
Diffstat (limited to 'src/server')
-rw-r--r--src/server/PGFService.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/PGFService.hs b/src/server/PGFService.hs
index 09714d7fa..2b872c18d 100644
--- a/src/server/PGFService.hs
+++ b/src/server/PGFService.hs
@@ -33,7 +33,11 @@ logFile = "pgf-error.log"
newPGFCache = newCache PGF.readPGF
-getPath = getVarWithDefault "SCRIPT_FILENAME" ""
+getPath =
+ do path <- getVarWithDefault "PATH_TRANSLATED" "" -- apache mod_fastcgi
+ if null path
+ then getVarWithDefault "SCRIPT_FILENAME" "" -- lighttpd
+ else return path
cgiMain :: Cache PGF -> CGI CGIResult
cgiMain cache = handleErrors . handleCGIErrors $