Archive

Archive for the ‘HOWTOs :: WHM/Cpanel Problems’ Category

How to create your own hosting packages in WHM ?

October 12th, 2009

What is package ?

Packages enables you to create your own custom web hosting packages/plans and are a critical function in WebHost Manager.
Web Host Manager (WHM) helps you in this process by allowing you to customize a large number of parameters, from disk space and bandwidth to the number of sub-domains and MySQL databases, as well as specifying whether CGI, shell access, and what CPanel default theme are provided.

Step-by-step procedure to create hosting packages in WHM reseller panel.

====================================================
IMPORTANT NOTE: do not put “unlimited” text in any fields while creating package as WHM takes “Unlimited” = 1. you can assign some number 99 or 999 or 9999 instead of “unlimited”. Enter “0″ (zero) when you do not want to allow that particluar feature.
====================================================

To add a package:

1) Click on the Add New Package link in the Packages menu.

2) Enter the name of the package and the maximum disk space the account can occupy in the Package Name and Quota fields.

3) Indicate whether Shell Access is allowed in the Shell Access tick box.

4) Enter the maximum number of items allowed in the Max Ftp Accounts, Max Email Accounts, Max Email Lists, Max SQL Databases, Max Sub Domains, Max Park Domains, and Max Addon Domains fields.
See above IMPORTANT information.

5) Never tick IP tick Box.

6) Indicate whether CGI access and Frontpage Extensions are allowed in the CGI Access and Frontpage Extentions tick boxes.

7) Enter the maximum bandwidth in megabytes allowed by the account in the Bandwidth Limit field.

Cool Select default CPanel theme for the package in the Cpanel Theme
field.

9) Click on create button on top.

10) You can see status “Created the package yourusername_packagename”. WHM creates packages by adding your user name as prefix to package name.

Now you can start creating domains using this package.

HOWTOs :: WHM/Cpanel Problems

What IS the Apache (HTTP Server)

October 12th, 2009

The Apache Project is a collaborative software development effort aimed at creating a robust, commercial-grade, featureful, and freely-available source code implementation of an HTTP (Web) server. The project is jointly managed by a group of volunteers located around the world, using the Internet and the Web to communicate, plan, and develop the server and its related documentation.

These volunteers are known as the Apache Group. In addition, hundreds of users have contributed ideas, code, and documentation to the project.

HOWTOs :: WHM/Cpanel Problems

Cpanel Documentation

October 12th, 2009

Here is the URL for Cpanel Documentation.

http://www.cpanel.net/docs/cp/index.html
_________________

HOWTOs :: WHM/Cpanel Problems

WHM Documentation

October 12th, 2009

Welcome to visitors.

You can go through WHM documentation at http://www.cpanel.net/docs/whm/index.html

HOWTOs :: WHM/Cpanel Problems

Perl script to update the web stats

October 12th, 2009

To overcome the stats problem i have written the following perl script.

The idea of this script is to check the time stamp of the stats index page i.e /home/steve/tmp/webalizer/index.html and calculate the difference days between file time stamp and the present server time stamp and update the stats if the difference is more than 2 days ( we can change this value ).

This script requires the Date::Calc module so first you need to check for that module and install it if it is not instlalled.

You can install it from WHM ->> Software ->> Install a perl module.

1) vi /rsanetworks/web.pl

#=======================================================================================================================
#
# Script to update the webalizer stats
#
# Author : Steve
#
# Date : 14/04/2006
#
#=======================================================================================================================

#!/usr/bin/perl

use warnings;
use strict;

use Date::Calc qw(Delta_Days); # to calculate the difference days between two dates

my %users;

open FH, ‘/etc/trueuserdomains’ or die $!;

while ( <FH> )
{
my @arr = split /:/;
$users{$arr[1]} = $arr[0];
}

while ( my ( $user, $domain ) = each %users )
{
chomp ( $user, $domain );
$user =~ s/^\s//;
$domain =~ s/^\s//;
my $file = “/home/$user/tmp/webalizer/index.html”;
$file =~ s/(\s)//;

if ( -e $file ) #checking whether previous stats have been generated
{
my $prev = ( stat ( $file ) )[9] ;
my ( $pd, $pm, $py ) = ( localtime ( $prev ) )[3..5]; #pd - previous date pm - previous month py - previous year
my ( $cd, $cm, $cy ) = ( localtime ( time ) )[3..5];
my $diff = Delta_Days( $cy, $cm + 1, $cd, $py, $pm + 1, $pd ); # we have added 1 to month to avoid 0 which is for Jan if ( $diff < -2 ) # if you want to change the difference days you can do it here but it should be nagative
{

chdir( “/usr/local/apache/domlogs” );
system ( “/usr/local/cpanel/3rdparty/bin/webalizer -N0 -D /home/$user/tmp/webalizer/dns_cache.db -R250 -p -n
$domain -o /home/$user/tmp/webalizer $domain > /dev/null 2>>error_stat.log ” );
}
}

else # No previous stats
{
chdir( “/usr/local/apache/domlogs” );
system( “/usr/local/cpanel/3rdparty/bin/webalizer -N0 -D /home/$user/tmp/webalizer/dns_cache.db -R250 -p -n
$domain -o /home/$user/tmp/webalizer $domain > /dev/null 2>>error_stat.log “);

}
}

