Featured Posts

Using DKIM with Exim and cPanel Similar to the intentions of SPF records and DomainKeys, DKIM is intended to authenticate a sender by using a public/private key pair to digitally sign email, therefore increasing deliverability. At this...

Readmore

Copy Outgoing Email on a cPanel Server with Exim A common request we get is how a user can automatically BCC outgoing email to another address. This is most often requested by law firms that need to be able to retain copies of communication. Forwarding...

Readmore

Do You Care About Your Customers' Data? I was working a case last week for a new client that's been hosting local business websites for over three years. As with all of my case studies, I did a short survey of the client's infrastructure, processes,...

Readmore

Tips to Reduce Your Customer Support Costs When hosting websites, whether as a mainstream hosting provider, a hobby, or to supplement another service, it's your job to make sure your customers have access to technical support in case they need...

Readmore

Roundcube: MySQL or SQLite? cPanel 11.25 introduces a new feature: The ability to have RoundCube use SQLite instead of MySQL. After benchmarking resource usage and performance, I've come to the conclusion that SQLite is definitely...

Readmore

The cPanel Admin Rss

Skipping the WHM Setup Wizard on New Servers

Posted by Vanessa | Posted in Misc | Posted on July 23, 2010

4

If you have a fully automated cPanel/WHM setup method used to deploy a large number of servers, you’ve probably found it to be annoying that upon loading WHM for the first time, you’re greeted with a setup wizard that you have to click through.  To skip this wizard, all you need to do is touch a file:

touch /etc/.whostmgrft

This will tell WHM to skip the setup wizard altogether. However, if you haven’t already, you’ll want to add the following pieces to your automation which are usually configured in the setup wizard:

  • IMAP – /scripts/setupmailserver (courier | dovecot  | disabled)
  • DNS – /scripts/setupnameserver (bind | nsd | disabled)
  • FTP – /scripts/setupftpserver (pure-ftpd | proftpd | disabled)

You should also create the /etc/wwwacct.conf file, with the following contents:

ADDR 123.456.789.123
CONTACTEMAIL your@emailaddress
CONTACTPAGER
DEFMOD x3
ETHDEV eth0
FTPTYPE pureftp
HOMEDIR /home
HOMEMATCH home
HOST server.domain.com
LOGSTYLE combined
MINUID
NS ns1.yourdomain.com
NS2 ns2.yourdomain.com
NS3
NS4
NSTTL 86400
SCRIPTALIAS y
TTL 14400

Derived from : http://www.cpanel.net/blog/integration/2010/05/skipping-the-whm-getting-started-wizard.html

Disk Space for MySQL Databases in cPanel Show as 0MB

Posted by Vanessa | Posted in Misc | Posted on April 3, 2010

2

When you upgrade from cPanel 11.24 to 11.25, your users may notice that in cPanel, their MySQL databases show 0MB of disk space used, when they know their databases are much larger. This is due to an option in cPanel that you specifically have to enable. To enable MySQL disk usage tracking:

1) Edit /var/cpanel/cpanel.config

Change:

disk_usage_include_sqldbs=0

to

disk_usage_include_sqldbs=1

Then run the following:

/scripts/update_db_cache
This may take a few minutes if you have a ton of users with databases, but after this, you should see the database disk usage show up accurately in cPanel.

Statistics Management

Posted by Vanessa | Posted in Misc | Posted on February 3, 2010

0

One of the more important features to customers is the ability to view and analyze their web traffic. CPanel offers three statistics programs for end users to view their stats, all of which are free and open source:

  • Analog
  • AwStats
  • Webalizer

Configuring Stats

In WHM, go to Statistics Software Configuration and select which statistics programs to enable. The go to WHM > Tweak Settings as well and check the same stats programs under “Stats Programs“. Usually though checking them in one place or the other will enable them in both places.

You also want to set the update frequency of the logs, usually to 24 hours. You can check the box for allowing Awstats override configuration files as well, so that users will have their own awstats.conf they can modify in their tmp folders.

With this, you’ll need to verify into WHM > Tweak Settings the following value:

Number of days between processing log files and bandwidth usage (default 1, decimal values are ok)

Again, the Tweak settings and stats configuration are essentially the same setting, so updating one should update them both.

Now that stats will be running on a normal schedule, you can make additional configurations. In WHM > Tweak Settings, go to the Stats and Logs section and you’ll find a number of settings that you can configure:

  • Allow users to update Awstats from cPanel – This will put an ‘Update Now’ link in awStats for each user so they can run their own stats. Keep in mind that if you enabled the local Awstats config for users, they can override this setting.
  • Delete each domain’s access logs after stats run – If this is checked, the domain’s stats in /usr/local/apache/domlogs will be removed after each stats run
  • The load average above the number of cpus at which logs file processing should be suspended (default 0) – What server load will caused the stats to stop running
  • Awstats Reverse Dns Resolution – This resolves IPs in Awstats to hostnames. This can degrade performance on more populated servers, but seems to be preferred by end users.

Managing Stats

You can set time exclusions to indicate when stats should not be running. This is useful for servers that tend to have higher load during the day. To enforce this restriction, edit /etc/stats.conf and set:

BLACKHOURS=8,9,10,11,12,13,14,15

In that example, stats will not run between 8am and 3pm.

In WHM > Statistics Software Configuration, you can see if your server’s stats are running properly. If they are, you should see this:

The server currently is able to keep up with your statistics processing schedule.

If the message says otherwise, and your stats are not up to date, you may need to make changes to how you are running your statistics. Meaning, if you have a lot of users on the server, you may want to consider making one or more of the following changes:

  • Narrow the blackout hours (if specified)
  • Increase the load limit for processing stats in WHM > Tweak Settings
  • Change the frequency in which logs are being run, to allow more time

