oops! added .phtml to lighty config

7 Feb

I recently changed from apache to lighty+fastcgi for running several sites, including ajaxify. Aiming for a lighter memory footprint.

One thing about the away i did the now-ancient ajaxify demos is I used the ".phtml for html-style templates" idiom.

But I forgot to configure the ".phtml" suffix…fortunately that's now fixed. Having added it, I needed to fix the php setting, which is where I learned two things:

(a) use??fastcgi.map-extensions = ( ".phtml" => ".php" ) in the general fastCGI conf to do the mapping, i.e.:

fastcgi.map-extensions = ( ".phtml" => ".php" )
server.modules += ("mod_fastcgi")
fastcgi.server = ( ".php" =>
????( "localhost" =>
???? ??(
???? ?? ??"bin-path" => "/usr/bin/php5-cgi",
???? ?? ?? "socket" => "/tmp/php.socket"
???? ??)
????)
)

(b) in the vhost setting, override fastcgi.server with the actual path you want:

$HTTP["host"] =~ "(^|.)ajaxify.com.*$" {
??# server.document-root = ….
??# and other stuff??

????fastcgi.server = ( ".php" =>
???? ?? ?? ?? ?? ??((
???? ?? ?? ?? ?? ?? ?? ?? "bin-path" => "/usr/bin/php5-cgi -d include_path=.:/path/to/php/lib",
???? ?? ?? ?? ?? ?? ?? ?? "socket" => "/tmp/php2.socket"
???? ?? ?? ?? ?? ??)))
}
I do move hosts or change config about once a year, and in an ideal world, I'd have an automated ping service testing against a few regular expressions. It would form a basic regression test for server migrations, in addition to the normal reason to use these things, viz. server downtime.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: