<?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>dennishenry.net</title>
	<atom:link href="http://dennishenry.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://dennishenry.net</link>
	<description>ramblings of an IT professional</description>
	<lastBuildDate>Sat, 28 Aug 2010 20:22:07 +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>exim: error while loading shared libraries: libperl.so: wrong ELF class: ELFCLASS32</title>
		<link>http://dennishenry.net/2010/08/28/exim-error-while-loading-shared-libraries-libperl-so-wrong-elf-class-elfclass32/</link>
		<comments>http://dennishenry.net/2010/08/28/exim-error-while-loading-shared-libraries-libperl-so-wrong-elf-class-elfclass32/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 20:22:07 +0000</pubDate>
		<dc:creator>dennis</dc:creator>
				<category><![CDATA[Exim]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[exim]]></category>
		<category><![CDATA[libperl]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://dennishenry.net/?p=98</guid>
		<description><![CDATA[So I ran into a very odd issue with a server today where exim would not start after a CentOS upgrade. The error message was such: exim: error while loading shared libraries: libperl.so: wrong ELF class: ELFCLASS32 This error took awhile to google around for and I couldn&#8217;t find any relevant articles. The problem seemed]]></description>
			<content:encoded><![CDATA[<p>So I ran into a very odd issue with a server today where exim would not start after a CentOS upgrade. The error message was such:</p>
<pre>exim: error while loading shared libraries: libperl.so: wrong ELF class: ELFCLASS32</pre>
<p>This error took awhile to google around for and I couldn&#8217;t find any relevant articles. The problem seemed to obviously be the libperl.so file but perl seemed fine and the file was identical to other server setups with the same version of perl, exim, cPanel, CentOS. I decided to try and rebuild exim with /scripts/eximup &#8211;force but that did nothing to help the situation. Eventually, I found the following command:</p>
<pre>/scripts/eximup --source</pre>
<p>To the best of my knowledge I gained from my research, this recompiles exim from source, converts to an rpm, then installs that. Sure enough, that fixed the issue and exim was running again with no issues. I figured I&#8217;d make this post due to the fact I couldn&#8217;t find one post with the information I needed.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2010/08/28/exim-error-while-loading-shared-libraries-libperl-so-wrong-elf-class-elfclass32/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple IPTables OpenVZ Setup</title>
		<link>http://dennishenry.net/2010/08/02/simple-iptables-openvz-setup/</link>
		<comments>http://dennishenry.net/2010/08/02/simple-iptables-openvz-setup/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 21:02:28 +0000</pubDate>
		<dc:creator>dennis</dc:creator>
				<category><![CDATA[IPTables]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenVZ]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[iptables]]></category>

		<guid isPermaLink="false">http://dennishenry.net/?p=81</guid>
		<description><![CDATA[So after looking and failing to find a good article on how to describe the simple process to set up IPTables on an OpenVZ server, I figured I would write one here. The process is incredibly simple and can be broken down into 3 steps: Empty out the contents of /etc/sysconfig/iptables cat "" > /etc/sysconfig/iptables]]></description>
			<content:encoded><![CDATA[<p>So after looking and failing to find a good article on how to describe the simple process to set up IPTables on an OpenVZ server, I figured I would write one here. The process is incredibly simple and can be broken down into 3 steps:</p>
<ol>
<li>Empty out the contents of /etc/sysconfig/iptables
<pre>cat "" > /etc/sysconfig/iptables</pre>
</li>
<li>Use the following line in /etc/sysconfig/iptables-config:
<pre>IPTABLES_MODULES="ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp"</pre>
</li>
<li>Use the following line in /etc/vz/vz.conf: 
<pre>IPTABLES="ipt_REJECT ipt_tos ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state"</pre>
</li>
</ol>
<p>After ensuring these three things, just stop both vz and iptables, start iptables, then start vz. You should then be able to use iptables within a virtualized container.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2010/08/02/simple-iptables-openvz-setup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Subversion won&#8217;t install</title>
		<link>http://dennishenry.net/2010/07/02/subversion-wont-install/</link>
		<comments>http://dennishenry.net/2010/07/02/subversion-wont-install/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 12:47:08 +0000</pubDate>
		<dc:creator>dennis</dc:creator>
				<category><![CDATA[Common Issues]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://dennishenry.net/?p=67</guid>
		<description><![CDATA[Hello readers! Below is another issue I&#8217;ve seen a few times now and I figured it&#8217;s worth writing a post about. Situation: Client cannot install subversion or another binary on his dedicated or VPS server via yum. They get an error such as: subversion-1.4.2-4.el5_3.1.x86_64 from base has depsolving problems --&#62; Missing Dependency: perl(URI) &#62;= 1.17]]></description>
			<content:encoded><![CDATA[<p>Hello readers!</p>
<p>Below is another issue I&#8217;ve seen a few times now and I  figured it&#8217;s worth writing a post about.</p>
<p>Situation: Client cannot install subversion or another binary on his  dedicated or VPS server via yum. They get an error such as:</p>
<pre>subversion-1.4.2-4.el5_3.1.x86_64 from base has depsolving problems
--&gt; Missing Dependency: perl(URI) &gt;= 1.17 is needed by package  subversion-1.4.2-4.el5_3.1.x86_64 (base)
subversion-1.4.2-4.el5_3.1.i386 from base has depsolving problems
--&gt; Missing Dependency: perl(URI) &gt;= 1.17 is needed by package  subversion-1.4.2-4.el5_3.1.i386 (base)
Error: Missing Dependency: perl(URI) &gt;= 1.17 is needed by package  subversion-1.4.2-4.el5_3.1.i386 (base)
Error: Missing Dependency: perl(URI) &gt;= 1.17 is needed by package  subversion-1.4.2-4.el5_3.1.x86_64 (base)
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
</pre>
<p>To repair this, you have to install perl-URI but it really doesn&#8217;t give  many details as to how. To fix this on CentOS 5.5 just do the following:</p>
<pre>wget  <a href="http://mirror.centos.org/centos-5/5.5/os/x86_64/CentOS/perl-URI-1.35-3.noarch.rpm">http://mirror.centos.org/centos-5/5.5/os/x86_64/CentOS/perl-URI-1.35-3.noarch.rpm</a>
rpm -ivh perl-URI-1.35-3.noarch.rpm</pre>
<p>Then retry the installation via yum for subversion. Please  note, the wget link changes depending on CentOS version. Below is the  link for CentOS 5.4:<a href="http://mirror.centos.org/centos-5/5.4/os/x86_64/CentOS/perl-URI-1.35-3.noarch.rpm"></a></p>
<pre>wget <a href="http://mirror.centos.org/centos-5/5.4/os/x86_64/CentOS/perl-URI-1.35-3.noarch.rpm">http://mirror.centos.org/centos-5/5.4/os/x86_64/CentOS/perl-URI-1.35-3.noarch.rpm</a></pre>
<p>Thank you all for reading and I hope this helps everyone solve  another common issue more quickly and efficiently.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2010/07/02/subversion-wont-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Can&#8217;t change your FTP password?</title>
		<link>http://dennishenry.net/2010/04/10/cant-change-your-ftp-password/</link>
		<comments>http://dennishenry.net/2010/04/10/cant-change-your-ftp-password/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 15:16:24 +0000</pubDate>
		<dc:creator>dennis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[mode]]></category>
		<category><![CDATA[password]]></category>

		<guid isPermaLink="false">http://dennishenry.net/?p=56</guid>
		<description><![CDATA[So I just ran into a very interesting issue on an account. The client was complaining that their client could not access FTP and every time they tried to change the password, the change did not seem to &#8220;take&#8221;. After a bit of research, I figured out that apparently, the account was in a cPanel]]></description>
			<content:encoded><![CDATA[<p>So I just ran into a very interesting issue on an account. The client was complaining that their client could not access FTP and every time they tried to change the password, the change did not seem to &#8220;take&#8221;. After a bit of research, I figured out that apparently, the account was in a cPanel &#8220;Demo&#8221; mode, in which changing of the password sends success messages, but does not actually change the password. To repair this issue, you just need to take the following steps:</p>
<ol>
<li>Log into WHM as root</li>
<li>Go to the &#8220;<strong>D</strong>isable or Enable Demo Mode&#8221; under &#8220;Account Functions&#8221;</li>
<li>Choose the account and Press &#8220;Modify&#8221;</li>
<li>Disable Demo mode!</li>
</ol>
<p>Odd that cPanel doesn&#8217;t provide any notice that the account is in demo mode when changing the password via cPanel but I guess it&#8217;s just another one of those interesting inconstancies within cPanel.</p>
<p>Till next time!</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2010/04/10/cant-change-your-ftp-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scripting IP additions in OpenVZ</title>
		<link>http://dennishenry.net/2010/04/07/scripting-ip-additions-in-openvz/</link>
		<comments>http://dennishenry.net/2010/04/07/scripting-ip-additions-in-openvz/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 20:27:43 +0000</pubDate>
		<dc:creator>dennis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenVZ]]></category>
		<category><![CDATA[assign ip addresses]]></category>

		<guid isPermaLink="false">http://dennishenry.net/?p=49</guid>
		<description><![CDATA[So I just had an interesting issue where I was trying to add 60 IPs to 30 OpenVZ instances, 2 IPs per node. I came up with the following script to do so: #!/bin/bash for i in `vzlist -a &#124; grep -v CTID &#124; awk '{print $1}'` do let k=0 for j in `cat /root/ips`]]></description>
			<content:encoded><![CDATA[<p>So I just had an interesting issue where I was trying to add 60 IPs to 30 OpenVZ instances, 2 IPs per node. I came up with the following script to do so:</p>
<pre>#!/bin/bash
for i in `vzlist -a | grep -v CTID | awk '{print $1}'`
do
     let k=0
     for j in `cat /root/ips`
     do
          if [ $k -lt 2 ]
          then
               vzctl set $i --ipadd $j --save
               let k=k+1
          else
               sed -i '1,2d' /root/ips
               break
          fi
     done
done
</pre>
<p>The main things to note here are the following:</p>
<ul>
<li>When assigning a variable a value in a for loop, you need to use &#8220;let&#8221; before declaring it</li>
<li>SED can be used to remove lines just as it can be used to add and replace items in lines</li>
<li>Break is not something to be afraid of!</li>
</ul>
<p>In any case, this script might be handy for others trying to perform similar tasks so I&#8217;ll just leave it here. Feel free to modify and use this code as you please <img src='http://dennishenry.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Let me know if you have any optimizations you can think of in the comments below.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2010/04/07/scripting-ip-additions-in-openvz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php.ini overwriting with SuPHP</title>
		<link>http://dennishenry.net/2009/10/10/php-ini-overwriting-with-suphp/</link>
		<comments>http://dennishenry.net/2009/10/10/php-ini-overwriting-with-suphp/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 17:40:21 +0000</pubDate>
		<dc:creator>dennis</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[suPHP]]></category>
		<category><![CDATA[overwriting defaults]]></category>

		<guid isPermaLink="false">http://dennishenry.net/?p=45</guid>
		<description><![CDATA[Just a quick note on this: When overwriting a value for a single site using php.ini, I highly suggest copying the root level php.ini (located at /usr/local/lib/php.ini for most suPHP enabled Linux servers) to the directory in question, changing the one value needed, then chowning the file to the user, rather than making your own]]></description>
			<content:encoded><![CDATA[<p>Just a quick note on this:</p>
<p>When overwriting a value for a single site using php.ini, I highly suggest copying the root level php.ini (located at /usr/local/lib/php.ini for most suPHP enabled Linux servers) to the directory in question, changing the one value needed, then chowning the file to the user, rather than making your own custom php.ini with one line of the value that is being overwritten. The reasoning behind this is that when you make an empy php.ini with just the one directive, many issues including but not limiting to the following arise:</p>
<ul>
<li>safe_mode defaults to On instead of Off</li>
<li>pdo or any other includes such as zend or ioncube are no longer loaded</li>
<li>disable_functions line is nullified</li>
</ul>
<p>Anyways, just a tip for anyone out there using such changes! Let me know if you have any questions about this in the comments!</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2009/10/10/php-ini-overwriting-with-suphp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CPUwatch</title>
		<link>http://dennishenry.net/2009/06/08/cpuwatch/</link>
		<comments>http://dennishenry.net/2009/06/08/cpuwatch/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 20:01:27 +0000</pubDate>
		<dc:creator>dennis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[cpuwatch]]></category>

		<guid isPermaLink="false">http://dennishenry.net/?p=42</guid>
		<description><![CDATA[Hello everyone! This is just a quick post because it came to my attention today that many do not know about the cpuwatch command included within cPanel to assist with running commands that cause intense server load. The use is as follows: /usr/local/cpanel/bin/cpuwatch LOADAVG COMMAND As an example would be: /usr/local/cpanel/bin/cpuwatch 8 cp -r /home/username/public_html/*]]></description>
			<content:encoded><![CDATA[<p>Hello everyone!</p>
<p>This is just a quick post because it came to my attention today that many do not know about the cpuwatch command included within cPanel to assist with running commands that cause intense server load. The use is as follows:</p>
<pre>/usr/local/cpanel/bin/cpuwatch LOADAVG COMMAND</pre>
<p>As an example would be:</p>
<pre>/usr/local/cpanel/bin/cpuwatch 8 cp -r /home/username/public_html/* /home2/username/public_html/</pre>
<p>This would run the cp command but ensure that the load does not rise above 8. If it did, the command would pause until the load decreased then start again. I highly suggest using this in all situations where load averages are varying and complex commands are being run during prime time.</p>
<p>Let me know if you have any questions on this in the comments.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2009/06/08/cpuwatch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Common Issues &#8211; Maxed out Apache Connections</title>
		<link>http://dennishenry.net/2009/04/16/maxed-out-apache-connections/</link>
		<comments>http://dennishenry.net/2009/04/16/maxed-out-apache-connections/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 12:54:59 +0000</pubDate>
		<dc:creator>dennis</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Common Issues]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[connections]]></category>

		<guid isPermaLink="false">http://blog.dennishenry.net/?p=26</guid>
		<description><![CDATA[Hello everyone! This week in &#8220;Common Issues&#8221;, we will be discussing the ever common &#8220;ran out of connections&#8221; issues many clients with very big websites see daily. This problem is a fairly simple solution but it is a easily missed one that many technicians don&#8217;t fully complete and leave half done. The first step is]]></description>
			<content:encoded><![CDATA[<p>Hello everyone!</p>
<p>This week in &#8220;Common Issues&#8221;, we will be discussing the ever common &#8220;ran out of connections&#8221; issues many clients with very big websites see daily. This problem is a fairly simple solution but it is a easily missed one that many technicians don&#8217;t fully complete and leave half done. The first step is to check to ensure that the client is indeed running out of connections and that the error isn&#8217;t coming from some other place. The best way to discover if they are out of connections is by doing the following command:</p>
<pre>/etc/init.d/httpd status</pre>
<p>If you see no periods (.) and all letters in the status line, then the client is indeed out of connections. To increase it, firstly, we need to make sure they are using Apache 2.2 or higher. You can check this by looking at the top of the last command and checking the version mentioned. If it is greater than 2.0 then we can go on and make the change needed:</p>
<pre>root@server [~]# /etc/init.d/httpd status
Apache Server Status for localhost
Server Version: Apache/2.2.13 (Unix) mod_ssl/2.2.13
....</pre>
<p>The change itself, is very easy to make but requires two steps. Step one is to open up /usr/local/apache/conf/httpd.conf and make the following additions (I make them typically right after the top comment in the file:</p>
<pre>ServerLimit NEW_MAX_CONNECTIONS
MaxClients NEW_MAX_CONNECTIONS</pre>
<p>Where NEW_MAX_CONNECTIONS is the new max connections level you would like. Now step 1 is complete. Step 2 is incredibly important as well. You must run the following command to distill your changes to the file:</p>
<pre>/usr/local/cpanel/bin/apache_conf_distiller --update</pre>
<p>Without running that command, your changes will not be distilled and the next time apache is rebuilt, your changes will be lost. Finally, lets restart Apache and run status again to see if the change is committed. If you see more lines then previously, you now have more allowed connections!</p>
<p>Thank you for reading and stay tuned!</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2009/04/16/maxed-out-apache-connections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Common Issues &#8211; Easyapache failing</title>
		<link>http://dennishenry.net/2009/04/04/easyapache-failing/</link>
		<comments>http://dennishenry.net/2009/04/04/easyapache-failing/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 12:41:08 +0000</pubDate>
		<dc:creator>dennis</dc:creator>
				<category><![CDATA[Common Issues]]></category>
		<category><![CDATA[Easyapache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[cPanel]]></category>

		<guid isPermaLink="false">http://blog.dennishenry.net/?p=23</guid>
		<description><![CDATA[Figured my &#8220;Common Issues&#8221; posts this week would be a little more specific and simple then the last few. This is an issue i&#8217;ve been noticing a new issue off and on with servers recently where easyapache will not work and fails with the following error: root@server [~]# /scripts/easyapache Acme::Spork version v0.0.8 required--this is only]]></description>
			<content:encoded><![CDATA[<p>Figured my &#8220;Common Issues&#8221; posts this week would be a little more specific and simple then the last few. This is an issue i&#8217;ve been noticing a new issue off and on with servers recently where easyapache will not work and fails with the following error:</p>
<pre>root@server [~]# /scripts/easyapache
Acme::Spork version v0.0.8 required--this is only version v0.0.7  at /var/cpanel/perl/easy/Cpanel/Easy/Utils/BackGround.pm line 14.
BEGIN failed--compilation aborted at <em>/var/cpanel/perl/easy/Cpanel/Easy/</em>Utils/BackGround.pm line 14.
Compilation failed in require at (eval 18) line 3.
 ...propagated at /usr/lib/perl5/5.8.8/base.pm line 85.
 at (eval 16) line 3
 at /var/cpanel/perl/easy/Cpanel/Easy.pm line 15
BEGIN failed--compilation aborted at <em>/var/cpanel/perl/easy/Cpanel/</em>Easy.pm line 15.
Compilation failed in require at (eval 1) line 3.
 ...propagated at /usr/lib/perl5/5.8.8/base.pm line 85.
BEGIN failed--compilation aborted at <em>/var/cpanel/perl/easy/Cpanel/Easy/</em>Apache.pm line 8.
Compilation failed in require at /scripts/easyapache line 23.</pre>
<p>In order to repair this, all you must do is install the Acme::Spork version v.0.0.8 that it requests. To do that just use the following commands:</p>
<pre>root@server [~]# perl -MCPAN -e shell
cpan&gt; install Acme::Spork</pre>
<p>(Note: &#8220;cpan&gt;&#8221; is a shell prompt, not part of the command)</p>
<p>This solves the issue with easyapache and allows you in. Please let me know if you have any issues with this solution, please post in the comments so all can benefit from any questions.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2009/04/04/easyapache-failing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Common Issues &#8211; Main Drive Full (Mounting Issues)</title>
		<link>http://dennishenry.net/2009/03/27/main-drive-full/</link>
		<comments>http://dennishenry.net/2009/03/27/main-drive-full/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 12:54:59 +0000</pubDate>
		<dc:creator>dennis</dc:creator>
				<category><![CDATA[Common Issues]]></category>
		<category><![CDATA[Drives]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[full]]></category>

		<guid isPermaLink="false">http://blog.dennishenry.net/?p=20</guid>
		<description><![CDATA[So the recent problems with a server at my job and a few issues I&#8217;ve seen of recent gave me an idea for a new Common Issues post. This one is based on the common issue of the main drive being full and various mounting issues. As always, this email comes with all the disclaimers]]></description>
			<content:encoded><![CDATA[<p>So the recent problems with a server at my job and a few issues I&#8217;ve seen of recent gave me an idea for a new Common Issues post. This one is based on the common issue of the main drive being full and various mounting issues. As always, this email comes with all the disclaimers previously mentioned, as well as the biggy below:</p>
<p><strong><span style="color: #ff0000;">* PLEASE DO NOT RUN ANY COMMANDS FOUND IN THIS EMAIL WITHOUT FULLY UNDERSTANDING WHAT THEY DO AND THE RESULT THEY CREATE *</span></strong></p>
<p>Issue (Note: This only applies to our shared and reseller servers so we can assume they have a separate backup drive):</p>
<p>Client contacts us saying that they cannot receive email, their site is down, and FTP is throwing errors. A good thing to check is the drive usage of the server to ensure that it is not full. This can be done by using the command &#8220;df -h&#8221; which returns similar output as below:</p>
<pre>root@server [~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda5             104G   11G   88G  11% /
/dev/hda1              99M   32M   63M  34% /boot
/dev/hda2             2.9G   80M  2.7G   3% /tmp
/dev/mapper/nvidia_dbechcfep1     917G   27G  844G   4% /home
/dev/mapper/nvidia_dbechcfep2     917G   72G  799G   9% /backup</pre>
<p>This output can be interpreted as follows:</p>
<ul>
<li>Filesystem &#8211; This is the Block location of the partition in question. This can be read as follows:
<ul>
<li>- /dev/ (Device) h (Drive Interface; h = ata; s = sata) d (Drive) a (Drive Letter; can be a,b,c,etc.. depending on number of drives) 1(Partition Number; can be 1,2,3,etc&#8230; depending on number of partitions)</li>
<li>Size &#8211; Total size of the partition</li>
<li>Used &#8211; Total amount of disk space used on the partition</li>
<li>Avail &#8211; Total amount of disk space available on the partition</li>
<li>Use% &#8211; Total amount of disk space used/Total amount of disk space in percentage form</li>
<li>Mounted On &#8211; Location the partition is mounted on the filesystem</li>
</ul>
</li>
</ul>
<p>If you see a 0 in Avail or a 100% in Use% next to the drive mounted on / then you have found your issue. Now to solve it. The best thing to check for this is backups. First, check if there is a backup drive on the server using the following command:</p>
<pre>cat /etc/fstab | grep -r backup</pre>
<p>If the output of this command is similar to below (or it outputs anything really) then there is a backup drive:</p>
<pre>root@server [~]# cat /etc/fstab | grep -r backup
/dev/mapper/nvidia_dbechcfep2        /backup                  ext3    defaults,noauto        0 0</pre>
<p>Also, check and see if the backup drive is currently mounted. If it is, go ahead and unmount it so you can get a better look at the / filesystem. You can do this by using the &#8216;umount&#8217; command as below:</p>
<pre>umount /backup</pre>
<p>If this outputs &#8220;This Drive is busy&#8221;, then you get to the more complex part. Finding out why it&#8217;s busy. To do this, we will use the &#8216;lsof&#8217; command. This command is run on a block device such as below:</p>
<pre>root@server [~]# lsof /dev/hda2
COMMAND  PID   USER   FD   TYPE DEVICE  SIZE   NODE NAME
mysqld  5294  mysql    4u   REG    3,2     0     13 /tmp/ibb2mUbP (deleted)
mysqld  5294  mysql    5u   REG    3,2    69     14 /tmp/ibWiEoN3 (deleted)
mysqld  5294  mysql    6u   REG    3,2     0     15 /tmp/ib0O7Soi (deleted)
mysqld  5294  mysql    7u   REG    3,2     0     16 /tmp/ibuN6K0w (deleted)
mysqld  5294  mysql   11u   REG    3,2     0     17 /tmp/ibxm1GDL (deleted)
jsvc    6106 tomcat  mem    REG    3,2 32768 351650 /tmp/hsperfdata_tomcat/6106
cpdavd  8729   root    0r   REG    3,2 16671     72 /tmp/sh-thd-1238113224 (deleted)</pre>
<p>As you can see, in my example I used my /tmp/ partition and the lsof command told me that there are three separate unique processes using the partition; MySQL, JSVC (Java Server Virtual Console), and cpdavd (cPanel). In order to unmount this partition successfully, I will need to end these processes. When available, use the stop scripts available to you such as the following in my case:</p>
<pre>/etc/init.d/mysql stop
/etc/init.d/jsvc stop
/etc/init.d/cpanel stop</pre>
<p>Once these processes are stopped, you should be able to unmount. If the process doesn&#8217;t have a stop script or perhaps if it is cpbackup or a similar script running, you will need to kill the process using the &#8216;kill&#8217; command. Find the PID of the process from the output of lsof and use it as accordingly:</p>
<pre>kill -9 5294</pre>
<p>In my example I killed the MySQL process that was running on the server with PID 5294. Obviously, this number will differ depending on the server, time, etc. Once lsof is showing no output, you should be able to unmount and proceed with cleaning the main drive. This can be done by just removing the backups on the main drive with rm -rf. Once the rm has been running a few minutes, go ahead and open a second SSH session and start restarting services that had been failing due to no disk space such as cPanel, MySQL, Exim, and HTTPD. Once the rm is complete, go ahead and remount the /backup/ drive.</p>
<p><strong>Please note:</strong> The drive mounting and unmounting portion of this email can be used in more cases then just the drive being full. Sometimes, /tmp/ can be having an issue that unmounting and mounting can solve and a similar process as above would be required.</p>
<p>Also, Note this is just one solution for a main drive being full. Though this is the most common issue, it is not the only problem that could arise. Other issues like core dumps from PHP can quickly fill a drive or just plain usage. For core dumps, you can use a script such as below to locate core dumps to remove:</p>
<pre>find /home/ -iname "core.*"</pre>
<p>This will locate all core dumps in user directories so you can delete them and inform the client of their broken script. Also, if the drive is as far as you can see, legitimately full (backups on backup drive and no core dumps), please do not hesitate to email abuseteam@hostdime.com and CC the office and the NOC about the issue so Abuse can check for abusive users to remove or the NOC can look into restoring the server as soon as possible.</p>
<p>As with all of my Common Issues posts, please do not hesitate to ask any questions on this email by replying all to it so that all can benefit from the question and answer. If you are unsure on anything in this email also, do not hesitate to ask me or any other senior staff about the issue and possible resolutions.</p>
<p>Thanks for reading and have a great day!</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2009/03/27/main-drive-full/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->