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
This commit is contained in:
hallgren
2011-06-21 15:49:31 +00:00
parent 549cc324d7
commit e1385da050

View File

@@ -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 $