Featured Posts

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...

Read more

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...

Read more

Simple Bash Script to Fix Account Permissions This is a simple bash script I wrote to fix the permissions and ownership of files within a cpanel account. To use, simply copy the script your server, chmod 755, and pass the usernames as arguments: ./fixperms...

Read more

Re-Installing Auxiliary cPanel Software Cpanel has a lot of supporting software that you may be using on your server. In case something goes amiss, here is a list of scripts that reinstall cpanel-provided software on your system. For most all...

Read more

10 Free Monitoring Solutions to Consider Server and network monitoring can be crucial to a host's success. I mean, how embarrassing is it when your customers are aware of downtime before you are? You don't have to pay big bucks or spend loads...

Read more

The cPanel Admin Rss

Allowing Users to Customize AwStats

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

0

You can allow users to use their own configuration file for AwStats in case they are in need of customizations not provided by the server’s main config.  To enable this option, add the following to /etc/stats.conf:

allow_awstats_include=1

Alternatively, you can go to WHM > Statistics Software Configuration, and click on Allow Awstats configuration Include file

This will allow users to have an awstats.conf.include file in /home/$username/tmp/awstats, which can be used to override settings from the main AwStats configuration for the server.

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