# Script ends here

HOWTOs :: WHM/Cpanel Problems

Running webalizer manually for many domain through script.

October 6th, 2009

Hi,

Sometimes it is very difficult task for us to update the webstat mannually for reseller client because some reseller contain 20,50,100 clients. So we can make this task very simple through script.
You can follow the below steps, Before following the steps. You must see the server load.It should be less.Open the another terminal of the same server and watch the server load while running the script :-

========================================================
1. make one file under root
[~]# touch pan

2. Go to whm and click on show reseller account, Find the reseller account and copy all the reseller client in the above created file “pan”

3.Execute the below command. It will extract the username of all the reseller’s client and keep it in “pan” file.
[~]# cat pan |cut -f1 |tee pan

4. Then execute the below command. It will update the webstat of all the domain .
[~]# for i in `cat pan`;do /scripts/runweblogs $i;done

========================================================

After finishing the script you can see the webstat whether it is updated or not .

HOWTOs :: WHM/Cpanel Problems

Horde won’t delete emails

October 6th, 2009

Hi,

Some times cleints getting following error when they are trying to delete emails in HORDE even the account and email account disk space is not an issue

There was an error moving messages from “Inbox” to “trash”. This is what the server said: [ALERT] COPY failed - no write permission or out of disk space.

Don’t waste your time by running scripts, just try the following method

- make copy of files for backup and move somewhere else
- remove mail account in Cpanel
- create exact mail account
- copy backup inbox file over new
- re-log into Horde and try delete now

HOWTOs :: WHM/Cpanel Problems

How to fix unlimited quotas and 0.00 disk usage problem

October 6th, 2009

Hi,

Quota Problem, /scripts/fixquotas no help. [fix]

First run “quotacheck -avugm”, you should receive “quotacheck: Can’t find filesystem to check or filesystem not mounted with quota option.” If not you don’t have the same problem.

Next step is to open fstab, type pico /etc/fstab.
The first line will probably look something like this:
“/dev/VolGroup00/LogVol00 / ext3 defaults 1 1″

What we want to do is change “defaults” to “usrquota”.

Now save (ctrl + X, Y, Enter) and run “mount -o remount /”.

Now run “quotacheck -avugm” once more. This time it should run through quotacheck normally.

After it is done running (and it may very well take quite a long time) you should get:

“Old group file not found. Usage will not be substracted.
done
quotacheck: Checked xxxx directories and xxxx files”

This is a good thing. Now run run “quotaon /”

Now your space used should be correct, but quotas may still be unlimited.

This isn’t a problem, just run good old /scripts/fixquotas and let it run through. It will probably run quotacheck again but it won’t hurt anything. And when it’s done your quotas should be working as normal.

Original source:- http://forums.cpanel.net/showthread.php?t=42742

HOWTOs :: WHM/Cpanel Problems

Cpanel - YAML READ ERROR

October 6th, 2009

Hi,

Error :
—————————————
[a fatal error or timeout occurred while processing this directive]
YAML READ ERROR:
Failed to load YAML document from string at /usr/local/cpanel/Cpanel/cPAddons.pm line 2492
—————————————–
You will get the above error in cpanel -> scripts library when you click on any of the feature such as Agora shopping cart, phpMychat etc..

Tried by installing some of the perl modules related to YAML::Tiny and also ran /scripts/upcp –force but that did not fix the error.

Sol:

So just copied the file cPAddons.pm from other server and restarted the cpanel.

Note: Not recommended Solution. Please try another solution if possible and update.

HOWTOs :: WHM/Cpanel Problems

Add-on Domain issues

October 6th, 2009

When client trying to add an addon domain which point to a subdomain on an account. The domain is not yet specified on the server, but the cPanel reports this error
====================================
Addon Domain Additions

Bind reloading on host using rndc zone: [myhost.com] The subdomain, newdomain.myhost.com has been added.

Error from park wrapper: newdomain.com is already configured.

Removed Entry from httpd.conf The subdomain, newdomain.myhost.com has been removed.

xxxx.com could not be setup. The subdomain newdomain.myhost.com was not setup either.
==============================

You may not find newdomain.com in httpd.conf or zone in /var/named folder. To resolve above error you need to check other files and delete newdomain.com entries from below list of files and folders.

Normally this is because the domain is still listed in a config file, either /etc/localdomains, /etc/userdomains, /var/cpanel/users/*, or httpd.conf.

HOWTOs :: WHM/Cpanel Problems