<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Securing mod_php &#8211; without the vasectomy</title>
	<atom:link href="http://catn.com/2010/01/28/securing-mod-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://catn.com/security/securing-mod-php/</link>
	<description>Just another Fubra Limited site</description>
	<lastBuildDate>Wed, 16 May 2012 09:00:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Mark Sutton</title>
		<link>http://catn.com/security/securing-mod-php/comment-page-1/#comment-13</link>
		<dc:creator>Mark Sutton</dc:creator>
		<pubDate>Mon, 01 Feb 2010 15:56:37 +0000</pubDate>
		<guid isPermaLink="false">http://catn.com/?p=1253#comment-13</guid>
		<description>Andy,

mod_apparmor looks really good, and would indeed make it much safer to run vanilla mpm_prefork/mod_php in a mass vhosting scenario without the performance penalty of mpm_ITK.

The only downside I could see is the administrative overhead of defining &#039;hats&#039; for each vhost and distributing these across a cluster. Definitely seems like something to investigate further though perhaps it could be useful in addition to MPM_itk...</description>
		<content:encoded><![CDATA[<p>Andy,</p>
<p>mod_apparmor looks really good, and would indeed make it much safer to run vanilla mpm_prefork/mod_php in a mass vhosting scenario without the performance penalty of mpm_ITK.</p>
<p>The only downside I could see is the administrative overhead of defining &#8216;hats&#8217; for each vhost and distributing these across a cluster. Definitely seems like something to investigate further though perhaps it could be useful in addition to MPM_itk&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Sutton</title>
		<link>http://catn.com/security/securing-mod-php/comment-page-1/#comment-12</link>
		<dc:creator>Mark Sutton</dc:creator>
		<pubDate>Mon, 01 Feb 2010 15:43:15 +0000</pubDate>
		<guid isPermaLink="false">http://catn.com/?p=1253#comment-12</guid>
		<description>Brandon, thanks for the kind comments...

Unfortunately MPM_itk completely rules out shared memory opcode caching. It is possible to do file-based opcode caching though, and in this case MPM_itk helps to keep things nice and secure - writing cached files under the ownership of the system user associated with the vhost.

File-based caching also has a useful side-effect in a clustered web server setup, as it can save the server having to fetch the PHP source across the network assuming you cache to a local disk (most web clusters use NFS or similar to distribute files). This can make quite a difference to request throughput under high load.

Another thing to note is that we currently use PHP 5.3.1 on our vCluster, and opcode cache support for this has been quite patchy. Xcache 1.3.x was the first to support it, and eaccelerator have support in their latest release candidate.

I tried out eaccelerator-0.9.6-rc1 a few weeks ago but ran into stability issues. I see they have -rc2 now so I&#039;ll go back and see if things have improved. I have not tried xcache yet. I&#039;ll definitely block out some time to put latest xcache/eaccelerator to the test soon, and will post the results here.</description>
		<content:encoded><![CDATA[<p>Brandon, thanks for the kind comments&#8230;</p>
<p>Unfortunately MPM_itk completely rules out shared memory opcode caching. It is possible to do file-based opcode caching though, and in this case MPM_itk helps to keep things nice and secure &#8211; writing cached files under the ownership of the system user associated with the vhost.</p>
<p>File-based caching also has a useful side-effect in a clustered web server setup, as it can save the server having to fetch the PHP source across the network assuming you cache to a local disk (most web clusters use NFS or similar to distribute files). This can make quite a difference to request throughput under high load.</p>
<p>Another thing to note is that we currently use PHP 5.3.1 on our vCluster, and opcode cache support for this has been quite patchy. Xcache 1.3.x was the first to support it, and eaccelerator have support in their latest release candidate.</p>
<p>I tried out eaccelerator-0.9.6-rc1 a few weeks ago but ran into stability issues. I see they have -rc2 now so I&#8217;ll go back and see if things have improved. I have not tried xcache yet. I&#8217;ll definitely block out some time to put latest xcache/eaccelerator to the test soon, and will post the results here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Thompson</title>
		<link>http://catn.com/security/securing-mod-php/comment-page-1/#comment-11</link>
		<dc:creator>Andy Thompson</dc:creator>
		<pubDate>Mon, 01 Feb 2010 15:26:42 +0000</pubDate>
		<guid isPermaLink="false">http://catn.com/?p=1253#comment-11</guid>
		<description>I&#039;ve blogged about this a few weeks ago, and talked about op-code caches in ITK

http://andytson.com/blog/2010/01/techniques-for-creating-a-secure-shared-web-server/

APC definitely will not work in mpm-itk, whereas xcache and eaccelerator support file-based caching (xcache using a memory-mapped file, which would be better).

The simple reason is mpm-itk&#039;s processing model discards modified or newly allocated shared-memory after each request.

Alternatively, as mentioned in my blog article, there is mod_apparmor, which doesn&#039;t change the apache processing model at all. I&#039;m planning to write a more detailed blog post on it sometime soon.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve blogged about this a few weeks ago, and talked about op-code caches in ITK</p>
<p><a href="http://andytson.com/blog/2010/01/techniques-for-creating-a-secure-shared-web-server/" rel="nofollow">http://andytson.com/blog/2010/01/techniques-for-creating-a-secure-shared-web-server/</a></p>
<p>APC definitely will not work in mpm-itk, whereas xcache and eaccelerator support file-based caching (xcache using a memory-mapped file, which would be better).</p>
<p>The simple reason is mpm-itk&#8217;s processing model discards modified or newly allocated shared-memory after each request.</p>
<p>Alternatively, as mentioned in my blog article, there is mod_apparmor, which doesn&#8217;t change the apache processing model at all. I&#8217;m planning to write a more detailed blog post on it sometime soon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon Turner</title>
		<link>http://catn.com/security/securing-mod-php/comment-page-1/#comment-10</link>
		<dc:creator>Brandon Turner</dc:creator>
		<pubDate>Mon, 01 Feb 2010 15:04:27 +0000</pubDate>
		<guid isPermaLink="false">http://catn.com/?p=1253#comment-10</guid>
		<description>Mark, this is a great article.  Can you talk about PHP opcode caches with MPM_itk - specifically do they work?  Are they per user or shared across the whole machine?

I had a heck of a time trying to secure Apache for a *small* shared hosting environment (nothing close to what it sounds like you are running) while still allowing APC which speeds up my PHP sites so much.  I ended up doing &lt;a href=&quot;http://www.brandonturner.net/blog/2009/07/fastcgi_with_php_opcode_cache/&quot; rel=&quot;nofollow&quot;&gt;FastCGI with APC&lt;/a&gt; but I admit it is very resource intensive and would not scale to thousands of small sites.

I&#039;d be very interested in your thoughts on opcode caches in your setup.  Again - great article!</description>
		<content:encoded><![CDATA[<p>Mark, this is a great article.  Can you talk about PHP opcode caches with MPM_itk &#8211; specifically do they work?  Are they per user or shared across the whole machine?</p>
<p>I had a heck of a time trying to secure Apache for a *small* shared hosting environment (nothing close to what it sounds like you are running) while still allowing APC which speeds up my PHP sites so much.  I ended up doing <a href="http://www.brandonturner.net/blog/2009/07/fastcgi_with_php_opcode_cache/" rel="nofollow">FastCGI with APC</a> but I admit it is very resource intensive and would not scale to thousands of small sites.</p>
<p>I&#8217;d be very interested in your thoughts on opcode caches in your setup.  Again &#8211; great article!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Sutton</title>
		<link>http://catn.com/security/securing-mod-php/comment-page-1/#comment-9</link>
		<dc:creator>Mark Sutton</dc:creator>
		<pubDate>Thu, 28 Jan 2010 21:50:25 +0000</pubDate>
		<guid isPermaLink="false">http://catn.com/?p=1253#comment-9</guid>
		<description>Thanks Simon, and good spot on the threads.

To get a threaded Apache you&#039;d need to use MPM_worker, which excludes using MPM_itk since Apache can only use a single MPM. It might be possible to combine the two, but I&#039;m not sure (doubt?) whether it would be safe for a worker thread to attempt to change effective user id without affecting other workers too. I&#039;d need to investigate that.

And, while PHP will technically run under a threaded web server, PHP itself carries no thread safe guarantees. Although these days they claim the core is thread safe, but that certainly couldn&#039;t be assumed for any extensions without much closer inspection.

I&#039;ll comment on those extra points another time :-)</description>
		<content:encoded><![CDATA[<p>Thanks Simon, and good spot on the threads.</p>
<p>To get a threaded Apache you&#8217;d need to use MPM_worker, which excludes using MPM_itk since Apache can only use a single MPM. It might be possible to combine the two, but I&#8217;m not sure (doubt?) whether it would be safe for a worker thread to attempt to change effective user id without affecting other workers too. I&#8217;d need to investigate that.</p>
<p>And, while PHP will technically run under a threaded web server, PHP itself carries no thread safe guarantees. Although these days they claim the core is thread safe, but that certainly couldn&#8217;t be assumed for any extensions without much closer inspection.</p>
<p>I&#8217;ll comment on those extra points another time <img src='http://catn.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Brook</title>
		<link>http://catn.com/security/securing-mod-php/comment-page-1/#comment-8</link>
		<dc:creator>Simon Brook</dc:creator>
		<pubDate>Thu, 28 Jan 2010 21:42:35 +0000</pubDate>
		<guid isPermaLink="false">http://catn.com/?p=1253#comment-8</guid>
		<description>An excellent article and well explained - you might mention that mpm_itk is not thread aware, which I appreciate is not a problem for most people.

Would love to know how to get those &quot;extra points&quot;...

Simon
http://www.osbornebrook.co.uk</description>
		<content:encoded><![CDATA[<p>An excellent article and well explained &#8211; you might mention that mpm_itk is not thread aware, which I appreciate is not a problem for most people.</p>
<p>Would love to know how to get those &#8220;extra points&#8221;&#8230;</p>
<p>Simon<br />
<a href="http://www.osbornebrook.co.uk" rel="nofollow">http://www.osbornebrook.co.uk</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

