<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>UNIXy &#187; suPHP</title>
	<atom:link href="http://blog.unixy.net/tag/suphp/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.unixy.net</link>
	<description>Fully Managed Dedicated Servers</description>
	<lastBuildDate>Fri, 03 Feb 2012 17:37:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Stable FastCGI configuration on a cPanel Apache shared or dedicated server</title>
		<link>http://blog.unixy.net/2011/12/stable-fastcgi-configuration-on-a-cpanel-apache-shared-or-dedicated-server/</link>
		<comments>http://blog.unixy.net/2011/12/stable-fastcgi-configuration-on-a-cpanel-apache-shared-or-dedicated-server/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 20:35:32 +0000</pubDate>
		<dc:creator>UNIXy</dc:creator>
				<category><![CDATA[Crash Course]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[DSO]]></category>
		<category><![CDATA[FastCGI]]></category>
		<category><![CDATA[mod_php]]></category>
		<category><![CDATA[suPHP]]></category>
		<category><![CDATA[UNIXy]]></category>
		<category><![CDATA[varnish]]></category>

		<guid isPermaLink="false">http://blog.unixy.net/?p=1483</guid>
		<description><![CDATA[A default installation of FastCGI on cPanel server is dangerously simple. In this post, I'll go over what it takes to configure FastCGI on a cPanel node properly.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.unixy.net%2F2011%2F12%2Fstable-fastcgi-configuration-on-a-cpanel-apache-shared-or-dedicated-server%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.unixy.net%2F2011%2F12%2Fstable-fastcgi-configuration-on-a-cpanel-apache-shared-or-dedicated-server%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>A default installation of FastCGI on <a title="cPanel Varnish" href="http://www.unixy.net/varnish" target="_blank">cPanel</a> <a title="server" href="http://www.unixy.net/dedicated-servers" target="_blank">server</a> is dangerously simple. It&#8217;s dangerous because one cPanel account (or one vhost) is capable of crashing down a whole <a title="server" href="http://www.unixy.net">server</a> if, say, traffic were to spike up. It&#8217;s also simple because it won&#8217;t allow complex scripts to run cleanly. In brief, it&#8217;s absolutely not ready for production as-is. In this post, I&#8217;ll go over what it takes to configure FastCGI on a cPanel node properly.</p>
<p>&nbsp;</p>
<p style="text-align: center;"><em>Did you know?</em></p>
<blockquote>
<p style="text-align: left;"><strong>UNIXy is a <a title="fully managed server" href="http://www.unixy.net/fully-managed-hosting-promise">fully managed server</a> and cluster provider. What this means is we don&#8217;t expect you to know anything about servers or server management. The good news is it doesn&#8217;t cost you extra to have us manage your UNIXy server! Get in touch with us <a title="UNIXy Contact" href="https://www.unixy.net/secure/contact.php">here</a> to get the ball rolling!</strong></p>
<p style="text-align: left;">
</blockquote>
<p>Before you continue reading, be sure to have FastCGI up and running as the PHP handler on your cPanel server. The installation of FastCGI is covered in the online cPanel documentation. From here on now, I&#8217;ll assume you&#8217;re ready to add the settings for FastCGI.</p>
<p>The following is a list of settings that you need to add to /etc/httpd/conf/php.conf upon switching to FastCGI:</p>
<blockquote>
<pre>MaxRequestsPerProcess 1000
FcgidMaxProcesses 200
FcgidProcessLifeTime 7200
MaxProcessCount 500
FcgidIOTimeout 400
FcgidIdleTimeout 600
FcgidIdleScanInterval 90
FcgidBusyTimeout 300
FcgidBusyScanInterval 80
ErrorScanInterval 3
ZombieScanInterval 3
<strong>DefaultMinClassProcessCount 0</strong>
<strong>DefaultMaxClassProcessCount 3</strong>
<strong>MaxRequestLen 20468982</strong></pre>
</blockquote>
<p>You&#8217;re more likely to adjust the settings in <strong>bold </strong>above. <em>Default<strong>Min</strong>ClassProcessCount 0 </em>instructs FastCGI to keep zero PHP processes running for user when traffic is idle (cPanel account user) . On the other hand, <em>Default<strong>Max</strong>ClassProcessCount 3 </em>tells FastCGI to never allow more than 3 PHP processes running at a time. This settings prevents one users from crashing the server were they to receive a lot of traffic.</p>
<p>So go ahead and copy/paste the above into your httpd.conf and restart Apache (service httpd restart). You&#8217;re good to go now! For greater performance, be sure to check out our <a title="Varnish" href="http://www.unixy.net/varnish">Varnish plugin</a>. Whether you&#8217;re running suPHP, FastCGI, or even DSO (mod_php), <a title="varnish" href="http://www.unixy.net/varnish">Varnish</a> will make your website load much faster.</p>
<p>That&#8217;s all folks!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unixy.net/2011/12/stable-fastcgi-configuration-on-a-cpanel-apache-shared-or-dedicated-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Opcode caching suPHP cPanel &#8211; Best workaround!</title>
		<link>http://blog.unixy.net/2011/02/opcode-caching-suphp-cpanel-best-workaround/</link>
		<comments>http://blog.unixy.net/2011/02/opcode-caching-suphp-cpanel-best-workaround/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 08:39:43 +0000</pubDate>
		<dc:creator>UNIXy</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[opcode]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[solved]]></category>
		<category><![CDATA[suPHP]]></category>
		<category><![CDATA[varnish]]></category>

		<guid isPermaLink="false">http://blog.unixy.net/?p=1203</guid>
		<description><![CDATA[Everyone knows that PHP opcode caching, or any kind of PHP caching for that matter, is not possible with suPHP. The workaround we've devised doesn't require any compromise in terms of security.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.unixy.net%2F2011%2F02%2Fopcode-caching-suphp-cpanel-best-workaround%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.unixy.net%2F2011%2F02%2Fopcode-caching-suphp-cpanel-best-workaround%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Everyone knows that PHP opcode <a href="http://www.unixy.net/varnish">caching</a>, or any kind of <a href="http://www.unixy.net/varnish">PHP caching</a> for that matter, is not possible with suPHP. This is a trade off of choosing security over performance. The performance hit of running scripts under suPHP is, however, significant. It&#8217;s so significant that pages take noticeably longer to display at the browser. Also, the server load goes through the roof during traffic spikes.</p>
<p>The workaround we&#8217;re presenting in this post doesn&#8217;t require any compromise in terms of security. You get to keep suPHP with its security blanket but also get a tremendous performance boost from caching. The caching in question comes from Varnish Cache, the open source HTTP accelerator that runs in front Apache (or any other Web server for that matter). We&#8217;ve developed a <a title="Varnish cPanel" href="http://www.unixy.net/varnish" target="_blank">Varnish cPanel </a>script or plugin that allows anyone to run Varnish. The script installs, configures, manages, and integrates Varnish with cPanel without you needing to do any maintenance from the terminal.</p>
<p>Varnish Cache is so powerful that the performance gains surpass that of PHP opcode caching! Both internal and independent benchmarks have shown that our cPanel Varnish Plugin (and <a href="http://en.wikipedia.org/wiki/Varnish_(software)">VCL</a>) performs better than the fastest Web server in the market including Nginx, Litespeed, and Lighttpd.<a title="Varnish Cache cPanel" href="http://www.unixy.net/varnish" target="_blank"> Read more on the results</a>.</p>
<p>The following video shows how one can easily install the Varnish cPanel script:</p>
<p><iframe title="YouTube video player" width="640" height="390" src="http://www.youtube.com/embed/cly5PkyXoeQ" frameborder="0" allowfullscreen></iframe></p>
<p>Here&#8217;s some feedback from people that are using the script: <a href="http://www.unixy.net/secure/knowledgebase.php?action=displayarticle&#038;id=25">http://www.unixy.net/secure/knowledgebase.php?action=displayarticle&#038;id=25</a></p>
<p>That&#8217;s all folks!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unixy.net/2011/02/opcode-caching-suphp-cpanel-best-workaround/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install suPHP on cPanel</title>
		<link>http://blog.unixy.net/2009/05/how-to-install-suphp-on-cpanel/</link>
		<comments>http://blog.unixy.net/2009/05/how-to-install-suphp-on-cpanel/#comments</comments>
		<pubDate>Sat, 23 May 2009 20:20:38 +0000</pubDate>
		<dc:creator>UNIXy</dc:creator>
				<category><![CDATA[Crash Course]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[EasyApache]]></category>
		<category><![CDATA[secure PHP]]></category>
		<category><![CDATA[suPHP]]></category>

		<guid isPermaLink="false">http://blog.unixy.net/?p=10</guid>
		<description><![CDATA[This small guide will go over the installation of suPHP on a cPanel server. cPanel has a peculiar way of setting up suPHP. The good news is that cPanel simplifies the installation!]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.unixy.net%2F2009%2F05%2Fhow-to-install-suphp-on-cpanel%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.unixy.net%2F2009%2F05%2Fhow-to-install-suphp-on-cpanel%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>Update</strong> (Feb-27-2011): We&#8217;ve released a cPanel plugin that runs along with Apache and cPanel and improves performance tremendously (more than 95%) on a cPanel suPHP server. The plugin is leveraging the Varnish high performance HTTP accelerator. Read about it all here: <a href="http://www.unixy.net/varnish">http://www.unixy.net/varnish</a></p>
<p>suPHP is a module that enhances overall server security. It forces the system to execute PHP scripts with user privileges as opposed to <a title="Web server" href="http://www.unixy.net" target="_self">Web server</a> privileges. suPHP is a good security measure especially when you expect to host multiple unrelated websites or hosting accounts. It keeps rotten apples away from the good ones! Keep in mind that <a href="http://www.unixy.net" target="_self">UNIXY</a> is a truly fully <a title="Managed server" href="http://www.unixy.net" target="_self">managed server</a> company. We are always happy to assist our customers in accomplishing tasks such as installing suPHP on their dedicated server or cluster. If you decide to hire UNIXY to install suPHP on your server, we are currently offering the service for a one-time fee <a title="Install suphp on cPanel" href="https://www.unixy.net/secure/cart.php?a=add&amp;pid=206" target="_self">here</a>.</p>
<p>This small guide will go over the installation of suPHP on a cPanel server. cPanel has a peculiar way of setting up suPHP. The good news is that cPanel simplifies the installation! Here&#8217;s an overview of the required steps:</p>
<ol>
<li>Install suPHP Using EasyApache</li>
<li>Configure suPHP</li>
<li>Verify The Configuration</li>
</ol>
<p>It&#8217;s important to pick a maintenance window that is less intrusive on your users or customers. The rebuild of Apache to support suPHP can cause down time. So be sure to send out a friendly email to your customers.</p>
<ol>
<li>Install suPHP Using EasyApache</li>
</ol>
<p>There are two ways to launch the EasyApache program. The first one is through SSH and the other via WHM. I prefer SSH so the rest of this guide will be based on that method. So go ahead and remote into the server as user root. Once logged in, run the easyapache script as such</p>
<blockquote><p>/scripts/easyapache</p></blockquote>
<p>The first textual screen that pops up will say the following: &#8220;<strong>Please choose a profile to load</strong>.&#8221; Simply hit the <em>Tab</em> key twice. The textual box &#8220;<strong>Start customizing based on profile</strong>&#8221; will become highlighted. At which point will hit the <em>Enter</em> key on your keyboard. Once you hit <em>Enter</em>, you will be presented with another screen. This time the screen says: &#8220;<strong>Please choose which apache to build</strong>.&#8221; Simply hit the <em>Tab</em> key once and then hit <em>Enter</em> again.</p>
<p>There are two more screen to go and we&#8217;re done. After hitting the <em>Enter</em> key above, another screen will pop up. This time it says: <strong>Please choose which main PHP versions (if any) to build</strong>.&#8221; Hit the <em>Tab</em> key once and then the <em>Enter</em> key. Follow the same instructions for the screen with title &#8220;<strong>Please choose which specific PHP version(s) to build</strong>.&#8221; The next screen, however, is very important. This is where we get to pick the suPHP module that we are building. Once you hit <em>Enter</em> in the previous step, the screen &#8220;<strong>Short Options List</strong>&#8221; comes up. Go ahead and hit the <em>Tab</em> key a few times until &#8220;<strong>Exhaustive Options List</strong>&#8221; is highlighted then press <em>Enter</em>. Scroll down the list of options until you cursor is on the entry &#8220;<strong>Mod SuPHP</strong>&#8230;&#8221;.  Hit the <em>Space</em> key once to check the box. Hit the <em>Tab</em> key once then Enter, then select <strong>&#8220;Save and Build&#8221;</strong>. Answer <em>Yes</em> to all questions</p>
<p>At this point the build has started. Wait for the build to complete. It&#8217;s important that no one uses WHM while the build is in progress. The build takes about 20 minutes to complete depending on server resources. Once the build is finished, proceed to step 2 below.</p>
<p>2. Configure suPHP</p>
<p>This is an important step because it formally enables suPHP. Simply run the following command</p>
<blockquote><p>/usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1</p></blockquote>
<p>We&#8217;re essentially telling it that we want PHP version 5 running on suPHP and SUEXEC. To verify that command has taken effect run the following command. The output should be indentical:</p>
<blockquote><p># /usr/local/cpanel/bin/rebuild_phpconf &#8211;current<br />
Available handlers: suphp dso cgi none<br />
DEFAULT PHP: 5<br />
PHP4 SAPI: none<br />
PHP5 SAPI: suphp<br />
SUEXEC: enabled</p></blockquote>
<p>So far so good! Now go ahead and restart Apache by running the following command:</p>
<blockquote><p>/scripts/restartsrv_httpd</p></blockquote>
<p>3. Verify The Configuration</p>
<p>At this point all should be working fine. But it&#8217;s prudent to keep an eye on the suPHP log file as that&#8217;s where errors and warnings show up. The suPHP log file is located here:</p>
<blockquote><p>/usr/local/apache/logs/suphp_log</p></blockquote>
<p>Most errors are related to permissions on PHP files. suPHP is very picky about permission and / or file ownership so be sure your PHP files have permission 755 and are owned by the same user account. You can change permission on any file using the following command:</p>
<blockquote><p>chmod 755 &lt;filename&gt;</p></blockquote>
<p>You can also change file ownership using the chown command:</p>
<blockquote><p>chown user.user &lt;filename&gt;</p></blockquote>
<p>I hope this is useful to anyone setting to install suPHP on a cPanel server.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unixy.net/2009/05/how-to-install-suphp-on-cpanel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

