<?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; Apache</title>
	<atom:link href="http://blog.unixy.net/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.unixy.net</link>
	<description>Fully Managed Dedicated Servers</description>
	<lastBuildDate>Thu, 09 Sep 2010 07:08:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>The penultimate guide to stopping a DDoS attack &#8211; A new approach</title>
		<link>http://blog.unixy.net/2010/08/the-penultimate-guide-to-stopping-a-ddos-attack-a-new-approach/</link>
		<comments>http://blog.unixy.net/2010/08/the-penultimate-guide-to-stopping-a-ddos-attack-a-new-approach/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 13:47:15 +0000</pubDate>
		<dc:creator>UNIXy</dc:creator>
				<category><![CDATA[Challenge]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[DDoS]]></category>
		<category><![CDATA[DoS]]></category>
		<category><![CDATA[large attack]]></category>
		<category><![CDATA[large DDoS attack]]></category>
		<category><![CDATA[mitigate DDoS]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[reverse proxy]]></category>
		<category><![CDATA[stop DDoS attack]]></category>

		<guid isPermaLink="false">http://blog.unixy.net/?p=479</guid>
		<description><![CDATA[In this post we (UNIXY) are going to share our experience fending off a large Distributed Denial of Service (DDoS) attack for a client. Generally, Website owners deal with DDoS attacks on their own. There are equipment and solutions vendors cater to these owners and guarantee protection against these kind of attacks up to a [...]]]></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%2F2010%2F08%2Fthe-penultimate-guide-to-stopping-a-ddos-attack-a-new-approach%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.unixy.net%2F2010%2F08%2Fthe-penultimate-guide-to-stopping-a-ddos-attack-a-new-approach%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In this post we (<a title="Fully Managed Dedicated Servers and Clusters" href="http://www.unixy.net" target="_blank">UNIXY</a>) are going to share our experience fending off a large <a title="Wikipedia Distributed Denial of Service Attack" href="http://en.wikipedia.org/wiki/Denial-of-service_attack" target="_blank">Distributed Denial of Service</a> (DDoS) attack for a client. Generally, Website owners deal with DDoS attacks on their own. There are equipment and solutions vendors cater to these owners and guarantee protection against these kind of attacks up to a certain threshold. The cost of hiring these vendors can range from thousands to hundreds of thousand or millions of dollars depending on the severity of the attack.</p>
