<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Can You Secure A Shared Server With PHP + FastCGI?</title>
	<atom:link href="http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/</link>
	<description>Stuart Herbert's PHP Blog - Architecture, Code, and Hosting</description>
	<pubDate>Thu, 08 Jan 2009 21:13:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Nginx support</title>
		<link>http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/#comment-33412</link>
		<dc:creator>Nginx support</dc:creator>
		<pubDate>Wed, 10 Dec 2008 08:11:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=42#comment-33412</guid>
		<description>good benchmarsk, but why was failures in tests ? 
This schemes very good for shared hosting, cause useful and secure.</description>
		<content:encoded><![CDATA[<p>good benchmarsk, but why was failures in tests ?<br />
This schemes very good for shared hosting, cause useful and secure.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Travers Carter</title>
		<link>http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/#comment-30427</link>
		<dc:creator>Travers Carter</dc:creator>
		<pubDate>Sun, 12 Oct 2008 00:59:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=42#comment-30427</guid>
		<description>I run a similar setup to the one you describe here on several of our servers both for security, and the ability to run parallel PHP versions (the main difference in my config is I use a custom suexec replacement that removes the need to have a wrapper script per vhost) and initially had a similar problem with request failures.

I believe your 1 in 500 failure rate comes from two things:
1) In your wrapper script there is a typo "PHP_FGCI_MAX_REQUESTS=5000" should be "PHP_FCGI_MAX_REQUESTS=5000", if this typo is in the actual script PHP would be defaulting to 500 requests maximum per process

2) With php you need to use the mod_fcgid "MaxRequestsPerProcess" option to avoid a race condition in php's shutdown when it reaches the last request, see the last part of http://fastcgi.coremail.cn/doc.htm (it should be tuned to match your PHP_FCGI_MAX_REQUESTS)

Also as far as I understand mod_fcgid will never send a request to a worker until is has finished with the previous one, so setting PHP_FCGI_CHILDREN=4 will just add unnecessary startup overhead, you are better off letting mod_fcgid start multiple php processes itself.</description>
		<content:encoded><![CDATA[<p>I run a similar setup to the one you describe here on several of our servers both for security, and the ability to run parallel PHP versions (the main difference in my config is I use a custom suexec replacement that removes the need to have a wrapper script per vhost) and initially had a similar problem with request failures.</p>
<p>I believe your 1 in 500 failure rate comes from two things:<br />
1) In your wrapper script there is a typo &#8220;PHP_FGCI_MAX_REQUESTS=5000&#8243; should be &#8220;PHP_FCGI_MAX_REQUESTS=5000&#8243;, if this typo is in the actual script PHP would be defaulting to 500 requests maximum per process</p>
<p>2) With php you need to use the mod_fcgid &#8220;MaxRequestsPerProcess&#8221; option to avoid a race condition in php&#8217;s shutdown when it reaches the last request, see the last part of <a href="http://fastcgi.coremail.cn/doc.htm" rel="nofollow">http://fastcgi.coremail.cn/doc.htm</a> (it should be tuned to match your PHP_FCGI_MAX_REQUESTS)</p>
<p>Also as far as I understand mod_fcgid will never send a request to a worker until is has finished with the previous one, so setting PHP_FCGI_CHILDREN=4 will just add unnecessary startup overhead, you are better off letting mod_fcgid start multiple php processes itself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael VanDeMar</title>
		<link>http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/#comment-30305</link>
		<dc:creator>Michael VanDeMar</dc:creator>
		<pubDate>Thu, 09 Oct 2008 17:58:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=42#comment-30305</guid>
		<description>I have been trying for a week now to get this running on my server, with some frustrating results. Now I'm getting this in suexec.log:

[2008-10-09 09:13:33]: uid: (500/kitten-art) gid: (501/501) cmd: kitten-art-wrapper

where kitten-art is the user and kitten-art-wrapper is the FCGIWrapper, but then getting a 500 error with this in the httpd error log:

[Thu Oct 09 09:13:33 2008] [notice] mod_fcgid: call /var/www/html/domain.com/public_html/index.php with wrapper /var/www/fastcgi-kitten-art/kitten-art-wrapper
suexec failure: could not open log file
fopen: Permission denied
[Thu Oct 09 09:13:36 2008] [notice] mod_fcgid: process /var/www/html/domain.com/public_html/index.php(17346) exit(communication error), terminated by calling exit(), return code: 1

