<?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>bloody error &#187; Linux</title>
	<atom:link href="http://www.bloodyerror.com/articles/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bloodyerror.com</link>
	<description>hope something here may help you...</description>
	<lastBuildDate>Thu, 14 Jan 2010 17:29:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Unix shell command to Detect DDoS attack</title>
		<link>http://www.bloodyerror.com/2009/07/unix-shell-command-to-detect-ddos-attack/</link>
		<comments>http://www.bloodyerror.com/2009/07/unix-shell-command-to-detect-ddos-attack/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 16:38:24 +0000</pubDate>
		<dc:creator>Jeevan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[administrator]]></category>
		<category><![CDATA[DDoS]]></category>
		<category><![CDATA[Detect DDoS]]></category>
		<category><![CDATA[Linux Command]]></category>
		<category><![CDATA[netstat]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[shell command]]></category>

		<guid isPermaLink="false">http://www.bloodyerror.com/?p=23</guid>
		<description><![CDATA[Have a server? Doubt it’s under DDoS attack? There is a simple code for you to check it’s under DDoS attack or not!
Run this command:
netstat -alpn &#124; grep :80 &#124; awk '{print $5}' &#124;awk -F: '{print $(NF-1)}' &#124;sort &#124; uniq -c &#124; sort -n
This is not exactly going to say YES your under attack, this [...]]]></description>
			<content:encoded><![CDATA[<p>Have a server? Doubt it’s under DDoS attack? There is a simple code for you to check it’s under DDoS attack or not!</p>
<p>Run this command:</p>
<pre class="brush: bash;">netstat -alpn | grep :80 | awk '{print $5}' |awk -F: '{print $(NF-1)}' |sort | uniq -c | sort -n</pre>
<p>This is not exactly going to say YES your under attack, this code will return IP address that connected to your server and how many connection they made to your server.</p>
<p>By looking at the number connections you should know what are the chances of a client from that particular IP connecting to your server and require that many connections!</p>
<p>Above code will return results like this:</p>
<blockquote><p><span style="color: #ff0000;">1</span><br />
<span style="color: #ff0000;">1</span> xxx.xxx.xxx.xxx<br />
<span style="color: #ff0000;">2</span> xxx.xxx.xxx.xxx<br />
<span style="color: #ff0000;">50 </span>xxx.xxx.xxx.xxx<br />
<em>xxx.xxx.xxx.xxx = IP address</em></p></blockquote>
<p>Number in the First column is the Number of connections established from that particular IP address. (<span style="color: #ff0000;">NumberofConnections</span> [SPACE] IP Address)</p>
<p>You will see that there is huge jump in number of connections from one or many IP’s (50 is for demonstration only how many is up to you). Many servers do not require having that many connections from a single IP. What to do next, is your choice, you could install security mods and setup firewalls to block these IP’s and so on. Do a little google search and you will find lots and lots of answers on “how to block DDoS attack?”</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloodyerror.com/2009/07/unix-shell-command-to-detect-ddos-attack/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Plesk 9.2.1 FastCGI Apache Error</title>
		<link>http://www.bloodyerror.com/2009/07/plesk-9-2-1-fastcgi-apache-error/</link>
		<comments>http://www.bloodyerror.com/2009/07/plesk-9-2-1-fastcgi-apache-error/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 09:18:45 +0000</pubDate>
		<dc:creator>Jeevan</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[administrator]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP FastCgi]]></category>
		<category><![CDATA[plesk]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.bloodyerror.com/?p=17</guid>
		<description><![CDATA[First of All This solution is for Linux based OS. I did it on centOS 4 x64 Running Plesk 9.2.1.
Well, If you every come across the FastCGI issue with Plesk Apache and looking for a solution, I&#8217;m sure following could help you a lot.
Problem occurs when you set-up a Domain to Run PHP in FastCGI [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">First of All This solution is for Linux based OS. I did it on centOS 4 x64 Running Plesk 9.2.1.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Well, If you every come across the FastCGI issue with Plesk Apache and looking for a solution, I&#8217;m sure following could help you a lot.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Problem occurs when you set-up a Domain to Run PHP in FastCGI Application mode in Plesk and Apache won&#8217;t restart / start.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Reason for that is the Apache configuration file referring to Dynamic CGI Library that it&#8217;s actual.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Solution is to change Apache Config and point to correct Library Location. But If you directly edit Apache config file, On next restart Plesk will overwrite it. So Edit Plesk Config file to reflect on Apache Config file.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">First you need to Locate FastCGI. Location may vary based on Linux distributions your using.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">A Simple explanation is given on how to locate in : http://forum.parallels.com/showpost.php?p=372722&amp;postcount=18</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">They also telling you to Run &#8220;psa-php5-configurator-1.5.1-cos5.build92090422.13.noarch.rpm&#8221; to resolve this issue. Well, I couldn&#8217;t fin this RPM in my server. so resolved to directly editing method.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Once you find your FastCGI location (in my case it was /usr/bin/php-cgi) edit Plesk Config File located at &#8220;/etc/psa/psa.conf&#8221; (this may vary as well).</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">I used VI edit through SSH.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">vi /etc/psa/psa.conf</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Find the Following Line (I found it at very bottom!):</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">CGI_PHP_BIN dynamic</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">and Replace it with:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">CGI_PHP_BIN /usr/bin/php-cgi</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Save the File and Exit VI edit</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">VI Editor Basic Commands: http://www.cs.colostate.edu/helpdocs/vi.html</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Now, Run this command to patch changes and restart Apache Server <img src='http://www.bloodyerror.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">/usr/local/psa/admin/sbin/websrvmng -av</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">It worked for me well! Let me know what happen to you&#8230; You can always use the source: http://forum.parallels.com/showthread.php?t=89939&amp;page=2 for more info and full reading.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">My server at 1&amp;1, Value for Price and Affordable Servers. have a look at : http://www.1and1.co.uk/?k_id=21520608</div>
<blockquote><p>* First of All This solution is for Linux based OS. I did it on <span style="color: #800000;">centOS 4 x64</span> Running <span style="color: #800000;">Plesk 9.2.1</span>.</p></blockquote>
<p>Well, If you every come across the FastCGI issue with Plesk Apache and looking for a solution, I&#8217;m sure following could help you a lot.</p>
<p><strong>Problem </strong>/<strong> Solution:</strong></p>
<ul>
<li>Problem occurs when you set-up a Domain to Run PHP in FastCGI Application mode in Plesk and Apache won&#8217;t restart / start.</li>
<li>Reason for that is the Apache configuration file referring to Dynamic CGI Library that it&#8217;s actual.</li>
<li>Solution is to change Apache Config and point to correct Library Location. But If you directly edit Apache config file, On next restart Plesk will overwrite it. So Edit Plesk Config file to reflect on Apache Config file.</li>
</ul>
<h3>1. Find FastCGI Path</h3>
<p>First you need to Locate FastCGI. Location may vary based on Linux distributions your using. A Simple explanation is given on how to locate in : <a href="http://forum.parallels.com/showpost.php?p=372722&amp;postcount=18" target="_blank">Simple Instruction on Where to look for FastCGI</a></p>
<p><em><span style="color: #888888;">They also telling you to Run &#8220;psa-php5-configurator-1.5.1-cos5.build92090422.13.noarch.rpm&#8221; to resolve this issue. Well, I couldn&#8217;t fin this RPM in my server. so resolved to directly editing method.</span></em></p>
<h3>2. Edit Plesk config</h3>
<p>Once you find your FastCGI location (in my case it was /usr/bin/php-cgi) edit Plesk Config File located at &#8220;<span style="color: #ff0000;">/etc/psa/psa.conf</span>&#8221; <em>(this may vary as well).</em></p>
<p>I used <span style="color: #0000ff;">VI</span> edit through <span style="color: #0000ff;">SSH</span>.</p>
<blockquote><p><span style="color: #0000ff;">vi</span> <span style="color: #ff0000;">/etc/psa/psa.conf</span></p></blockquote>
<p>Find the Following Line (I found it at very bottom!):</p>
<blockquote><p>CGI_PHP_BIN <span style="color: #ff0000;">dynamic</span></p></blockquote>
<p>and Replace it with:</p>
<blockquote><p>CGI_PHP_BIN <span style="color: #ff0000;">/usr/bin/php-cgi</span></p></blockquote>
<p>Save the File and Exit VI edit</p>
<p><em>VI Editor Basic Commands: <a href="http://www.cs.colostate.edu/helpdocs/vi.html" target="_blank">http://www.cs.colostate.edu/helpdocs/vi.html</a></em></p>
<h3>3. patch Changes to Apache Config</h3>
<p>Now, Run this command to patch changes and restart Apache Server <img src='http://www.bloodyerror.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<blockquote><p>/usr/local/psa/admin/sbin/websrvmng -av</p></blockquote>
<p><em>It worked for me well! Let me know what happen to you&#8230; You can always use the source: </em><a href="http://forum.parallels.com/showthread.php?t=89939&amp;page=2 " target="_blank"><em>http://forum.parallels.com/showthread.php?t=89939&amp;page=2 </em></a><em>for more info and full reading.</em></p>
<p>My server at 1&amp;1, Value for Price and Affordable Servers. have a look at : <a href="http://www.1and1.co.uk/?k_id=21520608" target="_blank">http://www.1and1.co.uk</a></p>
<p><span id="more-17"></span></p>
<h3>How its happens:</h3>
<p>After Hosting my site(s) with so many Web-hosting companies (Most of those cheap once) and Living in fear when and what will happen, I decided to Buy a VPS (Virtual Private Server) or a Dedicated Server. Good VPS cost you $$$ p/a. Cheap once cost you around $100-150 or $200. But they will give you same headache as Cheap Shared Hosting. 1 and 1 UK offering cheap dedicated server deals. It&#8217;s not much of a Server Spec but it sure can handle several websites and they give you TRUE root access and your OWN server to manage. Price also looking good compare to a Good VPS and credible hosting company.</p>
<p>1 and 1 offered Free Plesk 9.0.1 Control Panel with this Dedicated Server as a Standard control panel. I just finished checking firewall settings and even set-up 1 and 1 Free External Cisco Firewall and transfered all my sites to My New Server&#8230;</p>
<p>All working wonderfully. Then I logged into my Blog and started to write an Article and Upload a Image (I use Wordpress!). Image upload returned error that it does not have writing permission for the uploads directory. It usually happens when you move around and you forgot to set the correct permission (CHMOD). Through FTP I Changed permission to uploads folder and tried again. Nope, same error. Again logged into FTP and verified writing permission to uploads folder. It does have necessary permission and it also created a folder where image should be uploaded (Wordpress uses uploads<span style="color: #339966;">/YYYY/MM</span> structure to upload media contents). when I checked the permission for the root folder (YYYY), It does shows that it has writing permission but it&#8217;s owner shows as apache.</p>
<p>This is where I realized that default Apache mod_php is running that it uses apache user to writing / edit files. This will cause trouble when having multiple domains and users on a server. I also know that running PHP using FastCGI would resolve this issue and I remember seeing FastCGI option to run PHP in Plesk.</p>
<p>Logged into my Plesk Control Panel and Changed my Domain Settings to Run PHP as FastCGI Application and restarted Apache through Plesk Service Management. Apache started to give error and did not start. Now I went crazy and started to google what the hell is wrong with FastCGI and Plesk!</p>
<p>It seems they have this issue in earlier version as well due to wrong configuration and bug too. Many forums offered many different solutions, most common one is to Run Plesk php configurator rpm and and this would resolve the issue. Well, I don&#8217;t really want to make a mess with my server and If anything goes wrong, only thing I know is to re-image. Re-imaging server will result in loosing all my data and configurations so far!&#8230;</p>
<p>Finally, on Paralles forums I found a simpler solution. Forum Topic link and Solution In this article to make your life easier.</p>
<p><a href="http://1and1.co.uk/xml/init/?k_id=21520608" target="_blank"><img src="http://banner.1and1.co.uk/xml/banner?size=2&amp;number=3" border="0" alt="" width="468" height="60" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloodyerror.com/2009/07/plesk-9-2-1-fastcgi-apache-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
