<?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>Learn cPanel &#187; Server Administration</title>
	<atom:link href="http://www.learncpanel.com/category/server-administration/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpanel.com</link>
	<description>The Ultimate cPanel Tutorial Resource</description>
	<lastBuildDate>Fri, 17 Jun 2011 15:54:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Setup load Alerts on your dedicated server or VPS</title>
		<link>http://www.learncpanel.com/cpanel-tutorials/how-to-setup-load-alerts-on-your-dedicated-server-or-vps/</link>
		<comments>http://www.learncpanel.com/cpanel-tutorials/how-to-setup-load-alerts-on-your-dedicated-server-or-vps/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 15:26:27 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[cPanel Tutorials]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[load]]></category>

		<guid isPermaLink="false">http://www.learncpanel.com/?p=253</guid>
		<description><![CDATA[A customer of ours wanted to get emails from his server, if the load ever rose above a certain number. Here&#8217;s a script I wrote up to accomplish this: EMAIL="your email 1" SUBJECT="Alert $(hostname) load average is $L05" TEMPFILE="/tmp/$(hostname)" TOPLOAD="10" echo "Load average Crossed allowed limit." >> $TEMPFILE echo "Hostname: $(hostname)" >> $TEMPFILE echo "Local [...]]]></description>
			<content:encoded><![CDATA[<p>A customer of ours wanted to get emails from his server, if the load ever rose above a certain number.</p>
<p>Here&#8217;s a script I wrote up to accomplish this:</p>
<pre>
EMAIL="your email 1"
SUBJECT="Alert $(hostname) load average is $L05"
TEMPFILE="/tmp/$(hostname)"
TOPLOAD="10"
echo "Load average Crossed allowed limit." >> $TEMPFILE
echo "Hostname: $(hostname)" >> $TEMPFILE
echo "Local Date &#038; Time : $(date)" >> $TEMPFILE
echo "| Uptime status: |" >> $TEMPFILE
echo "-------------------------------------------" >> $TEMPFILE
/usr/bin/uptime >> $TEMPFILE
echo "-------------------------------------------" >> $TEMPFILE
echo "| Top 20 CPU consuming processes: |" >> $TEMPFILE
ps aux | head -1 >> $TEMPFILE
ps aux --no-headers | sort -rn +2 | head -20 >> $TEMPFILE
echo "| Top 10 memory-consuming processes: |" >> $TEMPFILE
ps aux --no-headers| sort -rn +3 | head >> $TEMPFILE
echo "-------------------------------------------" >> $TEMPFILE
echo "| Memory and Swap status: |" >> $TEMPFILE
/usr/bin/free -m >> $TEMPFILE
echo "-------------------------------------------" >> $TEMPFILE
echo "| Active network connection: |" >> $TEMPFILE
echo "-------------------------------------------" >> $TEMPFILE
/bin/netstat -tnup | grep ESTA >> $TEMPFILE
echo "-------------------------------------------" >> $TEMPFILE
echo "| Disk Space information: |" >> $TEMPFILE
echo "-------------------------------------------" >> $TEMPFILE
/bin/df -h >> $TEMPFILE
echo "-----------------THE END-------------------" >> $TEMPFILE
L05="$(uptime|awk '{print $(NF-2)}'|cut -d. -f1)"
if test $L05 -gt $TOPLOAD
then
mail -s "$SUBJECT  $L05" "$EMAIL" < $TEMPFILE
fi
rm -f $TEMPFILE
</pre>
<p>Add this to the root crontab on the server by running:</p>
<pre>echo "* * * * * /root/loadalert >/dev/null 2>&#038;1" >> /var/spool/cron/root</pre>
<p>Now we need to restart crond to pick up the change:</p>
<pre>/etc/init.d/crond restart</pre>
<p>I hope this helps someone out there!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.learncpanel.com/cpanel-tutorials/how-to-setup-load-alerts-on-your-dedicated-server-or-vps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing GET</title>
		<link>http://www.learncpanel.com/server-administration/installing-get/</link>
		<comments>http://www.learncpanel.com/server-administration/installing-get/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 21:52:16 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.learncpanel.com/?p=239</guid>
		<description><![CDATA[In RPM-based Linux distributions the package named &#8220;perl-libwww-perl&#8221; includes the LWP module with the GET, POST, and HEAD command aliases; to check if the RPM is installed: rpm -qi perl-libwww-perl If the RPM is not installed or if the aliases are otherwise missing (e.g., on FreeBSD), then the issue may be resolved by forcing a [...]]]></description>
			<content:encoded><![CDATA[<p>In RPM-based Linux distributions the package named &#8220;perl-libwww-perl&#8221; includes the LWP module with the GET, POST, and HEAD command aliases; to check if the RPM is installed:</p>
<pre>rpm -qi perl-libwww-perl</pre>
<p>If the RPM is not installed or if the aliases are otherwise missing (e.g., on FreeBSD), then the issue may be resolved by forcing a re-install of the LWP module from CPAN and having it install the aliases for LWP that enable the GET, POST, and HEAD commands; the re-installation may be performed using the following command, and when running it you would need to answer yes to the questions by entering &#8220;y&#8221; when prompted to create the aliases:<br />
Code:</p>
<pre>/scripts/realperlinstaller --force LWP</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.learncpanel.com/server-administration/installing-get/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>child pid xxxx exit signal File size limit exceeded (25)</title>
		<link>http://www.learncpanel.com/server-administration/child-pid-xxxx-exit-signal-file-size-limit-exceeded-25/</link>
		<comments>http://www.learncpanel.com/server-administration/child-pid-xxxx-exit-signal-file-size-limit-exceeded-25/#comments</comments>
		<pubDate>Tue, 04 May 2010 21:09:13 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[cPanel Troubleshooting]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.learncpanel.com/?p=187</guid>
		<description><![CDATA[Ever have Apache not respond, and in the logs shows: [Fri May 04 16:10:35] [notice] child pid 9607 exit signal File size limit exceeded (25) [Fri May 04 16:10:35] [notice] child pid 9606 exit signal File size limit exceeded (25) [Fri May 04 16:10:35] [notice] child pid 9602 exit signal File size limit exceeded (25) [...]]]></description>
			<content:encoded><![CDATA[<p>Ever have Apache not respond, and in the logs shows:</p>
<blockquote><p>
[Fri May 04 16:10:35] [notice] child pid 9607 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9606 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9602 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9599 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9598 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9593 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9592 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9591 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9590 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9588 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9587 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9583 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9582 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9579 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9578 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9576 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9575 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9574 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9573 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9554 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 9551 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 7835 exit signal File size limit exceeded (25)<br />
[Fri May 04 16:10:35] [notice] child pid 7817 exit signal File size limit exceeded (25)
</p></blockquote>
<p>This is due to Apache&#8217;s 1&#8242;s 2G file size limit.  This could also be caused by anyone using an EXT2 file system, as it doesn&#8217;t support files over 2G in size.</p>
<p>This is pretty easy to fix.  First we need to find the offending file:</p>
<blockquote><p>find /usr/local/apache/ -size +2000000k -printf &#8220;Size: %kK\tPath: %p\n&#8221;</p></blockquote>
<p>Once you find the offending file, you&#8217;ll need to get rid of it.  You can do this by piping into the file via</p>
<blockquote><p>> /path/to/file</p></blockquote>
<p>Than restart Apache:</p>
<blockquote><p>/etc/init.d/httpd startssl<br />
/etc/init.d/httpd restart<br />
service httpd startssl</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.learncpanel.com/server-administration/child-pid-xxxx-exit-signal-file-size-limit-exceeded-25/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>cPanel System Administration Introduction</title>
		<link>http://www.learncpanel.com/server-administration/cpanel-system-administration-introduction/</link>
		<comments>http://www.learncpanel.com/server-administration/cpanel-system-administration-introduction/#comments</comments>
		<pubDate>Mon, 03 May 2010 20:54:00 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.learncpanel.com/?p=184</guid>
		<description><![CDATA[Cpanel Important directories. /usr/local/cpanel /var/cpanel /scripts /usr/local/cpanel ————— cpsrvd cpsrvd-ssl cpkeyclt /usr/local/cpanel/bin ——————- *Houses only scripts and binaries which provide installation and configuration of many cPanel managed services Notable Contents: eximstats checkperlmodules /usr/local/cpanel/logs ——————– CPSRVD ——-access_log, error_log CPANELLOGD—stats_log CPKEYCLT——license_lo /usr/local/cpanel/base ——————– frontend——-x, x2,xmail,monsoon webmail——-x, monsoon neomail horde 3rdparty——-squirrelmail, phpPgAdmin, phpMyAdmin /usr/local/cpanel/etc ——————- init ———–start &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>Cpanel Important directories.</p>
<p>/usr/local/cpanel<br />
/var/cpanel<br />
/scripts</p>
<p>/usr/local/cpanel<br />
—————<br />
cpsrvd<br />
cpsrvd-ssl<br />
cpkeyclt</p>
<p>/usr/local/cpanel/bin<br />
——————-<br />
*Houses only scripts and binaries which provide installation<br />
and configuration of many cPanel managed services</p>
<p>Notable Contents:<br />
eximstats<br />
checkperlmodules</p>
<p>/usr/local/cpanel/logs<br />
——————–<br />
CPSRVD ——-access_log, error_log<br />
CPANELLOGD—stats_log<br />
CPKEYCLT——license_lo</p>
<p>/usr/local/cpanel/base<br />
——————–<br />
frontend——-x, x2,xmail,monsoon<br />
webmail——-x, monsoon<br />
neomail<br />
horde<br />
3rdparty——-squirrelmail, phpPgAdmin, phpMyAdmin</p>
<p>/usr/local/cpanel/etc<br />
——————-<br />
init ———–start | stop cpsrvd AND start | stop AND start | stop cppop<br />
exim———-cf, perl<br />
ftptemplates —proftpd<br />
httptemplates –apache1–default, ssldefault<br />
zonetemplates–simple, standard, standardvirtualftp</p>
<p>/usr/local/cpanel/3rdparty<br />
———————–<br />
bin——php, stunnel, analog, awstats, webalizer<br />
etc——php.ini, ixed, ioncube</p>
<p>/var/cpanel<br />
———-<br />
Houses proprietary configuration data for cPanel, including:<br />
● Primary cPanel configuration<br />
● User configurations<br />
● Reseller configurations<br />
● Accounting, conversion, and update logs<br />
● Bandwidth data<br />
● Customized service templates</p>
<p>/var/cpanel<br />
———-<br />
cpanel.conf<br />
resellers<br />
accounting.log<br />
features–packages–logs<br />
updatelogs–bandwidth–zone templates<br />
users—mainips</p>
<p>/var/cpanel/cpanel.config<br />
———————–<br />
● The primary cPanel configuration file<br />
● Each variable within influences the way cPanel behaves<br />
● Variables are line delimited, with variables separated by an equal sign<br />
● If file does not exist, cpanel falls back to defaults</p>
<p>/var/cpanel/resellers<br />
——————</p>
<p>Lists each reseller with a comma-delimited list of WHM<br />
resources that reseller has access to.</p>
<p>/var/cpanel/accounting.log<br />
————————<br />
Contains a list of accounting functions performed through<br />
WHM, including account removal and creation.</p>
<p>/var/cpanel/bandwidth<br />
——————–<br />
● Files contain a list of the bandwidth history for each account.<br />
Each named after their respective user.<br />
● History files are stored in human-readable format, while actual<br />
bandwidth data are stored in round robin databases.</p>
<p>/var/cpanel/features<br />
——————</p>
<p>● File name is inherited from the feature list name<br />
● Contains a line delimited list of feature variables and a zero or<br />
one value<br />
● Variables control what cPanel resources are available to users</p>
<p>/var/cpanel/packages<br />
——————-<br />
● Contains a list of packages, named after the packages they represent<br />
● If package belongs to reseller, file name is prefixed with reseller name<br />
● Each of these values determines the values created in cPanel user file</p>
<p>/var/cpanel/users<br />
—————-<br />
● Contains a list of cPanel user configuration files, named after the user<br />
they pertain to.<br />
● Variables define account resources, themes, domains, etc.</p>
<p>Other notable /var/cpanel directories<br />
——————————–<br />
● LOGS<br />
– This directory contains logs from account copies/transfers.<br />
Training Seminar 2006<br />
● UPDATELOGS<br />
– Contains the output of each cPanel update executed on the server.<br />
● MAINIPS<br />
– Named after the respective reseller users they represent, each<br />
contains only the IP address which should be used as that<br />
resellersmain shared ip<br />
● ZONETEMPLATES<br />
– Contains customized DNS zone templates created inWHM</p>
<p>/scripts<br />
——-<br />
This directory houses a large number of scripts which serve<br />
as building blocks for many cPanel/WHM features.<br />
The scripts can be used to:<br />
● Update cPanel, and many of the services of which it<br />
manages<br />
● Customize account creation routines<br />
● Perform backups of cPanel accounts<br />
● Install and update cPanel managed services</p>
<p>cPanel Services<br />
————-<br />
Services<br />
● CPSRVD<br />
● CHKSERVD<br />
● CPANELLOGD<br />
● CPBACKUP<br />
● EXIMSTATS</p>
<p>cpsrvd<br />
——<br />
● cpsrvd is the ‘master’ process for cPanel.<br />
● Handles and dispatches all requests made through the cPanel,<br />
WHM, and Webmail interfaces.<br />
● Logs to access_log and error_log</p>
<p>cpsrvd and stunnel relationship<br />
—————————<br />
CPSRVD–2082–>cpanel<–2083<–stunnel<br />
CPSRVD–2086–>WHM<–2087<–stunnel<br />
CPSRVD–2095–>Webmail<–2096<–stunnel</p>
<p>SSL Certificates<br />
————-<br />
● Default certificate and key are stored in /usr/local/cpanel/etc/cpanel.pem<br />
● User installed cert and cabundle are stored in:<br />
– /usr/local/cpanel/etc/mycpanel.pem<br />
– /usr/local/cpanel/etc/mycpanel.cabundle</p>
<p>cPanel Startup<br />
————<br />
● The following services are controlled by the cPanel<br />
init script<br />
– cpsrvd, both plain and secure<br />
– cPanel POP Services<br />
– cPanel Log Services<br />
– Eximstats<br />
– Chat Services<br />
– Mailman<br />
– Interchange</p>
<p>● Verify if ports are in use<br />
– netstat -lnp | egrep ‘20(8|9)’</p>
<p>Troubleshooting Startup Issues(SSL)<br />
——————————-<br />
● If SSL services are not available<br />
– execute /usr/local/cpanel/startstunnel<br />
– check /usr/local/cpanel/3rdparty/bin/stunnel.log<br />
● If cpsrvd is not available<br />
– execute it directly `/usr/local/cpanel/cpsrvd`<br />
– check /usr/local/cpanel/logs/error_log</p>
<p>Licensing<br />
——–<br />
● License requests are handled by /usr/local/cpanel/cpkeyclt<br />
● Requests are transmitted to auth.cpanel.net over port 2089<br />
● License requests are logged to license_log<br />
● License key is stored at /usr/local/cpanel/cpanel.lisc</p>
<p>A valid license request:<br />
root@server [~]# /<br />
usr/local/cpanel/cpkeyclt<br />
Updating Internal cPanel<br />
Information…..Done<br />
root@server [~]#</p>
<p>Troubleshooting License Issues<br />
—————————<br />
CHECKLIST:<br />
● Verify if license is active for main server IP at http://verify.cpanel.net<br />
● Check if server can establish connection to auth.cpanel.net over port 2089<br />
● If the previous steps fail, check license_log for notable errors.<br />
● If license is active, but refused with no notable errors, lodge support request.</p>
<p>root@server [~]# telnet auth.cpanel.net 2089<br />
Trying 198.66.78.9…<br />
Connected to auth.cpanel.net (198.66.78.9).<br />
Escape character is ‘^]’.<br />
200 cPanel License Service Version 12.0<br />
root@server [~]#</p>
<p>cPanel Requests<br />
————–<br />
cPanel Requests<br />
● Logins are authenticated against the system passwd and shadow files.<br />
● Documents root is /usr/local/cpanel/base<br />
● Theme is defined by RS variable in user’s cPanel configuration file.<br />
● Resources are limited by the feature list of assigned to the given user.</p>
<p>WHM Requests<br />
————-<br />
● Root password will authenticate any reseller user<br />
● Document root is /usr/local/cpanel/whostmgr/docroot/<br />
● Reseller resources are limited by Access Control List<br />
– Defined in WHM > Resellers > Reseller Center > Edit<br />
Privileges/Nameservers<br />
– Privileges are stored in /var/cpanel/resellers</p>
<p>cPanel Services<br />
————–<br />
● CPSRVD<br />
● CHKSERVD<br />
● CPANELLOGD<br />
● CPBACKUP<br />
● EXIMSTATS</p>
<p>Service Monitoring<br />
—————-<br />
● Located at /usr/local/cpanel/libexec/chkservd<br />
● chkservd is a scalable connection and process based service monitoring<br />
tool<br />
● Provides monitoring of CPU, Memory, and Disk usage<br />
● chkservd scans services once every eight minutes<br />
– Logs to /var/log/chkservd.log<br />
● Alerts are dispatched to server contact defined in Basic cPanel/WHM<br />
Setup</p>
<p>chkservd Configuration<br />
——————–<br />
● Monitored services are determined by values stored in /<br />
etc/chkserv.d/chkservd.conf.<br />
– Syntax: servicename:0 for no monitoring, servicename:1 for<br />
monitoring<br />
● Actions, expected responses, and failure events are defined in<br />
service configuration files stored in /etc/chkserv.d/<br />
● Status files are stored in /var/run/chkservd/<br />
– Plus (+) sign for active, Minus (-) sign for failed</p>
<p>cpanellogd<br />
———-<br />
● cpanellogd is responsible for parsing and updating bandwidth logs, and dispatching<br />
statistics generators on each account, per their individual configurations.<br />
● Configured through Statistics Software Configuration and Tweak Settings in WHM<br />
● Statistics are compiled and stored for each account in /home//tmp, with<br />
each respective statistics application being assigned it’s own individual subdirectory.</p>
<p>/home//tmp —-webalizer, analog, awstats, urchin</p>
<p>● Optional server-wide statistics configurations are stored in /<br />
etc/stats.conf, while user-specific configurations may reside in /home/<br />
/tmp.<br />
● Notable Variables in /etc/stats.conf:<br />
– BLACKHOURS: Comma separated list of numeric values, which<br />
specify hours that logs may not be parsed.<br />
– VALIDUSERS:Users which are allowed to supply their own<br />
combination of statistics generators. By default users are<br />
restricted to the generators defined by the administrator.</p>
<p>Calling cpanellogd<br />
—————-<br />
● cpanellogd is started with the cPanel service, but can be executed<br />
directly with:<br />
– No Argument: Daemonize, and wait for a suitable time to scan<br />
logs<br />
– One Argument (username): Execute an immediate statistics run<br />
for the specified user, and exit once completed.<br />
● Two scripts are available to provide these functions as well:<br />
– /scripts/runlogsnow – Execute a full log run immediately<br />
– /scripts/runweblogs – Execute a log run for a single<br />
user</p>
<p>Bandwidth Statistics<br />
—————–<br />
● Bandwidth statistics are accumulated from a combination of the<br />
following cPanel managed services:<br />
– HTTP<br />
– EXIM<br />
– IMAP / POP<br />
– FTP<br />
● Bandwidth data is logged to /usr/local/apache/domlogs/*bytes_log<br />
● Parsed bandwidth data is stored in /var/cpanel/bandwidth</p>
<p>COMMON ISSUES<br />
● Bandwidth parsing is taking an exceedingly long time to complete<br />
– First check the size of the logs being parsed. Excessively large<br />
log files can and typically will take a long time to complete.<br />
– Additionally, if RRDtool is not installed, bandwidth parsing<br />
performance will drop signifigantly.<br />
● RRDtool can be installed by executing `/scripts/rrdtoolinstall`</p>
<p>Log Processing<br />
————-<br />
● Statistics are parsed for each child domain of the given account.<br />
● Will be influenced by variables in /var/cpanel/cpanel.config<br />
– Skip statistics generator<br />
● skip<br />
– Logs will be retained or deleted based on<br />
● keeplogs – keep logs at the end of the month.<br />
● dumplogs – dump logs after parsing</p>
<p>Common cpanellogd Issues<br />
————————<br />
● Statistics are stalling, or are taking unreasonable amounts of<br />
time.<br />
– Usually indiates that the server load average is consistently<br />
exceeding the defined load limit.<br />
● Limit is defined as ‘extracpus’ in /var/cpanel/cpanel.config<br />
– Restrictive BLACKHOUR definitions in WHM > Statistics Software<br />
Configuration.<br />
– All other issues should be present in /<br />
usr/local/cpanel/logs/stats_log</p>
<p>cPanel Backups<br />
————-<br />
GENERAL INFORMATION<br />
● Backup configuration is performed in WHM > Backup > Configure<br />
Backup<br />
● cPanel backups are performed by /scripts/cpbackup, which is<br />
configured by default to execute at 1:00 AM in the root crontab.<br />
● Backup archives are created using the /scripts/pkgacct utility, and<br />
may be restored using /scripts/restorepkg respectfully.<br />
● Uses CPU resource limits based upon extracpus definition in<br />
cpanel.config</p>
<p>Backup Configuration<br />
——————-<br />
BACKUP INTERVALS<br />
● Backup script can be configured to operate in daily, weekly, and monthly intervals.<br />
● Each interval is given it’s own respective directory within the backup root.<br />
● Backup intervals are executed when the current time minus the last modification time<br />
of the interval directory is less than or equal to zero.</p>
<p>BACKUP METHODS<br />
—————-<br />
Three backup methods are available:<br />
● Standard: This method entails archiving the accounts, and storing<br />
them at the specified path/mount point. This is the default method<br />
used by the backup script.<br />
● Incremental: This method uses rsync to incrementally backup user<br />
data. This option will only operate locally, storing the data at the<br />
specified path/mount point.<br />
● Remote: This method transmits account archives to a specified ftp<br />
server. Remote backups are typically more time consuming, and<br />
more error prone when transmitting large accounts.</p>
<p>Common Backup Issues<br />
——————–<br />
● Backup intervals are not executed when expected.<br />
– Modification times are incorrect or not functional<br />
– System time is incorrect.<br />
– Backups have not been defined to run on that day.<br />
● Backups stall, or take an exceedingly long time to complete.<br />
– Verify that the transmission rate to remote server is suitable<br />
– Verify that server load average has not exceeded defined<br />
resource limit.</p>
<p>● Can’t call method “login” on an undefined value<br />
This indicates the host or passive setting is not properly<br />
defined for remote backups.<br />
● Unable to login to remote FTP server.<br />
This indicates that either the username and password<br />
were not specified, or are incorrect in the backup configuration.<br />
● Can’t call method “prepare” on an undefined value<br />
The password stored for the root mysql user in /root/.my.cnf is<br />
incorrect. Reset or correct this password, and re-execute the backup<br />
script.</p>
<p>eximstats<br />
———<br />
● The eximstats daemon is responsible for harvesting bandwidth<br />
information from exim transactions.<br />
● Continually monitors the exim_mainlog, and stores information in the<br />
eximstats database, including host and sender information, message<br />
size, and transaction times.<br />
● Is started with the cPanel service, but can be called directly at /<br />
usr/local/cpanel/bin/eximstats</p>
<p>● Heavily mysql dependent<br />
– data is stored in the ‘eximstats’ database.<br />
● ‘eximstats’ mysql user password is stored in /var/cpanel/eximstatspass.<br />
– password is generated by /usr/local/cpanel/bin/eximstatspass<br />
● Database can be installed by running /<br />
usr/local/cpanel/bin/updateeximstats</p>
<p>cPanel Maintenance<br />
—————–<br />
● Update configuration<br />
● Update scripts<br />
● Applying updates</p>
<p>● By default, cPanel applies nightly updates at 2:13AM in the root crontab.<br />
● /scripts/upcp dispatches these updates, using the following key<br />
components:<br />
– /scripts/updatenow – synchronize /scripts directory<br />
– /scripts/sysup – updates cPanel managed rpms<br />
– /scripts/rpmup – all other system updates<br />
● Updates are logged to timestamped files in /var/cpanel/updatelogs<br />
● Update configuration is stored in /etc/cpupdate.conf.</p>
<p>/etc/cpupdate.conf<br />
—————–<br />
● The following variables are available in cpupdate.conf:<br />
– CPANEL = [ manual- ] stable | release | current | edge<br />
This variable controls which update branch is used for<br />
cPanel updates, and controls whether the updates are applied<br />
manually or automatically (Default value: release)<br />
– SYSUP = never (all other values are assumed true)<br />
– RPMUP = never (all other values are assumed true)</p>
<p>CPANEL=current<br />
RPMUP=daily<br />
SYSUP=daily</p>
<p>● cPanel updates can be called outside of the regularly scheduled cron<br />
time simply by executing /scripts/upcp.<br />
● If cPanel components are missing or corrupted that were not replaced<br />
with the regular cPanel update, they can be replaced by executing /<br />
scripts/upcp –force</p>
<p>Components of upcp<br />
——————<br />
● /scripts/cpanelsync<br />
● /scripts/updatenow<br />
● /scripts/sysup<br />
● /scripts/rpmup</p>
<p>/scripts/cpanelsync<br />
—————–<br />
● /scripts/cpanelsync is called upon by /scripts/updatenow and /<br />
scripts/upcp<br />
● Provides md5sum based synchronization with update servers<br />
● md5sum table is stored in /destination_directory/.cpanelsync<br />
● Accepts three arguments host, remote path, local path :<br />
/scripts/cpanelsync ‘httpupdate.cpanel.net’<br />
‘/cpanelsync/RELEASE/scripts’ ‘/scripts’</p>
<p>/scripts/updatenow<br />
—————–</p>
<p>Calls cpanelsync to update contents of scripts<br />
directory, which then stores it’s md5sum table<br />
at /scripts/.cpanelsync<br />
● Should only be run from upcp, but can be<br />
executed from command line when ‘–fromupcp’<br />
is passed.<br />
● Is the first update script called upon from /scripts/upcp</p>
<p>UPCP–>updatenow–>FTPUP–>EXIMUP–>MYSQLUP–>BANDMINUP–>COURIERUP–>RPMUP</p>
<p>RPMUP<br />
——–<br />
● Calls the underlying package manager to apply system package<br />
updates<br />
● The package manager which is used is determined by the presence<br />
of:<br />
– /var/cpanel/useup2date (Redhat)<br />
– /var/cpanel/useyum (CentOS,Fedora)<br />
– /var/cpanel/useapt (Debian)<br />
– /var/cpanel/useswup (Trustix)<br />
– /var/cpanel/userug (SuSE)</p>
<p>cPanel Updates<br />
—————-<br />
● After updatenow, sysup, and rpmup complete, cpanelsync is used to<br />
complete the cPanel updates based on md5sum table stored at /<br />
usr/local/cpanel/.cpanelsync<br />
● If any special configurations are required on server after updates,<br />
they can be applied in /scripts/postupcp, which is executed if such a<br />
file exists and is executable.<br />
● Once updates complete, all cPanel services are restarted for changes<br />
to take effect</p>
<p>cPanel Scripts<br />
————–<br />
● Account Management<br />
● Package Management<br />
● Service Update and Configuration<br />
– MySQL<br />
– Exim<br />
– Named<br />
– Apache<br />
● cPanel and System</p>
<p>Account Management Scripts<br />
——————————<br />
● /scripts/wwwacct (account creation)<br />
Accounts can be created via the command line using the following<br />
syntax: /scripts/wwwacct exampledomain.com username password 0<br />
x n<br />
● /scripts/killacct (account termination)<br />
Takes a single argument of the user to terminate.<br />
● /scripts/suspendacct (account suspension)<br />
Will suspend an account from accessing all cPanel managed<br />
services.<br />
● /scripts/unsuspendacct<br />
Will reinstate any account suspended via suspendacct</p>
<p>● /scripts/addpop (Create pop account)<br />
Handles creation of virtual mail accounts. Accepts either no<br />
arguments, or two arguments consisting of the e-mail address and<br />
password.<br />
● /scripts/updateuserdomains<br />
Updates the user:owner and user:domain tables stored in:<br />
– /etc/userdomains<br />
– /etc/trueuserdomains<br />
– /etc/trueuserowners<br />
– These tables are used to enumerate and keep track of accounts<br />
and their owners.</p>
<p>Package Management<br />
———————-<br />
● /scripts/ensurerpm<br />
Takes argument list of rpms, which are then passed to the<br />
underlying package manager<br />
● /scripts/ensurepkg<br />
The equivalent of ensurerpm for FreeBSD. Updates specified<br />
packages from ports.<br />
● /scripts/realperlinstaller<br />
Takes argument list of perl modules to install via CPAN<br />
● Each of the aforementioned scripts can accept an argument of ‘–force’<br />
to force package installations.</p>
<p>● /scripts/mysqlup<br />
Can be called to apply MySQL updates independent of upcp<br />
● /scripts/cleanupmysqlprivs<br />
Will clean up the default MySQL privilege tables, by installing<br />
a more restrictive privilege schema.<br />
● /scripts/mysqlconnectioncheck<br />
Will verify that mysql is accessible with password stored in /root/.my.cnf,<br />
and force a reset with a random 16 character string if inaccessible.<br />
● /scripts/restartsrv_mysql</p>
<p>● /scripts/eximup<br />
Can be called to apply exim updates independent of upcp<br />
● /scripts/buildeximconf<br />
Will rebuild exim.conf, and merge local, distribution, and cPanel<br />
configurations<br />
● /scripts/restartsrv_exim</p>
<p>● /scripts/rebuildnamedconf<br />
Rebuild named.conf based on existing zone files<br />
● /scripts/restartsrv_bind</p>
<p>● /scripts/easyapache<br />
Download, extract, and execute apache build script<br />
● /scripts/rebuildhttpdconf<br />
Rebuilds httpd.conf based on DNS entries found in each<br />
cPanel user configuration<br />
● /scripts/restartsrv_httpd</p>
<p>cPanel Scripts<br />
————–<br />
Useful Scripts – cPanel and System<br />
● /scripts/restartsrv_<br />
The majority of cPanel managed service can be scripts named<br />
appropriately.<br />
● /scripts/makecpphp<br />
Will rebuild the PHP interpreter used internally by cpsrvd<br />
● /usr/local/cpanel/bin/checkperlmodules<br />
Will scan for and install any Perl modules required by cPanel.<br />
● /scripts/fullhordereset<br />
Updates horde and resets the horde mysql user password<br />
● /scripts/fixquotas<br />
Will attempt to rebuild quota database per information stored in /<br />
etc/quota.conf</p>
]]></content:encoded>
			<wfw:commentRss>http://www.learncpanel.com/server-administration/cpanel-system-administration-introduction/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Customize Apache default success page</title>
		<link>http://www.learncpanel.com/server-administration/customize-apache-default-success-page/</link>
		<comments>http://www.learncpanel.com/server-administration/customize-apache-default-success-page/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 21:41:26 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.learncpanel.com/?p=161</guid>
		<description><![CDATA[A customer contacted me today inquiring on how they can change the default Apache success page that they get when they type in their hostname.   After searching cPanel.net&#8217;s documentation, I came to realize that it&#8217;s not documented there, nor hardly anywhere else. Luckily, this is a pretty easy process to do! First, you&#8217;ll need to [...]]]></description>
			<content:encoded><![CDATA[<p>A customer contacted me today inquiring on how they can change the default Apache success page that they get when they type in their hostname.   After searching cPanel.net&#8217;s documentation, I came to realize that it&#8217;s not documented there, nor hardly anywhere else.</p>
<p>Luckily, this is a pretty easy process to do!</p>
<p>First, you&#8217;ll need to log into your server via root SSH.</p>
<p>Navigate to Apache&#8217;s default directory (99% of the time it&#8217;s called &#8216;htdocs&#8217;):</p>
<p><code>cd /usr/local/apache/htdocs</code></p>
<p>You&#8217;ll edit the page &#8216;index.html&#8217; with your favorite text editor:<br />
<code>vi index.html</code></p>
<p>The options of pages placed in this directory are endless.  You can even setup scripts, blogs, forums, and anything else you want there!  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.learncpanel.com/server-administration/customize-apache-default-success-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kill processes for user</title>
		<link>http://www.learncpanel.com/server-administration/kill-processes-for-user/</link>
		<comments>http://www.learncpanel.com/server-administration/kill-processes-for-user/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 02:25:24 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.learncpanel.com/?p=136</guid>
		<description><![CDATA[To easily kill all processes running under a user ps -u USER  &#124; awk ‘{print $1}’ &#124; xargs kill  -9 or pkill -u USER replacing USER with the username. To kill all specific processes such as php running under a user run, ps -u USER  &#124; grep PROCESS &#124;awk ‘{print $1}’ &#124; xargs kill  -9 [...]]]></description>
			<content:encoded><![CDATA[<p>To easily kill all processes running under a user</p>
<p><code>ps -u USER  | awk ‘{print $1}’ | xargs kill  -9</code></p>
<p>or</p>
<p><code>pkill -u USER</code></p>
<p>replacing USER with the username.</p>
<p>To kill all specific processes such as php running under a user run,</p>
<p><code>ps -u USER  | grep PROCESS |awk ‘{print $1}’ | xargs kill  -9</code></p>
<p>replacing USER with username and PROCESS with php or any other  process.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.learncpanel.com/server-administration/kill-processes-for-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jailshell virtfs</title>
		<link>http://www.learncpanel.com/server-administration/jailshell-virtfs/</link>
		<comments>http://www.learncpanel.com/server-administration/jailshell-virtfs/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 02:24:40 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.learncpanel.com/?p=134</guid>
		<description><![CDATA[NEVER DELETE ANY FILES FROM /home/virtfs/ /home/virtfs is used to chroot the user into jailed shell. Cpanel will hard link files into this directory so deleting files in /home/virtfs will also delete the files on the server in the actual location. (example: rm /home/virtfs/user/etc/exim.pl will delete /etc/exim.pl) If a user is reporting double the quota [...]]]></description>
			<content:encoded><![CDATA[<p>NEVER DELETE ANY FILES FROM /home/virtfs/</p>
<p>/home/virtfs is used to chroot the user into jailed shell. Cpanel  will hard link files into this directory so deleting files in  /home/virtfs will also delete the files on the server in the actual  location. (example: rm /home/virtfs/user/etc/exim.pl will delete  /etc/exim.pl)</p>
<p>If a user is reporting double the quota and it is from /home/virtfs  then we need to umount or kill and hanging jailshell process. To do this  run</p>
<p>ps aufx |grep user |grep jailshell</p>
<p>If there are no jailshell processes then run</p>
<p>cat /proc/mounts</p>
<p>It will show,<br />
/dev/root /home/virtfs/user/lib ext3 rw,data=ordered,usrquota 0 0<br />
/dev/sda2 /home/virtfs/user/usr/lib ext3 rw,data=ordered,usrquota 0 0<br />
/dev/sda2 /home/virtfs/user/usr/sbin ext3 rw,data=ordered,usrquota 0 0<br />
/dev/sda2 /home/virtfs/user/usr/share ext3 rw,data=ordered,usrquota 0 0<br />
/dev/sda2 /home/virtfs/user/usr/bin ext3 rw,data=ordered,usrquota 0 0<br />
/dev/sda2 /home/virtfs/user/usr/man ext3 rw,data=ordered,usrquota 0 0<br />
/dev/sda2 /home/virtfs/user/usr/X11R6 ext3 rw,data=ordered,usrquota 0 0<br />
/dev/sda2 /home/virtfs/user/usr/kerberos ext3 rw,data=ordered,usrquota 0  0<br />
/dev/sda2 /home/virtfs/user/usr/libexec ext3 rw,data=ordered,usrquota 0 0<br />
/dev/sda2 /home/virtfs/user/usr/local/bin ext3 rw,data=ordered,usrquota 0  0<br />
/dev/sda2 /home/virtfs/user/usr/local/share ext3  rw,data=ordered,usrquota 0 0<br />
/dev/sda2 /home/virtfs/user/usr/local/Zend ext3 rw,data=ordered,usrquota  0 0<br />
/dev/sda2 /home/virtfs/user/usr/include ext3 rw,data=ordered,usrquota 0 0<br />
/dev/sda2 /home/virtfs/user/usr/local/lib ext3 rw,data=ordered,usrquota 0  0<br />
/dev/sda3 /home/virtfs/user/var/spool ext3  rw,noatime,nodiratime,data=ordered,usrquota 0 0<br />
/dev/sda3 /home/virtfs/user/var/lib ext3  rw,noatime,nodiratime,data=ordered,usrquota 0 0<br />
/dev/sda3 /home/virtfs/user/var/run ext3  rw,noatime,nodiratime,data=ordered,usrquota 0 0<br />
/dev/sda3 /home/virtfs/user/var/log ext3  rw,noatime,nodiratime,data=ordered,usrquota 0 0<br />
/dev/sda6 /home/virtfs/user/tmp ext3 rw,nosuid,nodev,noexec,data=ordered  0 0<br />
/dev/root /home/virtfs/userbin ext3 rw,data=ordered,usrquota 0 0</p>
<p>You will need to unmount each of these by running<br />
umount /home/virtfs/user/tmp and so on</p>
<p>You can also run</p>
<p>for i in `cat /proc/mounts |grep virtfs |grep user |awk ‘{print$2}’`;  do umount $i; done</p>
<p>Make sure to replace user with the cpanel username in the above  command. This will then clear up the files in /home/virtfs and the quota  should return to normal.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.learncpanel.com/server-administration/jailshell-virtfs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP Suexec ForceType</title>
		<link>http://www.learncpanel.com/server-administration/php-suexec-forcetype/</link>
		<comments>http://www.learncpanel.com/server-administration/php-suexec-forcetype/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 02:23:01 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.learncpanel.com/?p=131</guid>
		<description><![CDATA[If you are trying to use the ForceType directive in your .htaccess files with PHPsuexec, it will fail. To work around this, simply use SetHandler instead of ForceType. example: &#60;Files r&#62; SetHandler application/x-httpd-php &#60;/Files&#62; or SetHandler application/x-httpd-php The first one listed will cause files named “r” to be executed as PHP scripts, same as if [...]]]></description>
			<content:encoded><![CDATA[<p>If you are trying to use the ForceType directive in your .htaccess  files with PHPsuexec, it will fail. To work around this, simply use  SetHandler instead of ForceType.<br />
example:</p>
<p>&lt;Files r&gt;<br />
SetHandler  application/x-httpd-php<br />
&lt;/Files&gt;</p>
<p>or</p>
<p>SetHandler  application/x-httpd-php</p>
<p>The first one listed will cause files named  “r” to be executed as PHP scripts, same as if it is named r.php basically. The 2nd example will  parse every file through php.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.learncpanel.com/server-administration/php-suexec-forcetype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading MySQL 4 to MySQL 5</title>
		<link>http://www.learncpanel.com/server-administration/upgrading-mysql-4-to-mysql-5/</link>
		<comments>http://www.learncpanel.com/server-administration/upgrading-mysql-4-to-mysql-5/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 02:22:38 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.learncpanel.com/?p=129</guid>
		<description><![CDATA[Login to WHM as root and go to tweak settings. Under the Myql Section click version 5.0. Login to the server through shell and run /scripts/mysqlup Once this is completed, make sure mysql 5 has started, run mysql If it fails to connect run /etc/init.d/mysql start If it fails to start edit the /etc/my.cnf and [...]]]></description>
			<content:encoded><![CDATA[<p>Login to WHM as root and go to tweak settings. Under the Myql Section  click version 5.0. Login to the server through shell and run</p>
<p><strong>/scripts/mysqlup</strong></p>
<p><strong></strong>Once this is completed, make sure mysql 5 has  started, run</p>
<p><strong>mysql</strong></p>
<p><strong></strong>If it fails to connect run</p>
<p><strong>/etc/init.d/mysql start</strong></p>
<p>If it fails to start edit the /etc/my.cnf and commend out the line  Basedir=/var/lib/mysql and then start mysql</p>
<p>Once you have mysql 5 fully started you must recompiled php to work  with the new mysql errors. You can either do this from source or from  easyapache whichever you are more comfortable with. If you choose  easyapache make sure you select option #7 from the easy apache menu and  you do not need to make any changes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.learncpanel.com/server-administration/upgrading-mysql-4-to-mysql-5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HowTo: Import/Export mysql database from shell</title>
		<link>http://www.learncpanel.com/server-administration/howto-importexport-mysql-database-from-shell/</link>
		<comments>http://www.learncpanel.com/server-administration/howto-importexport-mysql-database-from-shell/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 02:22:07 +0000</pubDate>
		<dc:creator>Jacob</dc:creator>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.learncpanel.com/?p=127</guid>
		<description><![CDATA[To export a database run mysqldump datbasename &#62; databasename.sql This will export the database to databasename.sql To import a database from an sql dump file run mysql databasename &#60; dumpsqlfilename.sql This will import the sql file into the database. Once imported you should check to make sure it was correctly imported to do this run [...]]]></description>
			<content:encoded><![CDATA[<p>To export a database run<br />
<strong><br />
mysqldump datbasename &gt; databasename.sql</strong></p>
<p>This will export the database to databasename.sql</p>
<p>To import a database from an sql dump file run</p>
<p><strong>mysql databasename &lt; dumpsqlfilename.sql</strong></p>
<p>This will import the sql file into the database. Once imported you  should check to make sure it was correctly imported to do this run</p>
<p><strong>mysql databasename<br />
show tables;</strong></p>
<p>If the you do not see any tables listed then the sql file likely has a  USE statement at the top. Edit the sql file with a text editor and  comment out the line “USE databasename”. Once commented out attempt to  import the data and check the tablesl.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.learncpanel.com/server-administration/howto-importexport-mysql-database-from-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