<p>Our goal was to build a solution with the least amount of funds possible. This solution is scalable and can handle the worst attacks. The client&#8217;s dedicated server is not a special server but a simple quad core Xeon <strong><a title="UNIXY Managed Dedicated Server" href="http://www.unixy.net/dedicated-servers" target="_blank">managed server</a><span style="font-weight: normal;"> running the LAMP stack</span></strong>. The DDoS riposte described in this article can scale to stop a 10Gbps attack or more. The good news is this solution does not require changing anything on the <a title="UNIXY Dedicated Servers" href="http://www.unixy.net/dedicated-servers" target="_blank"><strong>dedicated server</strong></a> itself. The server could be running just about any software stack. This configuration will work just fine with almost all cases effortlessly.</p>
<ul>
<li><strong>Distributed Denial of Service &#8211; The Social</strong></li>
</ul>
<p>Before we delve into the glorious technical details, there is an important aspect of DDoS attacks that one should know about; that is the social dynamics that lead to the attack. The more one understands about the the social aspect of a DDoS attack the easier it becomes to prevent or stop it. Because once a DDoS has started, priorities shift quite dramatically and rational for making wise decisions becomes flawed.</p>
<div id="attachment_533" class="wp-caption aligncenter" style="width: 330px"><a href="http://blog.unixy.net/wp-content/uploads/2010/08/JimmyDDoS.png"><img class="size-full wp-image-533" title="DDoS comic" src="http://blog.unixy.net/wp-content/uploads/2010/08/JimmyDDoS.png" alt="DDoS comic" width="320" height="274" /></a><p class="wp-caption-text">DDoS comic</p></div>
<p>DDoS attacks do not occur randomly. They are targeted and come with a motive. The motive could be revenge but most of the time the motive is financial. The individual or groups that conduct the DDoS attacks are most of the time hired to complete the job. They have the resources and know-how to orchestrate the attack while hoping to avoid getting caught by the authorities. They have no emotional attachment to the DDoS attack itself; they have no hard feelings towards the victim. They just get paid for what they do and nonchalantly, but meticulously, execute.</p>
<p>As explained, DDoS attacks are preceded by an email, post, or phone call, from the individual or group with interest, to the victim. It is always recommended to treat strangers you meet online or offline professionally and politely. The smallest altercation can lead to a negative reaction, which can escalate actions. In the face of anonymous threats against your business or organization, remain calm and composed.</p>
<div id="attachment_517" class="wp-caption aligncenter" style="width: 410px"><a href="http://blog.unixy.net/wp-content/uploads/2010/08/DDoS_Offer_forum.png"><img class="size-medium wp-image-517 " title="DDoS Offer in Forum" src="http://blog.unixy.net/wp-content/uploads/2010/08/DDoS_Offer_forum-300x78.png" alt="DDoS Offer in Forum" width="400" height="100" /></a><p class="wp-caption-text">DDoS Offer in Forum</p></div>
<p>There are public markets online (please don&#8217;t ask for links) where wannabe DDoS perpetrators get to hire the attackers. Pricing varies from $5/hr to $10 for a simple non-distributed DoS attack. A DDoS, however, tends to be more expensive depending on the sheer amount of data or packets that needs to be delivered at the target. It can range from $20/hr to $100/hr. The word used to in the circles in lieu of DDoS is to &#8220;drop;&#8221; meaning to drop a certain Web site or network off the Internet. It really means to either overwhelm the target with enough traffic that the equipment fails or to force upstream providers to &#8220;null route&#8221; the destination IP at the network level. The end result is that the IP gets dropped from the routing tables and the server to stop responding to all requests.</p>
<p>The fact that DDoS is not cheap has got to be comforting to an extent. It means that it is only a matter of time before the DDoS &#8220;client&#8221; runs out of cash. This in itself is encouraging. Keep that in mind should you begin to lose patience. Perseverance is omnipotent. Denial of service attacks are considered a crime and are punishable by Federal law in the US and by the police in the UK. As we will explain in the technical part of this article, DDoS attacks are almost impossible to trace to back to the individual or group that are orchestrating the attack. Because of the distributed nature, it requires cooperation from several network engineers that work for upstream providers.</p>
<p><strong>Distributed Denial of Service &#8211; The Technicals</strong></p>
<p>First things first, What is a DoS? what is the difference between a DoS and DDoS? A Denial of Service (DoS) is an attack originating from one source or one system that results in the service in question being unavailable to its legitimate users. It denies its very users access either because the service runs out of available resources or has been tricked to deny access to legitimate users. For example, a DoS attack on a Web server can cause it to run out of resources and stop responding to requests. A DDoS, on the other hand, is a more sophisticated attack since the attack originates from hundreds or thousands or nodes.</p>
<p>A DDoS attack is almost impossible to trace back to the source due to its distributed nature. DDoS orchestrators call the nodes and controller system a &#8220;bot.&#8221; With a few commands, the bot owner can instruct infected nodes from around the world to attack a target. The bot systems are hosted and controlled via <a title="Wikipedia: Internet Relay Chat" href="http://en.wikipedia.org/wiki/Internet_Relay_Chat" target="_blank">the Internet Relay Chat</a> (IRC) system or via a direct connection port connection. The nodes used to attack the target are made of compromised Windows and Linux nodes from around the world.</p>
<p>Before we present our solution, we need to discuss the two types of DDoS attacks that exist. On one hand you have attacks are bandwidth-based and seek to saturate the connectivity link. On the other hand, you have attacks that are packet-based and seek to saturate the processing capability of the equipment. In other words, they seek to overwhelm the processing power of the CPU and memory  or <em>fabric</em> of the routers or switches. All equipment has hard limits when it comes to their ability to handle a certain number of packets per second. Routers and switches are no exception.</p>
<div id="attachment_529" class="wp-caption aligncenter" style="width: 440px"><a href="http://blog.unixy.net/wp-content/uploads/2010/08/MbpsVspps2.png"><img class="size-full wp-image-529 " title="Capacity of networking equipment - Mbps vs pps" src="http://blog.unixy.net/wp-content/uploads/2010/08/MbpsVspps2.png" alt="Capacity of networking equipment - Mbps vs pps" width="430" height="184" /></a><p class="wp-caption-text">Capacity of networking equipment - Mbps vs pps</p></div>
<p>For example, take the above specification for a Cisco 6500 firewall. Each module is able to handle 5Gbps <em>or </em>2.8 million pps. This firewall sure looks like it can handle a 5Gbps attack. Great! However, should there be a packet-based DDoS attack, one would only need a 1.5Gbps payload to saturate it. That&#8217;s 2.8 million pps * 64 Bytes = 1.5Gbps. So bandwidth capacity means nothing by itself and small packets can cause havoc.</p>
<p>Our client was facing a 2Gbps DDoS attack that is packet based. It sought to force routing equipment along the way to start dropping legitimate packets. This caused the upstream to null route the IP to alleviate the burden on other customers that are behind the link. This is the typical reaction from all upstreams as they seek to protect their many other customers from feeling the pinch of the attack. We were given one last chance to &#8220;fix&#8221; things before the IP could be routed back in. Here is how we were able to fend off the attack and keep the server running.</p>
<p>We have deployed what we call a &#8220;constellation&#8221; of reverse proxy VM or <a title="UNIXY Fully Managed VPS" href="http://www.unixy.net/vps-hosting" target="_blank">VPS</a> nodes running the high performance Web server Nginx. The VM nodes were purchased from several providers given they are located at separate facilities. Essentially, we are off-loading and &#8220;splitting&#8221; both packet processing and bandwidth consumption across several data center facilities (physical routers &amp; carriers).</p>
<div id="attachment_540" class="wp-caption aligncenter" style="width: 314px"><a href="http://blog.unixy.net/wp-content/uploads/2010/08/nginx_constellation.png"><img class="size-full wp-image-540" title="Nginx constellation" src="http://blog.unixy.net/wp-content/uploads/2010/08/nginx_constellation.png" alt="Nginx constellation" width="304" height="463" /></a><p class="wp-caption-text">Nginx constellation</p></div>
<p>The configuration of the Nginx nodes is a typical reverse proxy configuration with the usual extra kernel security configuration. So for a 2Gbps attack and with 20 VM nodes, the bandwidth consumption per node is a maximum of 2GBps / 20 = 100Mbps. That&#8217;s a 100Mbps load per <a title="Managed VPS" href="http://www.unixy.net/vps-hosting" target="_blank">VM</a> node, which is reasonable enough and is below the threshold for getting one&#8217;s IP null routed by the provider. One could add more and more Nginx nodes to the constellation without issues.</p>
<p>So how is 20 VM nodes going to be affordable? VM prices have dropped dramatically over the last year. For the above configuration, a VM can cost between $5/mo and $10/mo. That&#8217;s an average of $8*20 = $160/Mo. Knowing that most DDoS attackers have the attention span of a gold fish, the $160 is all you need to send your attacker and his accomplice packing.</p>
<p style="text-align: center;"><a href="http://blog.unixy.net/wp-content/uploads/2010/08/ddos_cost.png"><img class="size-full wp-image-545 aligncenter" title="Total cost for averting a 2Gbps attack" src="http://blog.unixy.net/wp-content/uploads/2010/08/ddos_cost.png" alt="Total cost for averting a 2Gbps attack" width="240" height="196" /></a></p>
<p style="text-align: center;">
<p style="text-align: left;">Let&#8217;s talk more about the Nginx constellation configuration. The Nginx front-end nodes will run in proxy mode caching static files and requests. The more aggressive the DDoS the higher the time-to-live for cache objects should be. This prevents the Nginx nodes from proxy-passing requests to the quad core node. Although, if the main node has idle CPU and plenty of memory it wouldn&#8217;t hurt to put it to good use to alleviate the burden on the Nginx front nodes. Your domain&#8217;s A records is going to be the IP of the Nginx front nodes configured in round robin fashion. DNS round robin has its shortcomings in terms of not having control over how long (bad) records get cached by resolvers around the world. But in this case, it does not matter much. Just be sure to set high TTL for the records so your DNS server does not collapse under the enormous volume.</p>
<p style="text-align: left;">
<div id="attachment_559" class="wp-caption aligncenter" style="width: 625px"><a href="http://blog.unixy.net/wp-content/uploads/2010/08/nginx_constellation3.png"><img class="size-full wp-image-559" title="Nginx DDoS Constellation" src="http://blog.unixy.net/wp-content/uploads/2010/08/nginx_constellation3.png" alt="Nginx DDoS Constellation" width="615" height="613" /></a><p class="wp-caption-text">Nginx DDoS Constellation</p></div>
<p>There are tons of online tutorials that go over the installation of Nginx as a reverse proxy so be sure to read up on it. But we will list some of the peculiar settings that are needed to handle a large scale DDoS. Of importance is the number of Nginx worker processes and worker connections. Those values will need to adjusted gradually and higher to handle different kind of attacks depending the VM resource allocation. But you should set them at least as high as the following:</p>
<blockquote><p>worker_processes 8;<br />
events {<br />
.<br />
.<br />
worker_connections 4096; # Be sure to set ulimit -n 4096 or more<br />
.<br />
.<br />
}</p></blockquote>
<p>Keep in mind that one still needs to gear up for the event by setting kernel and system variables on the Nginx nodes. Simple things like per-IP rate limiting, flooding rate limits, and syn cookies should be enabled without a question. Here are some measures you can implement:</p>
<blockquote><p>net.ipv4.tcp_syncookies = 1<br />
# source validation / reversed path<br />
net.ipv4.conf.all.rp_filter = 1<br />
net.ipv4.conf.default.rp_filter = 1<br />
kernel.pid_max = 65536<br />
net.ipv4.ip_local_port_range = 9000 65000</p></blockquote>
<p><strong>Recap</strong></p>
<p>In brief, here are the elements that constitute our solution:</p>
<ul>
<li><strong>Nginx reverse proxy constellation</strong></li>
<li><strong>DNS round robin records</strong></li>
<li><strong>Security at the Nginx front end level</strong></li>
<li><strong>Know the social and technical dynamics behind DDoS attacks</strong></li>
</ul>
<p>That&#8217;s all folks. We hope you enjoyed this article. Should you have any question or comment, don&#8217;t hesitate to get in touch! No question is minor and we are always looking for feedback.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unixy.net/2010/08/the-penultimate-guide-to-stopping-a-ddos-attack-a-new-approach/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache vs Litespeed: Apache 95% faster than Litespeed</title>
		<link>http://blog.unixy.net/2010/08/apache-vs-litespeed-apache-95-faster-than-litespeed/</link>
		<comments>http://blog.unixy.net/2010/08/apache-vs-litespeed-apache-95-faster-than-litespeed/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 22:08:35 +0000</pubDate>
		<dc:creator>UNIXy</dc:creator>
				<category><![CDATA[Challenge]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[apache faster]]></category>
		<category><![CDATA[apache litespeed]]></category>
		<category><![CDATA[apache vs litespeed]]></category>
		<category><![CDATA[litespeed]]></category>
		<category><![CDATA[litespeed apache]]></category>

		<guid isPermaLink="false">http://blog.unixy.net/?p=456</guid>
		<description><![CDATA[Apache vs Litespeed: Apache 95% faster than Litespeed]]></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%2F2010%2F08%2Fapache-vs-litespeed-apache-95-faster-than-litespeed%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.unixy.net%2F2010%2F08%2Fapache-vs-litespeed-apache-95-faster-than-litespeed%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>The benchmarks are in! Find out how Apache smoked Litespeed with the help of Varnish: <a title="Apache 95% faster than Litespeed" href="http://www.unixy.net/apache-vs-litespeed/" target="_self">http://www.unixy.net/apache-vs-litespeed/</a></p>
<p>Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unixy.net/2010/08/apache-vs-litespeed-apache-95-faster-than-litespeed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running vBulletin Cluster Using Varnish</title>
		<link>http://blog.unixy.net/2009/11/running-vbulletin-along-with-varnish/</link>
		<comments>http://blog.unixy.net/2009/11/running-vbulletin-along-with-varnish/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 15:38:30 +0000</pubDate>
		<dc:creator>UNIXy</dc:creator>
				<category><![CDATA[Crash Course]]></category>
		<category><![CDATA[accelerator]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[failover]]></category>
		<category><![CDATA[litespeed]]></category>
		<category><![CDATA[load balance]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[varnish]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vBulletin]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://blog.unixy.net/?p=120</guid>
		<description><![CDATA[Varnish is an excellent Web accelerator that can be made to proxy requests in and out of a cluster of somewhat more fully fledged Web servers like Apache or Litespeed. It has some great features like its compiled language, called VCL, and C-like programming API. Large vBulletin deployments tend to be heavy on CPU and [...]]]></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%2F11%2Frunning-vbulletin-along-with-varnish%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.unixy.net%2F2009%2F11%2Frunning-vbulletin-along-with-varnish%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Varnish is an excellent Web accelerator that can be made to proxy requests in and out of a cluster of somewhat more fully fledged Web servers like Apache or Litespeed. It has some great features like its compiled language, called VCL, and C-like programming API.</p>
<p>Large vBulletin deployments tend to be heavy on CPU and memory due to PHP script processing. For a large vBulletin forum, we recommend a cluster of 5 physical servers with three of those running Xen virtualization. One of those servers will be dedicated to the MySQL master database. Three to be setup as &#8220;headless&#8221; PHP nodes and Varnish load balancing and failover. And finally one as the NFS file store. The three headless servers need to run Varnish in their own VM and Litespeed or Apache in their own VM similarly.</p>
<p>The varnish backend director functionality makes it ideal to balance incoming traffic across all PHP headless nodes. It makes the configuration scalable and plug and play especially when needing to scale out within hours. The challenge in this setup is in making Varnish work correctly with vBulletin. Otherwise, session problems will occur.</p>
<p>We have a lot to share on this implementation so keep checking this blog as we will post it all. In the next installment, we&#8217;ll go through our deployment of a large vBulletin forum for a customer. In the mean time, feel free to get in touch should you have a question or comment. If you are interested in us helping you accelerate your server, we have a page explaining the different technologies we deploy on our clients&#8217; dedicated servers. Read up here: <a href="http://www.unixy.net/accelerate-your-server/"><strong>http://www.unixy.net/accelerate-your-server</strong></a></p>
<p><strong>Update</strong>: we are offering a Varnish configuration for vBulletin (3 &#038; 4) for a one-time fee. We can also configure it free of charge should you decide to rent your fully managed dedicated server from UNIXY (http://www.unixy.net). Please <a href="http://www.unixy.net/contact-unixy">contact us</a> today to get your forum running with a blazing fast speed!</p>
<p>That&#8217;s all folks!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unixy.net/2009/11/running-vbulletin-along-with-varnish/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSL Errors With Apache</title>
		<link>http://blog.unixy.net/2009/10/ssl-errors-with-apache/</link>
		<comments>http://blog.unixy.net/2009/10/ssl-errors-with-apache/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 06:00:47 +0000</pubDate>
		<dc:creator>UNIXy</dc:creator>
				<category><![CDATA[Break-Fix]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Apache SSL error]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[rebuildhttpconf]]></category>
		<category><![CDATA[received a record]]></category>

		<guid isPermaLink="false">http://blog.unixy.net/?p=58</guid>
		<description><![CDATA[If you receive one of the following errors, it&#8217;s very possible the Apache process is listening on port 443 but is not responding using the SSL protocol routines. In brief it is a protocol mismatch. Here&#8217;s a list of possible errors: Firefox error: SSL received a record that exceeded the maximum permissible length Apache error [...]]]></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%2F10%2Fssl-errors-with-apache%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.unixy.net%2F2009%2F10%2Fssl-errors-with-apache%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>If you receive one of the following errors, it&#8217;s very possible the Apache process is listening on port 443 but is not responding using the SSL protocol routines. In brief it is a protocol mismatch. Here&#8217;s a list of possible errors:</p>
<p><strong>Firefox error</strong>: <code>SSL received a record that exceeded the maximum permissible length</code></p>
<p><strong>Apache error log</strong>: <code>\x80d\x01\x03\x01</code></p>
<p><strong>Curl CLI error</strong>: <code>curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol </code></p>
<p>The fastest way to recover from such error is to restore the most recent Apache configuration file from backup. If you do not have a backup copy, you will need to look at your virtualhost section associated with the domain and SSL port combination. Chances are it does not exist. In cPanel, this issue can be corrected with a simple run of the script rebuildhttpdconf as such:</p>
<p><code>/scripts/rebuildhttpdconf</code></p>
<p>After making the necessary changes, and whether you are running cPanel or not, you will need to stop Apache then restart it.</p>
<p>That&#8217;s all folks!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unixy.net/2009/10/ssl-errors-with-apache/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[suPHP is a module that enhances overall server security. It forces the system to execute PHP scripts with user privileges as opposed to Web server 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 [...]]]></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" height="61" width="50" /><br />
			</a>
		</div>
<p>suPHP is a module that enhances overall server security. It forces the system to execute PHP scripts with user privileges as opposed to Web server 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 managed dedicated server company. We are always happy to assist our customers in accomplishing tasks such as installing suPHP on their dedicated server or cluster.</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>
