Archive for May, 2010

Quotas will not be enabled on /home to prevent performance degradation.

May 21st, 2010

Error: Quotas will not be enabled on /home to prevent performance degradation.

You may see this when running /scripts/initquotas or /scripts/fixquotas. Either there’s something wrong with your /etc/fstab file that cPanel couldn’t correct, or you have your backups set to provision to a folder in /home, which is not recommended. This disabling of usrquota on /home is intentional if backups are set to go to /home.

# grep BACKUP /etc/cpbackup.conf

You can check the configuration in WHM >> Configure Backups, or via SSH with:

root@main [/home/ihost/public_html/skoal]# grep BACKUPDIR /etc/cpbackup.conf
BACKUPDIR /home/somefolder

If you see something similar to the above, quotas are not going to work for you. You’ll want to set backups to be delivered offsite via FTP, or to another partition, ideally a completely separate hard drive in case of hard drive failure.

Share

How To Reinstall Horde

May 21st, 2010

To reinstall Horde, preserving the existing database, you can use the following:

/usr/local/cpanel/bin/update-horde --force

Share

500: [warn] Directory / is not owned by username

May 21st, 2010

If your site is getting a 500 error, you’ll want to check Apache’s error_log at /usr/local/apache/logs/error_log.

If you see the following error, you’ll want to check the ownership of “/” to ensure it’s owned by root:root, and not a user on your server.

[Mon May 03 22:26:47 2010] [warn] Directory / is not owned by rrsdd

Let’s check the ownership:

# stat /
File: `/'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 1bh/27d Inode: 99717474 Links: 26
Access: (0755/drwxr-xr-x) Uid: ( 535/ cpus123) Gid: ( 0/ cpus123)

This shows that the / folder is owned by “cpus123″ which is incorrect, and you’ll want to change the ownership to root:root.

#chown root:root /

Now let’s verify:

# stat /
File: `/'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 17h/23d Inode: 917505 Links: 25
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)

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

Automatically Create DomainKeys Records When Creating Account

May 21st, 2010

Hopefully this will someday be an option in “Tweak Settings”, but in the meantime, you can add DomainKeys records to your customers DNS zones automatically by creating a “hook” which will be run after /scripts/wwwacct (the script behind “Create an Account” in WHM).

You’ll want to create a file called /scripts/postwwwacct, and add the following content:

my %OPTS = @ARGV;
my $user = $OPTS{’user’};
/usr/local/cpanel/bin/domain_keys_installer $user

You’re all set now — there’s nothing else that needs to be done. Note that this only creates the DomainKeys records for new accounts. If you want to create DomainKeys records for all your existing users at once, check out my other article on the topic: http://www.cpaneladmins.com/2009/12/07/install-domainkeys-and-spf-records-for-all-users/

Share

Apache error: RewriteCond> directive missing closing ‘>’

May 21st, 2010

Error:

httpd: Syntax error on line 13 of
/home/girit/public_html/.htaccess.igvjRiTOB3TiKlh0Pf8wcDk4yuRcH5ba:
RewriteCond> directive missing closing '>'

Solution: edit the .htaccess file in vi (or your favorite text editor) and ensure there is a blank line (new line) at the bottom of the file.

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

Adding SPF records for a user via SSH

May 6th, 2010

# /usr/local/cpanel/bin/spf_installer USERNAME

Share

Fix: MySQL quotas showing 0.00MB

May 6th, 2010

If your MySQL databases are all showing 0.00MB usage, you need to enable disk_usage_include_sqldbs.

1. Fix this issue via WHM
In Tweak Settings, enable “Calculate the disk usage of account MySQL and PostgreSQL databases.”

The default setting is “disabled”, or unchecked.

1b. Fix this issue via SSH
Or you can enable MySQL database calculation via SSH by editing /var/cpanel/cpanel.config

You’ll want to search for

disk_usage_include_sqldbs=0

and change it to

disk_usage_include_sqldbs=1

If the parameter is not present, you’ll want to add it.

2. Run the update script to perform the initial calculations:
Finally, to calculate your MySQL and PostgreSQL database sizes, run the following:

# /scripts/update_db_cache

Share

Reverse DNS on cPanel

May 3rd, 2010

97%* of providers don’t allow their customers complete control of reverse DNS. If you’re part of that 3%*, check out this wiki article as a resource.

* Statistics made up, but accurate from what I’ve seen.

Share

cPanel Web Site Hosting by IntraHost