Since all of the logs are in fact getting written to as far as I can tell (both Apache and site specific ones), I'm not sure what the error is referring to. Any ideas?</description>
		<content:encoded><![CDATA[<p>I have been trying for a week now to get this running on my server, with some frustrating results. Now I&#8217;m getting this in suexec.log:</p>
<p>[2008-10-09 09:13:33]: uid: (500/kitten-art) gid: (501/501) cmd: kitten-art-wrapper</p>
<p>where kitten-art is the user and kitten-art-wrapper is the FCGIWrapper, but then getting a 500 error with this in the httpd error log:</p>
<p>[Thu Oct 09 09:13:33 2008] [notice] mod_fcgid: call /var/www/html/domain.com/public_html/index.php with wrapper /var/www/fastcgi-kitten-art/kitten-art-wrapper<br />
suexec failure: could not open log file<br />
fopen: Permission denied<br />
[Thu Oct 09 09:13:36 2008] [notice] mod_fcgid: process /var/www/html/domain.com/public_html/index.php(17346) exit(communication error), terminated by calling exit(), return code: 1</p>
<p>Since all of the logs are in fact getting written to as far as I can tell (both Apache and site specific ones), I&#8217;m not sure what the error is referring to. Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart Herbert&#8217;s Blog: Can You Secure A Shared Server With PHP + FastCGI? : Dragonfly Networks</title>
		<link>http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/#comment-30254</link>
		<dc:creator>Stuart Herbert&#8217;s Blog: Can You Secure A Shared Server With PHP + FastCGI? : Dragonfly Networks</dc:creator>
		<pubDate>Wed, 08 Oct 2008 10:32:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=42#comment-30254</guid>
		<description>[...] a new post today Stuart Herbert asks the question &#8220;is it possible to secure a shared server with PHP and [...]</description>
		<content:encoded><![CDATA[<p>[...] a new post today Stuart Herbert asks the question &#8220;is it possible to secure a shared server with PHP and [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ah83</title>
		<link>http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/#comment-30251</link>
		<dc:creator>ah83</dc:creator>
		<pubDate>Wed, 08 Oct 2008 09:35:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=42#comment-30251</guid>
		<description>we use php as cgi with suexec and a php-wrapper written in c.
the performance is really good on a dell server with 2 quadcore opterons and 8 GB RAM.

even typo3 runs great on this platform.

i like the apache suexec cgi setup, because it is simple and well understood and i'm not relying on some esoteric thirdparty apache module.

this setup is ideal for masshosting, but on a server with only 30 sites and a lot of requests i would run apache instances for every site.

litespeed is also a good option, because it works like the fastcgi solution but more
stable.</description>
		<content:encoded><![CDATA[<p>we use php as cgi with suexec and a php-wrapper written in c.<br />
the performance is really good on a dell server with 2 quadcore opterons and 8 GB RAM.</p>
<p>even typo3 runs great on this platform.</p>
<p>i like the apache suexec cgi setup, because it is simple and well understood and i&#8217;m not relying on some esoteric thirdparty apache module.</p>
<p>this setup is ideal for masshosting, but on a server with only 30 sites and a lot of requests i would run apache instances for every site.</p>
<p>litespeed is also a good option, because it works like the fastcgi solution but more<br />
stable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Radical</title>
		<link>http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/#comment-30247</link>
		<dc:creator>Radical</dc:creator>
		<pubDate>Wed, 08 Oct 2008 07:18:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=42#comment-30247</guid>
		<description>Great article.
I was working on a similar setup but for LigHTTPD.

Nice to know this is working in Apache also.</description>
		<content:encoded><![CDATA[<p>Great article.<br />
I was working on a similar setup but for LigHTTPD.</p>
<p>Nice to know this is working in Apache also.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Enlaces interesantes</title>
		<link>http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/#comment-30214</link>
		<dc:creator>Enlaces interesantes</dc:creator>
		<pubDate>Tue, 07 Oct 2008 19:32:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=42#comment-30214</guid>
		<description>[...] Can You Secure A Shared Server With PHP + FastCGI? [...]</description>
		<content:encoded><![CDATA[<p>[...] Can You Secure A Shared Server With PHP + FastCGI? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lafriks</title>
		<link>http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/#comment-30209</link>
		<dc:creator>Lafriks</dc:creator>
		<pubDate>Tue, 07 Oct 2008 18:01:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=42#comment-30209</guid>
		<description>I'm also using lighttpd and php-fcgi for shared hosting security and had no problems with such configuration. I have to help out clients with porting apache mod_rewrite syntax to lighttpd but it's usually only once for new client.</description>
		<content:encoded><![CDATA[<p>I&#8217;m also using lighttpd and php-fcgi for shared hosting security and had no problems with such configuration. I have to help out clients with porting apache mod_rewrite syntax to lighttpd but it&#8217;s usually only once for new client.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Fjordvald</title>
		<link>http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/#comment-30188</link>
		<dc:creator>Martin Fjordvald</dc:creator>
		<pubDate>Tue, 07 Oct 2008 11:22:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=42#comment-30188</guid>
		<description>Have you considered perhaps using a different web server such as lighttpd? I use lighttpd 1.5.0 without any problems. The downside would be no mod_rewrite through .htaccess though, so I'm not sure how well it would work for your average shared hosting server.</description>
		<content:encoded><![CDATA[<p>Have you considered perhaps using a different web server such as lighttpd? I use lighttpd 1.5.0 without any problems. The downside would be no mod_rewrite through .htaccess though, so I&#8217;m not sure how well it would work for your average shared hosting server.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Kelly</title>
		<link>http://blog.stuartherbert.com/php/2008/10/07/can-you-secure-a-shared-server-with-php-fastcgi/#comment-30186</link>
		<dc:creator>Chris Kelly</dc:creator>
		<pubDate>Tue, 07 Oct 2008 10:30:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stuartherbert.com/php/?p=42#comment-30186</guid>
		<description>I haven't experienced the 2/1000 failure rate that you have!  All of my problems have been a result of the previous version of APC which would cause pages to show up blank until httpd was gracefully restarted, but the most recent version of APC hasn't caused these problems. hmm.</description>
		<content:encoded><![CDATA[<p>I haven&#8217;t experienced the 2/1000 failure rate that you have!  All of my problems have been a result of the previous version of APC which would cause pages to show up blank until httpd was gracefully restarted, but the most recent version of APC hasn&#8217;t caused these problems. hmm.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
