Archive for the ‘Cpanel’ Category

Missing Accounts From WHM

Monday, February 22nd, 2010

If you list accounts and one of your accounts is missing, run this command in the shell:

/scripts/rebuildcpusers

Disable Mod_Security In .htaccess

Friday, November 20th, 2009

This post adresses the issue of disabling mod_security on a per account basis. Just add this code to a .htaccess file:

SecFilterEngine Off
SecFilterScanPOST Off

Wrong Datatype Error In Fantastico

Thursday, November 5th, 2009

If you receive a Wrong Datatype in /tmp/ message in your fantastico, here’s the fix:

Login to WHM and check in Tweak Settings if Ioncube PHP Loader is selected. It should be.

If that solved the issue, Goodbye. If it didn’t, Hello!

SSH to your server as root and run this command:

/scripts/makecpphp

That should fix your problem.

Correct Permission Problem In Suphp

Tuesday, November 3rd, 2009

With Suphp, you can’t have any files or folders with permissions greater than 755. Otherwise, you will get a Internal Server Error. There could be other reasons for that error. You must check the apache error_log. In Centos, you will find that file in /usr/local/apache/logs/error_log.

Confirmed the permission problem, a easy fix is to ssh to the server. Access the public_html folder of the account. And run these commands:

find . -type f -exec chmod 644 '{}' \;
find . -type d -exec chmod 755 '{}' \;

If you don’t have ssh access to your shared hosting account, upload a php file to the public_html directory and call the file in the browser. Include this code in the php file:

<?
shell_exec("find . -type d -exec chmod 755 {} \\;");
shell_exec("find . -type f -name '*.php' -exec chmod 644 {} \\;");
?>

Expired License

Sunday, November 1st, 2009

Have you ever logged into cpanel or whm and found a Expired License message?Why and how to deal with this message?

One of the reasons for the display of this message could be that your cpanel license has expired. Check if that is the case. Cpanel has a tool for you to verify if your cpanel license is valid.

Your server’s main IP address could be different than the licensed IP address or your server could be experiencing problems perfoming dns lookups. SSH to your server and run the following command:


curl http://www.cPanel.net/showip.cgi

If your main IP is not licensed, you must update your cpanel’s license information. If you get an error, after running this command, you must check your /etc/hosts and /etc/resolv.conf files.

Also check if your hostname is properly configured. It should have this format: subdomain.domain.com.

Finally, try this command:


/usr/local/cpanel/cpkeyclt

It will just try to validate the license with cpanel’s servers. Sometimes, the expired license message is due to temporary connection problems with cpanel’s servers and the license is not validated. This command will resolve that issue. If you receive an error, you must check why your server is unable to connect with cpanel’s servers.

Round Cube Perfomance

Sunday, November 1st, 2009

Cpanel has announced a few changes that will increase the perfomance of Round Cube, dealing with a growing number of reports regarding excessive CPU usage.  The changes have been applied to the Beta Build. And Cpanel will publish these changes to the Edge Build soon.

Round Cube is a very attractive webmail software, due to it’s AJAX features. I hope they can optimize it’s resource usage. You can’t rely on a webmail software that undermines the server’s perfomance.

Limit Number Of Emails Per Hour Per Account

Friday, October 30th, 2009

As you know, you can limit the number of emails any account can send, per hour, in WHM. Just click Tweak Settins, below Server Configuration. But, how do you assign a different value for an individual account, different fro the value assigned to everyother account? You might want to give a certain account a greater limit. Or even restrict that account’s hability to send emails.

SSH to your server. And open the file /var/cpanel/maxemails. Then just add the code:

domain.com=100

This value will override the default value for this domain. So, if you assigned a 2000 limit in Tweak Settings, domain.com would have a limit of 100.

Unlimited Disk Space

Thursday, October 29th, 2009

Sometimes, you list accounts in WHM and the disk limit of each account is unlimited. That’s obviously a problem, because you wont be able to limit disk space usage. The fix is normally an easy fix. Just login to your server with ssh and run this command

/scripts/fixquotas

Usually this script will fix this problem.

/usr Partition Full

Thursday, October 29th, 2009

Is your /usr partition full? Or almost full? That could be a problem. Here’s a way to fix it.

Run:

cd /usr/local/apache/logs/

List the contents of that directory with ll. Are there any big files? Empty those files. Here’s an example. If you want to empty error_log for example, just run:

echo > error_log

You can repeat this procedure in /usr/local/cpanel/logs/. Just empty any large files.

Then go to /usr/local/apache/domlogs/. And list the biggest 10 or 20 files. For the top 10, run:

ls -al -SR | head -10 —>

Are there any big files? Running awstats for that domain should clear the file. Just run:

/scripts/runweblogs user

Login to WHM. Check if log rotation is active for apache and cpanel logs. For apache, click Service Configuration -> Apache Configuration -> Log Rotation. For cpanel, click Service Configuration -> cPanel Log Rotation Configuration.

Empty MySQL Backup – 20 bytes

Thursday, October 29th, 2009

If you login to cpanel, download a mysql backup and the backup is empty, try this:

Go to your home directory. You can use cpanel’s File Manager. Or you can access your home directory through ftp. Find a file called my.cnf. Rename it to my.cnf.backup.

What will happen? You probably changed your cpanel password. The new password was not updated in my.cnf. By deleting this file, the next time you login to cpanel, it will have to recreate it with your new password. And that will solve your mysql backup problem.

The mysql backup process uses that file to access the mysql databases. If the password is incorrect, the cpanel process will be denied access to those databases. You will not see any error, because it’s not logged in your cpanel interface. But you will get an empty database backup instead.