From e1385da05042ebec1c46e1f9029720ac0d873d77 Mon Sep 17 00:00:00 2001 From: hallgren Date: Tue, 21 Jun 2011 15:49:31 +0000 Subject: [PATCH] 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: SetHandler fastcgi-script Options +ExecCGI Action pgf-service /fcgi-bin/pgf-service AddHandler pgf-service .pgf --- src/server/PGFService.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 $