<?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>dennis henry &#187; Linux</title>
	<atom:link href="http://dennishenry.net/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://dennishenry.net</link>
	<description>ramblings of an IT professional</description>
	<lastBuildDate>Mon, 26 Sep 2011 16:50:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Common Issues &#8211; No Networking on new OpenVZ VPS</title>
		<link>http://dennishenry.net/2011/03/23/common-issues-no-networking-on-new-openvz-vps/</link>
		<comments>http://dennishenry.net/2011/03/23/common-issues-no-networking-on-new-openvz-vps/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 22:42:21 +0000</pubDate>
		<dc:creator>dennis</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Common Issues]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[OpenVZ]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[resolv.conf]]></category>
		<category><![CDATA[venet0]]></category>

		<guid isPermaLink="false">http://dennishenry.net/?p=129</guid>
		<description><![CDATA[Hello all,
Today I ran into an interesting issue where a VPS had no networking either inbound or outbound after setup. This is the error that would present when restarting network via init.d:

Bringing up interface venet0:
SIOCADDRT: Network is unreachable
SIOCADDRT: Network is unreachable

This  [...]]]></description>
			<content:encoded><![CDATA[<p>Hello all,</p>
<p>Today I ran into an interesting issue where a VPS had no networking either inbound or outbound after setup. This is the error that would present when restarting network via init.d:</p>
<pre>
Bringing up interface venet0:
SIOCADDRT: Network is unreachable
SIOCADDRT: Network is unreachable
</pre>
<p>This issue also presented in that cPanel licenses could not activate not could any ping or host commands work properly. I eventually narrowed down the issue to the fact that the IPs that had been added to the VPS were not properly set to ARP by checking with the following command (run on the node):</p>
<pre>
arp | grep [INSERT IP HERE]
</pre>
<p>In order to resolve this, all I needed to do was add the arp entries for the IPs on the actual virtual environment by running the following commands on the node:</p>
<pre>
arp -s [INSERT IP HERE] `ifconfig eth0 | grep eth0 | awk '{print $5}'` pub
</pre>
<p>Make sure you run the command above for every IP on the VPS. This resolved the issue and all networking started working again properly.</p>
]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2011/03/23/common-issues-no-networking-on-new-openvz-vps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Total Memory on a Xen Node</title>
		<link>http://dennishenry.net/2010/11/22/total-memory-on-a-xen-node/</link>
		<comments>http://dennishenry.net/2010/11/22/total-memory-on-a-xen-node/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 17:53:36 +0000</pubDate>
		<dc:creator>dennis</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[memory usage]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://dennishenry.net/?p=112</guid>
		<description><![CDATA[I ran into an interesting issue the other day that I figured I&#8217;d make a post about in order for others. Since my company is getting more into Xen Hosting, I&#8217;ve tried to be at the forefront of the virtualization software for the company. We did run into an interesting issue though the other day when  [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into an interesting issue the other day that I figured I&#8217;d make a post about in order for others. Since my company is getting more into Xen Hosting, I&#8217;ve tried to be at the forefront of the virtualization software for the company. We did run into an interesting issue though the other day when it came to determining the total amount of memory on a hardware node. Since we set up the Domain-0 to use only 512MB of memory, we were having a tough time determining how much total RAM is in the server. After googling for awhile and asking some co-workers, I discovered the following command:</p>
<pre>xm info</pre>
<p>This command shows quite a few interesting metrics including the total memory for the server. Using this I was able to easily discern the total amount of memory and write a quick script to compute total amount of memory:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #007800;">total_memory</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>xm info <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> total_memory <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $3}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">remaining</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>xm info <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> free_memory <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $3 - 512}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #007800;">used_memory</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>total_memory-remaining<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'Total Memory:\t'</span><span style="color: #007800;">$total_memory</span><span style="color: #ff0000;">'MB ('</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>total_memory<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1024</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">'GB)'</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'Memory Used:\t'</span><span style="color: #007800;">$used_memory</span><span style="color: #ff0000;">'MB ('</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>used_memory<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1024</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">'GB)'</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'Remaining:\t'</span><span style="color: #007800;">$remaining</span><span style="color: #ff0000;">'MB ('</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>remaining<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1024</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">'GB)'</span></pre></td></tr></table></div>

<p>Hope this helps anyone else trying to figure out accurate Xen Memory usage</p>
]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2010/11/22/total-memory-on-a-xen-node/feed/</wfw:commentRss>
		<slash:comments>2</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 ""   [...]]]></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>
]]></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  [...]]]></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.6 just do the following:</p>
<pre>wget  <a href="http://mirror.centos.org/centos-5/5.6/os/x86_64/CentOS/perl-URI-1.35-3.noarch.rpm">http://mirror.centos.org/centos-5/5.6/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. For Centos 5.5:</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>And for CentOS 5.4:</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>
rpm -ivh perl-URI-1.35-3.noarch.rpm</pre>
<p>Thank you all for reading and I hope this helps everyone solve  another common issue more quickly and efficiently.</p>
]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2010/07/02/subversion-wont-install/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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
for i in `vzlist -a &#124; grep -v CTID &#124; awk '{print $1}'`
do
     let k=0
     for j in `cat  [...]]]></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>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>vzlist <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> CTID <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">do</span>
     <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">k</span>=<span style="color: #000000;">0</span>
     <span style="color: #000000; font-weight: bold;">for</span> j <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>ips<span style="color: #000000; font-weight: bold;">`</span>
     <span style="color: #000000; font-weight: bold;">do</span>
          <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$k</span> <span style="color: #660033;">-lt</span> <span style="color: #000000;">2</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
          <span style="color: #000000; font-weight: bold;">then</span>
               vzctl <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">$i</span> <span style="color: #660033;">--ipadd</span> <span style="color: #007800;">$j</span> <span style="color: #660033;">--save</span>
               <span style="color: #7a0874; font-weight: bold;">let</span> <span style="color: #007800;">k</span>=k+<span style="color: #000000;">1</span>
          <span style="color: #000000; font-weight: bold;">else</span>
               <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">'1,2d'</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>ips
               <span style="color: #7a0874; font-weight: bold;">break</span>
          <span style="color: #000000; font-weight: bold;">fi</span>
     <span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<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>
]]></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>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[cPanel]]></category>
		<category><![CDATA[Linux]]></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  [...]]]></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>
]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2009/06/08/cpuwatch/feed/</wfw:commentRss>
		<slash:comments>3</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[cPanel]]></category>
		<category><![CDATA[Linux]]></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.  [...]]]></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>
]]></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[cPanel]]></category>
		<category><![CDATA[Easyapache]]></category>
		<category><![CDATA[Linux]]></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 [~]#  [...]]]></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>
]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2009/04/04/easyapache-failing/feed/</wfw:commentRss>
		<slash:comments>2</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 previously  [...]]]></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>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>
]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2009/03/27/main-drive-full/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Common Issues &#8211; MySQL Connectivity Issues</title>
		<link>http://dennishenry.net/2009/03/09/mysql-connectivity-issue/</link>
		<comments>http://dennishenry.net/2009/03/09/mysql-connectivity-issue/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 11:10:56 +0000</pubDate>
		<dc:creator>dennis</dc:creator>
				<category><![CDATA[Common Issues]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://blog.dennishenry.net/?p=17</guid>
		<description><![CDATA[This week on Common Issues and their Solutions, we will be tackling the common, yet annoying, MySQL connection issues that many of clients see daily. This issue is typically much more simple than it may seem so let&#8217;s see if we can hammer it out together.
Client submits a ticket saying his WordPress  [...]]]></description>
			<content:encoded><![CDATA[<p>This week on Common Issues and their Solutions, we will be tackling the common, yet annoying, MySQL connection issues that many of clients see daily. This issue is typically much more simple than it may seem so let&#8217;s see if we can hammer it out together.</p>
<p>Client submits a ticket saying his WordPress installation is not working correctly and just showing a very plain error &#8220;WordPress cannot connect to Database&#8221;. The error is nondescript but we can use a set route to find the solution quickly.</p>
<p>Step 1: Check the MySQL service. You would be surprised how many times the MySQL service has just died or is overloaded and just needs to be restarted. This is a quick and painless restart typically so it is not a pain to do.</p>
<p>Check MySQL Status with: /etc/init.d/mysql status -OR- Through Service Status in WHM</p>
<p>Restart MySQL with: /scripts/restartsrv_mysql -OR- Through Restart MySQL in WHM</p>
<p>If the status is either okay or restarting the service did not fix the problem, move on to step 2.</p>
<p>Step 2: Check the user account and ensure they are connecting to the database correctly.</p>
<p>To check this with the least amount of steps and most accuracy, first check the configuration file for the given software the client is having an issue with. Since our example is WordPress, we will go on that. WordPress stores all of its database connection information in a flat file named wp-config.php in the root directory of the WordPress installation. You will find the following variables:</p>
<pre>define('DB_NAME', 'dennis_wrdp1');
define('DB_USER', 'dennis_wrdp1');
define('DB_PASSWORD', 's3kr3t!1');</pre>
<p>These three variables are pretty obviously named as far as letting you know what they do. Once you have these variables, test out the connection by using the following command:</p>
<pre>mysql -u USERNAME -p</pre>
<p>MySQL will then prompt you for the password. Provide that and if it shows the following error:</p>
<pre>ERROR 1045 (28000): Access denied for user 'dennis_wrdp1'@'localhost' (using password: YES)</pre>
<p>Then we have located the issue. To fix it, we will need to repair the password that MySQL is expecting. The easiest way to do this is just use the following commands:</p>
<pre>mysql // enter mysql as root
USE mysql; // select the mysql database to manipulate
UPDATE user SET password=PASSWORD('INSERTNEWPASSHERE') where User='USERNAMEHERE'; // updates the password
FLUSH privileges; // push all changes live
exit;</pre>
<p>-OR- in WHM you can use the &#8220;Change a User or Database Password&#8221; tool and select the user in the drop down and insert the correct password into the &#8220;New Password&#8221; box.</p>
<p>Please note: These steps should only be taken given that the user is using a MySQL user account OTHER than their main account (ie. If in the example I had been using &#8220;dennis&#8221; to connect to my database). In that case, you will need to get the user&#8217;s cPanel password and update the WordPress configuration to reflect it rather then this route as the user has just updated his cPanel password but not the configuration for their WordPress installation.</p>
<p>This should solve 99% of MySQL connection problems and the hardest part will just be locating the DB configuration file. At times, the error message says it can&#8217;t connect and the error shows the mysql_connect line but hunting down the actual variables it uses is a bit of an easter egg hunt as the user may have multiple useless files and variables that could be scattered wildly for no apparent reason. Being able to follow the trail of included files, and their included files to find the missing information can be complex but valuable. My one big tip is: If there is not a clear &#8216;variables.php&#8217; or &#8216;vars.php&#8217; or &#8216;db.php&#8217; but rather just &#8216;header.php&#8217;, &#8216;body.php&#8217;, and &#8216;footer.php&#8217;, check the header.php for an include to a more obvious file.</p>
<p>Note: If you cannot find the configuration file in about 5 minutes, then the user is hiding it far too well for a novice and they can likely assist you in finding it. Ask them for more information and they will likely be able to help. Also, most commercial PHP applications such as WordPress and Drupal have a set file such as Configuration.php or wp_config.php that contain all of this information. Check these files if you know the PHP application is a typical commercial application.</p>
<p>That rounds up this week&#8217; Common Issues and their solutions. If you have any questions on this email, please feel free to contact me and I&#8217;ll do my best to help you out.</p>
]]></content:encoded>
			<wfw:commentRss>http://dennishenry.net/2009/03/09/mysql-connectivity-issue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.949 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-07 05:22:38 -->

