<?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>/proc/sys/net/blog &#187; cpanel</title>
	<atom:link href="http://momotonic.com/category/cpanel/feed/" rel="self" type="application/rss+xml" />
	<link>http://momotonic.com</link>
	<description>rants, tutorials and documents about everything server related</description>
	<lastBuildDate>Tue, 14 Jul 2009 15:55:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Small application for disabling mod_security for specific domains on cPanel server</title>
		<link>http://momotonic.com/2009/07/14/small-application-for-disabling-mod_security-for-specific-domains-on-cpanel-server/</link>
		<comments>http://momotonic.com/2009/07/14/small-application-for-disabling-mod_security-for-specific-domains-on-cpanel-server/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 15:30:29 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[cpanel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mod_security]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[disable mod_security2]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[small script]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=46</guid>
		<description><![CDATA[Alright, I&#8217;m lazy so I always make a script/utility for anything and everything. Another fine piece of lazygineering.
This little script disables mod_security on specific domains that you pick, mod_security2 does not allow disabling it from .htaccess and it&#8217;s pretty annoying to do the same work all over and over again, why not make it one [...]]]></description>
			<content:encoded><![CDATA[<p>Alright, I&#8217;m lazy so I always make a script/utility for anything and everything. Another fine piece of lazygineering.</p>
<p>This little script disables mod_security on specific domains that you pick, mod_security2 does not allow disabling it from .htaccess and it&#8217;s pretty annoying to do the same work all over and over again, why not make it one line only. <img src='http://momotonic.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Introducing, disable_modsec &#8212; Enjoy lazy cPanel server admins.</p>
<p><code>#!/usr/bin/perl</p>
<p>use strict;<br />
use lib qw(/usr/local/cpanel);<br />
use Cpanel::AcctUtils::DomainOwner;</p>
<p>if ($ARGV[0])<br />
{<br />
  # Get username<br />
  my $username = Cpanel::AcctUtils::DomainOwner::getdomainowner($ARGV[0]);<br />
  my $domain = $ARGV[0];</p>
<p>  # Create directory for config<br />
  system ('mkdir -p /usr/local/apache/conf/userdata/std/2/'.$username.'/'.$domain);</p>
<p>  # Create config file<br />
  open (CONFIG, ">>/usr/local/apache/conf/userdata/std/2/".$username.'/'.$domain.'/modsec.conf');<br />
  print CONFIG "<IfModule mod_security2.c>\nSecRuleEngine Off\n</IfModule>";<br />
  close CONFIG;</p>
<p>  # Enable vHost includes<br />
  system ('/scripts/ensure_vhost_includes --user='.$username);<br />
} else {<br />
  print("Usage: disable_modsec [domain]\n");<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2009/07/14/small-application-for-disabling-mod_security-for-specific-domains-on-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful little bit of code &#8211; List all domains on cPanel server</title>
		<link>http://momotonic.com/2009/07/02/useful-little-bit-of-code-list-all-domains-on-cpanel-server/</link>
		<comments>http://momotonic.com/2009/07/02/useful-little-bit-of-code-list-all-domains-on-cpanel-server/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 14:33:07 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[cpanel]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=41</guid>
		<description><![CDATA[Need to list all domains on the server (no subdomains, etc)?
Here&#8217;s the magical code:
cat /etc/userdomains &#124; awk -F ':' '{ print $1 }' &#124; sed 's/.*\.\(.*\.\)/\1/' &#124; sort -u
]]></description>
			<content:encoded><![CDATA[<p>Need to list all domains on the server (no subdomains, etc)?</p>
<p>Here&#8217;s the magical code:</p>
<p><code>cat /etc/userdomains | awk -F ':' '{ print $1 }' | sed 's/.*\.\(.*\.\)/\1/' | sort -u</code></p>
]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2009/07/02/useful-little-bit-of-code-list-all-domains-on-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>cPanel humor: Uninstalling cPanel</title>
		<link>http://momotonic.com/2009/06/20/cpanel-humor-uninstalling-cpanel/</link>
		<comments>http://momotonic.com/2009/06/20/cpanel-humor-uninstalling-cpanel/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 17:16:13 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[cpanel]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[humor]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=33</guid>
		<description><![CDATA[It&#8217;s always been known that once you install cPanel, you cannot uninstall it, the only way to get rid of it reinstall the server completely.  However, I was doing some work on a server and ran into this file:
/usr/local/cpanel/uninstall
And the content:
#!/bin/sh
# Uninstall script for Cpanel
rm -f "/usr/local/cpanel/uninstall"
#### END OF UNINSTALL
echo "Cpanel has been uninstalled."
Nice [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s always been known that once you install cPanel, you cannot uninstall it, the only way to get rid of it reinstall the server completely.  However, I was doing some work on a server and ran into this file:</p>
<p><code>/usr/local/cpanel/uninstall</code></p>
<p>And the content:<br />
<code>#!/bin/sh<br />
# Uninstall script for Cpanel<br />
rm -f "/usr/local/cpanel/uninstall"<br />
#### END OF UNINSTALL<br />
echo "Cpanel has been uninstalled."</code></p>
<p>Nice to know that developers still have a sense of humor.  cPanel&#8217;s developers are always known to be down to earth guys and I can assure you that&#8217;s true! (not if that little bit of code in a production program didn&#8217;t prove it! <img src='http://momotonic.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> )</p>
]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2009/06/20/cpanel-humor-uninstalling-cpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Horde broken or not working correctly on cPanel server</title>
		<link>http://momotonic.com/2009/01/05/horde-broken-or-not-working-correctly-on-cpanel-server/</link>
		<comments>http://momotonic.com/2009/01/05/horde-broken-or-not-working-correctly-on-cpanel-server/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 18:00:44 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[cpanel]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[horde]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[quick fix]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[short fix]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=28</guid>
		<description><![CDATA[Simple, short &#038; sweet post, this should easily fix any problems you&#8217;re having
/usr/local/cpanel/bin/update-horde --force
Also, this might be useful to run hourly, I leave this on our servers &#8220;just in case&#8221;.
(mysqlcheck --auto-repair eximstats ; mysqlcheck --auto-repair horde) >/dev/null 2>/dev/null
]]></description>
			<content:encoded><![CDATA[<p>Simple, short &#038; sweet post, this should easily fix any problems you&#8217;re having</p>
<p><code>/usr/local/cpanel/bin/update-horde --force</code></p>
<p>Also, this might be useful to run hourly, I leave this on our servers &#8220;just in case&#8221;.</p>
<p><code>(mysqlcheck --auto-repair eximstats ; mysqlcheck --auto-repair horde) >/dev/null 2>/dev/null</code></p>
]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2009/01/05/horde-broken-or-not-working-correctly-on-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Migrating cPanel reseller accounts with root WHM access</title>
		<link>http://momotonic.com/2008/12/30/migrating-cpanel-reseller-accounts-with-root-whm-access/</link>
		<comments>http://momotonic.com/2008/12/30/migrating-cpanel-reseller-accounts-with-root-whm-access/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 21:36:38 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[backup]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[migrating]]></category>
		<category><![CDATA[migrating reseller account]]></category>
		<category><![CDATA[reseller]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=23</guid>
		<description><![CDATA[We have a few clients that were WHM resellers and upgraded to VPS with root cPanel, however there is no main easy way to migrate WHM reseller account to a root account under WHM, that&#8217;s where we started playing around and making our own script.  You need root access to the source and final [...]]]></description>
			<content:encoded><![CDATA[<p>We have a few clients that were WHM resellers and upgraded to VPS with root cPanel, however there is no main easy way to migrate WHM reseller account to a root account under WHM, that&#8217;s where we started playing around and making our own script.  You need root access to the source and final server to do this, this looks like the fastest way to do this at the moment.</p>
<p>First of all, we need to get all the accounts and create a backup of their accounts, this is done using a couple of bash lines and parsing the file <code>/etc/trueuserowners</code>.  That file contains every account on the server and the accounts that own it.  This following will go over that file, take out the resellers accounts and back them up one by one.  The best way to make sure no mistake happens is to ensure that <code>/home</code> or <code>/home2</code> or any other <code>/home</code> directories because the <code>/scripts/pkgacct</code> creates them there.  We also use <code>cpuwatch</code> not to create excessive load on the server when creating the backup.  It will stop the process once load averages go higher than 10.</p>
<p><code>for i in `cat /etc/trueuserowners | grep <strong>resellerusername</strong> | awk -F ':' '{ print $1; }'`;<br />
do /usr/local/cpane/bin/cpuwatch 10 /scripts/pkgacct $i;<br />
done;</code></p>
<p>Usually this takes a while so this is what you can do if it&#8217;s halfway done to save time</p>
<p><code>/usr/bin/rsync --delete -avvxHt --progress -e ssh /home/cpmove-* 1.2.3.4:~</code></p>
<p>This will start moving the files from the old server to the new one, we use <code>rsync</code> so that we can just run it again after the full backup is done so we don&#8217;t have to restart the whole process again.  Once it&#8217;s done and all data has been moved, another loop, I did this one quickly however I think it could be cleaner, if someone has a better way to do with (regexp?), please let me know.</p>
<p><code>for i in `ls | grep cpmove- | awk -F '.' '{ print $1 }' | awk -F '-' '{ print $2 }'`;<br />
do /scripts/restorepkg $i;<br />
done;</code></p>
<p>After finishing that, you should be all done!</p>
]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2008/12/30/migrating-cpanel-reseller-accounts-with-root-whm-access/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>/tmp clean-up script modification, sessions dying with PHP</title>
		<link>http://momotonic.com/2008/11/28/tmp-clean-up-script-modification-sessions-dying-with-php/</link>
		<comments>http://momotonic.com/2008/11/28/tmp-clean-up-script-modification-sessions-dying-with-php/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 13:11:18 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[cpanel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql.sock]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tmp]]></category>
		<category><![CDATA[cleanup]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[timeout]]></category>
		<category><![CDATA[tmpcleanup]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=19</guid>
		<description><![CDATA[It seems there there was a little flaw in the script that I wrote a while ago, any PHP sessions on the server will timeout/die after 1 hour if you run that as an hourly cronjob, I have made a small modification to the script.
The only small modification is that now, it deletes all sess_* [...]]]></description>
			<content:encoded><![CDATA[<p>It seems there there was a little flaw in the script that I wrote a while ago, any PHP sessions on the server will timeout/die after 1 hour if you run that as an hourly cronjob, I have made a small modification to the script.</p>
<p>The only small modification is that now, it deletes all <code>sess_*</code> files that have not been accessed for 5 days therefore are probably just sitting there and never going to be used again, the rest remain deleted because it&#8217;s failed uploads/etc that will never be used again.</p>
<p><code><br />
#!/bin/bash</p>
<p># Change directory to /tmp<br />
cd /tmp</p>
<p># Clean up trash left by Gallery2<br />
ls | grep '[0-9].inc*' | xargs rm -fv</p>
<p># Clean up PHP temp. session files<br />
find /tmp -atime +5 -name 'sess_*' -print | xargs rm -fv</p>
<p># Clean up dead vBulletin uploads<br />
ls | grep 'vbupload*' | xargs rm -fv</p>
<p># Clean up failed php uploads<br />
ls | grep 'php*' | xargs rm -fv</p>
<p># Clean up failed ImageMagick conversions.<br />
ls | grep 'magick*' | xargs rm -fv<br />
</code></p>
<p>Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2008/11/28/tmp-clean-up-script-modification-sessions-dying-with-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cleaning up /tmp directory on busy cPanel web hosting servers</title>
		<link>http://momotonic.com/2008/11/27/cleaning-up-tmp-directory-on-busy-cpanel-web-hosting-servers/</link>
		<comments>http://momotonic.com/2008/11/27/cleaning-up-tmp-directory-on-busy-cpanel-web-hosting-servers/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 02:22:58 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[cpanel]]></category>
		<category><![CDATA[error 22]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql.sock]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tmp]]></category>
		<category><![CDATA[full]]></category>
		<category><![CDATA[uploads]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=17</guid>
		<description><![CDATA[Usually, the /tmp directory is one of the frequently accessed directories, temp files of MySQL, PHP and other applications are placed and often if processes die, left over.  Uploads using PHP are always uploaded to the /tmp directory till they are complete, if you have some dying processes, you will end up with a [...]]]></description>
			<content:encoded><![CDATA[<p>Usually, the <code>/tmp</code> directory is one of the frequently accessed directories, temp files of MySQL, PHP and other applications are placed and often if processes die, left over.  Uploads using PHP are always uploaded to the <code>/tmp</code> directory till they are complete, if you have some dying processes, you will end up with a filled <code>/tmp</code> directory which is hell.</p>
<p>Why? Because MySQL leaves and uses it&#8217;s temporary files in <code>/tmp</code>, and if there is no space in there, queries will start failing.  Uploads from PHP or Perl are placed in there till the upload process is over, they cannot be further placed there because there is no more space left.  So far, we have failing MySQL &#038; inability to upload complete PHP files, <i>system administrator hell</i>.</p>
<p>Easy fix, you might say?  Just a simply <code>rm -rf /</code> should take care of it?  Nope.  Try that, have fun trying to fix the sockets you deleted, specifically applications that depend on the <i>mysql.sock</i> placed in your <i>/tmp</i> directory, things just got worse.  In case you actually did delete everything, just restart the services, they should re-appear, if they don&#8217;t, they should be somewhere else and you have to create a symbolic link using <code>li</code>, MySQL&#8217;s socket is usually located at <code>/var/lib/mysql/mysql.sock</code>.</p>
<p>The best way is to either have a script that cleans it up hourly if you know what usually fills it up or manually run <code>ls -alhS /tmp | head</code> and looking what&#8217;s causing the problem and how to avoid it in the future, I have developed a script that I run on multiple servers with no problems at the moment.  It takes care of the most trash caused on a cPanel server</p>
<p><code>#!/bin/bash</p>
<p># Change directory to /tmp<br />
cd /tmp</p>
<p># Clean up trash left by Gallery2<br />
ls | grep '[0-9].inc*' | xargs rm -fv</p>
<p># Clean up PHP temp. session files<br />
ls | grep 'sess_*' | xargs rm -fv</p>
<p># Clean up dead vBulletin uploads<br />
ls | grep 'vbupload*' | xargs rm -fv</p>
<p># Clean up failed php uploads<br />
ls | grep 'php*' | xargs rm -fv</p>
<p># Clean up failed ImageMagick conversions.<br />
ls | grep 'magick*' | xargs rm -fv</code></p>
<p>That usually is enough, my suggestion is to have that run as a cronjob every hour, but I&#8217;m not going in detail on how to do that, because if you don&#8217;t know how to setup a cronjob, perhaps you shouldn&#8217;t be messing around in <code>/tmp</code> directories and deleting stuff on the first place!</p>
<p><b>Update: This script is faulty and will cause you a lot of problems with PHP sessions, please read more information and read the new one <a href="http://momotonic.com/2008/11/28/tmp-clean-up-script-modification-sessions-dying-with-php/">here</a></b></p>
]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2008/11/27/cleaning-up-tmp-directory-on-busy-cpanel-web-hosting-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AACRAID based controllers timing out / aborting / SCSI hang</title>
		<link>http://momotonic.com/2008/11/24/aacraid-based-controllers-timing-out-aborting-scsi-hang/</link>
		<comments>http://momotonic.com/2008/11/24/aacraid-based-controllers-timing-out-aborting-scsi-hang/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 23:51:36 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[aacraid]]></category>
		<category><![CDATA[adaptec]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[grsecurity]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[scsi]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[hdd]]></category>
		<category><![CDATA[performence]]></category>
		<category><![CDATA[raid-10]]></category>
		<category><![CDATA[raid-5]]></category>
		<category><![CDATA[scsi subsystem]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[timeout]]></category>

		<guid isPermaLink="false">http://momotonic.com/?p=13</guid>
		<description><![CDATA[We&#8217;ve been lately starting to use more Adaptec RAID controllers rather than 3ware RAID controllers.  3ware has been nothing but trouble for us, dropping hard drives, even RAID5 arrays are running slower than a regular hard drive with no RAID.  Our latest issue was a server just simply having a Kernel Panic when using high [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been lately starting to use more Adaptec RAID controllers rather than 3ware RAID controllers.  3ware has been nothing but trouble for us, dropping hard drives, even RAID5 arrays are running slower than a regular hard drive with no RAID.  Our latest issue was a server just simply having a Kernel Panic when using high IO, our experience with 3ware RAID controllers &amp; Linux is terrible.</p>
<p>On this other side, Adaptec has been great.  We&#8217;ve been using them for a while now and see no problems at all, however there is just a small catch, Linux usually has a SCSI subsystem timeout of less than 30 seconds which results in a small difference between the controller timeout (at 35 seconds) versus the Linux timeout (at 30 seconds).  This usually brings a server to a halt for a couple of seconds (and minutes in cases) till the server recovers, errors like this are thrown in the console:</p>
<p><code>aacraid: Host adapter abort request (0,1,3,0)<br />
aacraid: Host adapter abort request (0,1,1,0)<br />
aacraid: Host adapter abort request (0,1,2,0)<br />
aacraid: Host adapter abort request (0,1,1,0)<br />
aacraid: Host adapter abort request (0,1,2,0)<br />
aacraid: Host adapter reset request. SCSI hang ?</code></p>
<p>The best method that usually works best is to increase the timeout higher than 45 to ensure that the Linux timeout does not occur before the RAID controller timeout, this is done per device / array.</p>
<p><code>echo '45' > /sys/block/sda/device/timeout<br />
echo '45' > /sys/block/sdb/device/timeout<br />
echo '45' > /sys/block/sdc/device/timeout</code></p>
<p>This should be done to every device, 45 is a good number however you can use what you&#8217;d like as long as it&#8217;s over 35.  If you&#8217;re experiencing issues with loads going sky-high with no apparent reason, this might very well be the reason, to check if this is a possible cause, you can run the following</p>
<p><code>dmesg | grep aacraid</code></p>
<p>If you see errors like the ones that I have up there, then I suggest using that small workaround, if even after using the workaround, you&#8217;re still facing these problems, here are the suggestions/checklist that <a href="http://ask.adaptec.com/scripts/adaptec_tic.cfg/php.exe/enduser/std_adp.php?p_faqid=15357&#038;p_created=1225366599">Adaptec</a> suggests:</p>
<blockquote>
<ul>
<li>Check for any updated firmware for the motherboard, controller, targets and enclosure on the respective manufacturer&#8217;s web sites.</li>
<li>Check per-device queue depth in SYSFS to make sure it is reasonable.</li>
<li>Engage disk drive manufacturer&#8217;s technical support department to check through compatibility or drive class issues.</li>
<li>Engage enclosure manufacturer&#8217;s technical support department to check through compatibility issues.</li>
</ul>
</blockquote>
<p>Anyhow, just like with every Linux issue, your mileage may vary, so if you know of any other fixes or figured out a way how to fix this, feel free to post it as a comment to help others.</p>
]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2008/11/24/aacraid-based-controllers-timing-out-aborting-scsi-hang/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Helpful cPanel included application</title>
		<link>http://momotonic.com/2008/02/23/helpful-cpanel-included-application/</link>
		<comments>http://momotonic.com/2008/02/23/helpful-cpanel-included-application/#comments</comments>
		<pubDate>Sat, 23 Feb 2008 23:57:02 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[cpanel]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://momotonic.com/2008/02/23/helpful-cpanel-included-application/</guid>
		<description><![CDATA[cPanel may have some very annoying bugs sometimes however there are very useful bits of it that can help in general system administration, dealing with a very busy server and trying to terminate an account that has high disk usage will make the load averages go sky high however thanks to this neat little application [...]]]></description>
			<content:encoded><![CDATA[<p>cPanel may have some very annoying bugs sometimes however there are very useful bits of it that can help in general system administration, dealing with a very busy server and trying to terminate an account that has high disk usage will make the load averages go sky high however thanks to this neat little application provided with cPanel, you can forget about freaking out on high server load.  I have personally tried multiple solutions (including nice) but the loads would still go high and the server would be unusable.</p>
<p>With every cPanel installation, there is a binary located at <code>/usr/local/cpanel/bin/cpuwatch</code>, what <code>cpuwatch</code> does is that it executes the command and monitors the load, if the load goes past the set limit, it will stop the application and resume it after the load averages are below the threshold for a few seconds, the usage for it is very simply</p>
<p><code>cpuwatch <maxload> (<-p PID>|<command> [arguments])<br />
  maxload : system load at which throttling should commence<br />
  command : command to run under cpuwatch<br />
  -p PID  : monitor and throttle the existing process PID</code></p>
<p>Another neat feature is that it can fork a new process or attach itself to a running process, here is an example of deleting an account using SSH and setting the load average threshold to 4.0</p>
<p><code>/usr/local/cpanel/bin/cpuwatch 4.0 /scripts/killacct username</code></p>
<p>The load average will go past 4 however the process will stop running as it goes past that limit, if you already have a process running and you do not want to restart it all, you can run the following command to attach it to the process, in this case, the process ID of my process is 18274.</p>
<p><code>/usr/local/cpanel/bin/cpuwatch 4.0 -p 18274</code></p>
<p>It&#8217;s a very simple but very neat utility that has saved me a few times where I had to do major file operations and did not want the server to have high load averages, this same binary is also used when the logs are running for cPanel and as well as when the cPanel backups are running.</p>
]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2008/02/23/helpful-cpanel-included-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fantastico, PHPList and blank pages</title>
		<link>http://momotonic.com/2008/02/23/fantastico-phplist-and-blank-pages/</link>
		<comments>http://momotonic.com/2008/02/23/fantastico-phplist-and-blank-pages/#comments</comments>
		<pubDate>Sat, 23 Feb 2008 07:32:19 +0000</pubDate>
		<dc:creator>Mo</dc:creator>
				<category><![CDATA[cpanel]]></category>
		<category><![CDATA[fantastico]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://momotonic.com/2008/02/23/fantastico-phplist-and-blank-pages/</guid>
		<description><![CDATA[I&#8217;ve lately had a few clients complaining about their PHPList installs not working properly when using Fantastico, I tried it out myself and it does indeed seem to be somewhat broken.  Usually when you go the adminstration page, it simply shows and empty page and if you view the source for that page, it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve lately had a few clients complaining about their PHPList installs not working properly when using Fantastico, I tried it out myself and it does indeed seem to be somewhat broken.  Usually when you go the adminstration page, it simply shows and empty page and if you view the source for that page, it contains something along of these lines:</p>
<p><code><!-- using ../config/config.php --></code></p>
<p>The cause of this problem seems to usually be a default Fantastico setting that is not properly set, to fix this, you will need to edit your <code>/config/config.php</code> and replace the following:</p>
<p><code>define("PLUGIN_ROOTDIR","/tmp");</code></p>
<p>With the following, of course replacing <code>username</code> by your cPanel username and making sure that the path for your account is correct (sometimes, it&#8217;s <code>home2</code> instead of <code>home</code>).</p>
<p><code>define("PLUGIN_ROOTDIR","/home/username/tmp");</code></p>
<p>After a few days of research on this and a few angry clients, it&#8217;s all figured out so I guess why not share them with other system administrators, it&#8217;ll save them some trouble!</p>
]]></content:encoded>
			<wfw:commentRss>http://momotonic.com/2008/02/23/fantastico-phplist-and-blank-pages/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