You may also want to see if there are any very large logs files in /usr/local/apache/domlogs, that could be taking a long time to run.  You may want to consider moving that user to another server or running their stats manually via cron job at a certain time every day.

To run a user’s stats manually, you can use WHM > Statistics Software Configuration, or use:

/scripts/runweblogs <user>

If stats have not been updating at all, it’s possible that cpanellogd isn’t running. Try restarting cPanel, and run /scripts/runlogsnow

cPanel Command Line DNS and Cluster Management

Posted by Vanessa | Posted in Misc | Posted on January 20, 2010

3

DNS clustering is part of setting up a server environment. cPanel has built-in support for DNS clustering to make it easy to deploy centralized nameservers, or have multiple nameservers receive DNS zone updates from one server. This article will help you understand setting up and managing a DNS cluster from command line.

Setting up a Cluster

From the remote nameserver:

You generally don’t need to do anything other than enable clustering in WHM. You want the client servers to sync TO this server, not from it. Most of the time, the remote server will be your primary nameserver running cPanel DNSONLY.

cPanel Out of Memory Errors

Posted by Vanessa | Posted in Misc | Posted on January 8, 2010

2

I’ve seen several features of cPanel appear to malfunction, and upon reviewing /usr/local/cpanel/logs/error_log, I’d see something similar to this:

Out of memory during request for 2180 bytes, total sbrk() is 130234368 bytes!

Common places this has been known to occur:

  • In Webmail (Horde and Roundcube)  when opening large attachments
  • Using cPanel’s perl module installer

You could legitimately be out of RAM, but most likely the cause is cPanel’s internal memory limit. You can raise this in WHM > Tweak Settings:

“The maximum memory a cPanel process can use before it is killed off (in megabytes). Values less than 128 megabytes can not be specified. A value of “0″ will disable the memory limits.”

Or you can adjust the maxmem setting in /var/cpanel/cpanel.config.

Installing an SSL Certificate on a Shared IP

Posted by Vanessa | Posted in Misc | Posted on December 30, 2009

10

It was kind of annoying in the midst of cPanel 11′s release when cPanel discontinued the ability to install an SSL certificate on a shared IP.  Sure, you can do it as ‘nobody’, but this tends to mess up things when you have open_basedir set up or you’re using suPHP. Sometimes you might not have another IP to use, or you’re using an IP-based monitoring system and don’t want to complicate things. I, personally, prefer to install my shared SSL certificates on the shared IP. But that’s just me…and I’m right about everything.

There is a crafty way to get around this limitation, though it does require root access and it can be a little annoying when it’s something you have to do on a normal basis. Come on cPanel, just let us do this again so we don’t have to keep coming up with workarounds. I assume at this point that you already know how to use WHM to install a certificate, and you’re aware that the hostname for the certificate has to correspond with a user already on the server. Duh.

The cPanel Backup System

Posted by Vanessa | Posted in Misc | Posted on December 29, 2009

8

Us cPanel system admins pity those who neglect to back up their sites and then blame their hosts when something goes awry…especially when cPanel makes it so damn easy to back up your entire account in just a few clicks — And we’re going to tell you how to do it.

Of course, we’re not going to stop there. We’re going to tell you exactly how the cPanel backup system works, how to generate/restore backups, what’s in the backups, and how to automate them so you can spend more time at the bar definitely working and not drinking beer, instead of worrying about what’s going to happen if a gnome crawls into your server vent and eats your hard drive.

Adding IP Addresses to a Server

Posted by Vanessa | Posted in Misc | Posted on December 28, 2009

2

In a hosted multi-site environment you may find yourself needing to add multiple IP addresses to a server. Luckily, cPanel makes it very easy to add IP addresses. This article will go over adding IP addresses to standalone servers, both through WHM and from command line on a cPanel server.

Adding Services to Chksrvd for Monitoring

Posted by Vanessa | Posted in Misc | Posted on December 28, 2009

1

Chkservd is the service in cPanel that checks to make sure that services are running, then restarts them if necessary.  It’s also responsible for the ‘Service Manager’ section in cPanel, which is also an interface where added services can be easily checked on and off.

Service files are in /etc/chkserv.d/

To add a new service, create a line in ”’/etc/chkserv.d/chkservd.conf’” in the same format as the others:

service:1

1 means the service should be enabled, 0 means it’s off.

In ”’/etc/chkserv.d”’ each service has its own file.  Create a file called as the name of the service you are monitoring.  The contents of the file are in the format of:

#SERVICE = PORT, SEND, RESPONSE, RE-START COMMAND

There are two ways that cPanel checks services with chkservd:

*Connection-based monitoring – By default, cPanel will try to connect to the service’s specified port, issue a command, and if a response is received within 10 seconds it will consider the service to be online. For instance, FTP:

service[ftpd]=21,QUIT,220,/scripts/restartsrv_ftpserver

*Process-based monitoring – cPanel will check for a specific process to determine whether it is online. For instance, named:

service[named]=x,x,x,/scripts/restartsrvr_bind,named,named|bind

If you have more than one restart command, you can separate them with semicolons in order of preference that they should be run.  Output of these commands will be logged to the chkservd.log

After you’ve created the service’s configuration file, restart chkservd:

/etc/init.d/chkservd restart

You should then see the service listed in WebHost Manager in the ‘service manager section’

Chkservd logs are in /var/log/chkservd.log.  Checks are done every 8 minutes, and everyone online service gets a +, offline services get a -.  If the service is determined to be offline, the restart command(s) specified in that service’s chkservd configuration file is issued and the output is logged.