Hallo zusammen,
ich muss für einen Kunden ein altes Archivsystem bereitstellen (nur noch lesend, per FastCGI). Dies setzt noch auf die Dateiendung .php3.
Diese wird in der vhost Config ja per
zur Textdatei degradiert.
Ist es möglich, das per custom.lua (idealerweise so, dass man es nur in dem Vertrag aktviert) zu ändern?
Meine aktuelle quick-n-dirty Lösung ist es in der apache.lua umzubiegen. Nicht so kritisch, da der Kunde ein eigenes System hat. Mittelfristig fände ich da aber eine „Lösung nach Lehrbuch“ schöner.
Anpassungen an der apache.lua:
Code
elseif opts.hasPHP == 2 then
fh:write("FastCGI\n")
-- FastCGI configuration
fh:write(" <IfModule mod_fcgid.c>\n")
fh:write(" <IfModule mod_php5.c>\n")
fh:write(" php_admin_flag engine off\n")
fh:write(" <FilesMatch \"\\.ph(p3?|tml)$\">\n")
fh:write(" SetHandler None\n")
fh:write(" </FilesMatch>\n")
-- FilesMatch for Debian 7:
fh:write(" <FilesMatch \".+\\.ph(p[345]?|t|tml)$\">\n")
[B][COLOR='#FF0000'] fh:write(" Options +ExecCGI\n")
fh:write(" SetHandler fcgid-script\n")[/COLOR][/B]
fh:write(" </FilesMatch>\n")
fh:write(" </IfModule>\n")
if LC.distribution.family == "SUSE" then
fh:write(" <FilesMatch \"\\.ph(p[345]?|tml)$\">\n")
fh:write(" SetHandler None\n")
fh:write(" </FilesMatch>\n")
end
if not opts.hasCGI then
-- if not already defined, set suexecUserGroup here:
fh:write(" <IfModule mod_suexec.c>\n")
fh:write(" SuexecUserGroup ", opts.user, " ", opts.group, "\n")
fh:write(" </IfModule>\n\n")
end
fh:write(" <FilesMatch \"\\.php5?$\">\n")
fh:write(" Options +ExecCGI\n")
fh:write(" SetHandler fcgid-script\n")
fh:write(" </FilesMatch>\n")
-- use another PHP version?
if php ~= 'php5' then
fh:write(" FcgidWrapper ", opts.path, "/conf/", php, "/php-fcgi-starter .php\n")
fh:write(" FcgidWrapper ", opts.path, "/conf/", php, "/php-fcgi-starter .php5\n")
else
fh:write(" FcgidWrapper ", opts.path, "/conf/php5/php-fcgi-starter .php\n")
[B][COLOR='#FF0000'] fh:write(" FcgidWrapper ", opts.path, "/conf/php5/php-fcgi-starter .php3\n")[/COLOR][/B]
fh:write(" FcgidWrapper ", opts.path, "/conf/php5/php-fcgi-starter .php5\n")
end
Alles anzeigen
Viele Grüße
Stefan