Archive for the ‘cPanel’ category

Sample WHM Plugin – Hello World

January 31st, 2011

#!/usr/bin/perl
#WHMADDON:helloworld:Hello World <b>Example</b>

###############################################################################
# This is an example hello world WHM plugin feel free to modify it as you see fit
###############################################################################
# Load general use case perl modules
use lib '/usr/local/cpanel';
use Cpanel::cPanelFunctions ();
use Cpanel::Form ();
use Cpanel::Config ();
use Whostmgr::HTMLInterface ();

use Whostmgr::ACLS ();
###############################################################################
print "Content-type: text/html\r\n\r\n";
# Check user has root permissions
Whostmgr::ACLS::init_acls();
if ( !Whostmgr::ACLS::hasroot() ) {
# User is not root, tell them where to go
print "You need to be root to see the hello world example.\n";

exit();
}

# Parse input parameters from GET and POST into $FORM{} for later use
my %FORM = Cpanel::Form::parseform();

# Print a WHM Header
Whostmgr::HTMLInterface::defheader( "Hello World Example Plugin",'/path/to/logo.gif', '/cgi/addon_helloworld.cgi' );

# Print General Output
print "<p>Hello world indeed...</p>";

# End Example

1;

Source

Share

Suggest Topics for cPanelAdmins Articles

January 27th, 2011

It’s been a while since our last update, and we’re curious what topics people would like to see detailed on cPanelAdmins.com. Leave a quick comment, and we’ll consider your topic.

Share

cPanel Log Locations

July 29th, 2010

cPanel Log File Locations

This is a shortlist of various log files for various applications on your Cpanel VPS.

cPanel Installation Logs:
/var/log/cpanel-install-thread0.log

Apache:
/usr/local/apache/logs/access_log
/usr/local/apache/logs/error_log

Apache domlogs:
/usr/local/apache/domlogs/example.com

Apache SUEXEC Logs:
/usr/local/apache/logs/suexec_log

MySQL
/var/lib/mysql/hostname.err

BIND (named) Log:
/var/log/messages

Exim
/var/log/exim_mainlog
/var/log/exim_paniclog
/var/log/exim_rejectlog

Courier or Dovecot IMAP
/var/log/maillog

Tomcat Logs:
/usr/local/jakarta/tomcat/logs/catalina.err
/usr/local/jakarta/tomcat/logs/catalina.out

cPanel Access Log:
/usr/local/cpanel/logs/access_log

cPanel Error Log:
/usr/local/cpanel/logs/error_log

cPanel License Log:
/usr/local/cpanel/logs/license_log

Stats Execution Logs:
/usr/local/cpanel/logs/stats_log

ChkServd (cPanel Monitoring Daemon) Logs:
/var/log/chkservd.log

cPHulkd
/usr/local/cpanel/logs/cphulkd.log

cPanel Backup Logs:
/usr/local/cpanel/logs/cpbackup/*.log

Pure-FTP
/var/log/messages
/var/log/xferlog (symlinked to /usr/local/apache/domlogs/ftpxferlog)

Cron Logs:
/var/log/cron

SSH Logs:
/var/log/secure

ModSecurity:
/usr/local/apache/logs/modsec_audit.log
/usr/local/apache/logs/modsec_debug_log

Share

Troubleshooting cPanel License Issues

July 29th, 2010

If you get an error message that your cPanel instance is not activated, and you believe this to be in error, here are some steps for troubleshooting:

1. Re-check in with the license servers:
/usr/local/cpanel/cpkeyclt

If you see the following, you’re in good shape:

# /usr/local/cpanel/cpkeyclt
Updating cPanel license...Done. Update succeeded.
Building global cache for cpanel...Done

2. If that doesn’t work, you’ll want to go to the cPanel License Verification System to ensure your license is still valid.

3. If the IP is licensed properly, check the server to see if cPanel is detecting the correct IP address for your install:
# curl cpanel.net/apps/myip/

Running that command should return your base IP address. If it doesn’t, then there is a networking issue, or the wrong IP address is licensed.

4. If all else fails, open a ticket with cPanel Customer Service.

Share

Link to Software Package Page in Fantastico

June 14th, 2010

Linking to a specific software package in Fantastico is easy, and great for use with custom icons, or for linking customers to the installation/configuration page.

For example, a link to PHPBB2 looks like this:

https://yourhostname.tld:2083/frontend/x3/fantastico/autoinstallhome.php?app=phpBB2

This one’s a no-brainer really, as the links are the same in the Fantastico interface, but some might find this useful when creating custom icon groups in cPanel.

Share

info [rebuildhttpdconf] User ‘username’ data set has no ‘main_domain’ key.

May 21st, 2010

Error: info [rebuildhttpdconf] User ‘username’ data set has no ‘main_domain’ key.

Solution: Check to see if there is a file called “main” for the user(s) affected users in /var/cpanel/userdata/username.

If it’s not present, verify the domain exists in httpd.conf, and run /usr/local/cpanel/bin/userdata_update to recreate the “main” file based off the apache configuration.

Share

The update server is currently updating its files.

May 10th, 2010

When running “upcp”, you may see the following:

"The update server is currently updating its files."
"It may take up to 30 minutes before access can be obtained."
"Waiting 510 seconds for access to the update server....."

This means that the developers are pushing a new build of cPanel to the update servers. The upcp script will continue to run, and will retry the update periodically until the build is uploaded and available for download.

Share

info [rebuildhttpdconf] User ‘username’ data set has no ‘main_domain’ key.

May 3rd, 2010

Error:

info [rebuildhttpdconf] User 'noothna' data set has no 'main_domain' key.

Check /var/cpanel/userdata/username/main and main.cache to verify it has the necessary content. Check another domain’s main and main.cache accounts to verify what you should be seeing there.

Share

How to Restart Mailman

May 3rd, 2010

Currently, cPanel does not include a restartsrv_mailman script in /scripts. Until they do, you can use the following:

cpanel# /usr/local/cpanel/3rdparty/mailman/bin/mailmanctl -s restart

Or you can restart the cpanel service, but that’s overkill.

Share

How to Uninstall cPanel (no, not really)

April 22nd, 2010

You shouldn’t try to uninstall cPanel (reinstall your OS), and the cPanel “uninstall” script reenforces that:

# cat /usr/local/cpanel/uninstall

#!/bin/sh
# Uninstall script for Cpanel
rm -f "/usr/local/cpanel/uninstall"
#### END OF UNINSTALL
echo "Cpanel has been uninstalled."

Share

cPanel Web Site Hosting by IntraHost