Archive for the ‘cPanel’ category

How to Install cPanel DNSonly

April 22nd, 2010

Installing cPanel DNSonly should only be done on a fresh installation of a supported OS.

cd /home
wget http://layer1.cpanel.net/cpanel-universal-dnsonly-install.sea
sh cpanel-universal-dnsonly-install.sea
cd cpanel-universal-dnsonly-install
sh install

Share

cPanel and WHM Plugins / Addons

April 10th, 2010

I thought I’d put together a quick post with links to various cPanel & WHM plugins. I haven’t used all of these, so don’t consider this an endorsement of any kind. :) For now, check out the cPanel forums apps and plugins area which in you might find better reviews.

Eventually I’ll post a review of these (at least the free ones) as time allows.

Free WHM Plugins

  • ConfigServer.com Firewall – manages iptables, handles brute force attacks, and much more. This is one that I’ve used, and definitely recommend.
  • ConfigServer.com ModSec Control – modify ModSecurity rules on a global or per-user basis, and view logs.
  • NDCHost’s Clean Backups – clean backups for accounts which don’t exist after a certain period, automated, or on a manual basis.
  • NDCHost’s Account DNS Check – Checks and reports domains which don’t resolve to the assigned IPs in http.conf.
  • ConfigServer.com Explorer – provides a “File Manager-like” interface allowing you access to your filesystem via GUI.
  • ConfigServer.com Mail Queues – Stats and management of your server’s mail queue.
  • ConfigServer.com Mail Manage – Management of your email accounts, important statistics, and displays of accounts over quota, over a certain size, etc.

Pay WHM Plugins

  • ConfigServer.com’s eXploit Scanner – active scanning of your server to prevent exploits.
  • NDCHost’s Secondary MX – Turns a cPanel DNSonly install into a backup MX server.

Free cPanel Plugins

  • cPanel’s cPAddons – Allows installation of several popular PHP scripts. Installed via WHM >> Install cPAddons.

Pay cPanel Plugins

  • Netenberg’s Fantastico – Installs over 50 popular PHP scripts [List]. The vast majority are free, open-source software, though a few require a license.
  • Softaculous – over 130 PHP scripts.
Share

BSD::Resource not available

January 7th, 2010

# /scripts/perlmods -l | grep -ai "BSD::Resource"

not listed?
# /scripts/checkperlmodules --full

Share

Install DomainKeys and SPF Records for All Users

December 7th, 2009


cd /var/cpanel/users
for user in * ; do /usr/local/cpanel/bin/domain_keys_installer $user ; done
for user in * ; do /usr/local/cpanel/bin/spf_installer $user ; done

Share

Could not find functions file, your system may be broken

December 7th, 2009

Error: Could not find functions file, your system may be broken

Fix:

touch /etc/rc.d/init.d/functions
/etc/rc.d/init.d/cpanel restart

Share

How to Disable Stats for a Specific User

November 10th, 2009

You can disable the stats service (Analog Stats, Awstats or Webalizer) for a specific user by doing the following:

1) Login to your server via ssh.

2) Edit /var/cpanel/users/username, and add any of the following, as needed:

skipanalog=1
skipawstats=1
skipwebalizer=1

3) Now we’ll restart the cPanel service:

/etc/init.d/cpanel restart
Share

How to install imagick for PHP

November 10th, 2009

The imagick.so PHP module can’t currently be installed via PECL, due to it’s inability to write to /var/tmp. To get around that, you can install it manuall:

# yum install ImageM* netpbm gd gd-* libjpeg libexif gcc coreutils make
# cd /usr/local/src
# wget http://pecl.php.net/get/imagick-2.2.2.tgz
# tar zxvf ./imagick-2.2.2.tgz
# cd imagick-2.2.2
# phpize
# ./configure
# make
# make test
# make install

This will compile imagick.so, and move it to your extensions directory specified in php.ini. Now you’ll need to add the following to php.ini:

extension=imagick.so

and restart apache:

/scripts/restartsrv_httpd
Share

How to strace cPanel software

November 10th, 2009

From time to time, strange issues pop up which aren’t going to be logged to an error log. For some of the more “hard to track down” issues, you can use strace to see just what the process is doing, and where your issue might be.

This article won’t go into how to read straces, as there are many other articles written about this, but I’ll provide a good base from which to start.

strace -v -o /root/strace.cpanel -f -s 4096 -p `cat /var/run/cpsrvd.pid`

That command uses several flags, outputting the strace to a file called strace.cpanel.

-v enables a more verbose output
-o specifies the file to output the contents to. If not specified, it will output directly to your terminal.
-f includes all processes forked by the process you’re stracing
-p will specify the PID. In this case, we’re going to cat the pic from cpsrvd.pid

Share

How to Enable and Repair Quotas in cPanel

October 31st, 2009

Quotas can be kind of a pain sometimes. If your accounts are showing 0 disk space used, be sure that you have enabled quotas in cPanel. Most people select this option during the initial cPanel configuration, but you can always enabled them later in WHM -> Initial Quota Setup. Once you’ve done that, let’s ensure that quotas are enabled on your partitions. You really only need them enabled on /home and /var. If you have a single partition, enable them on /.

fstab

If you needed to add usrquota to your /home partition, save your changes in /etc/fstab, and remount /home with

mount -o remount /home

Now we can run the following to repair the quotas:

/scripts/fixquotas

There are still plenty more ways that quotas can break, and dozens of errors associated with broken quotas, which I hope to go into deeper in the future.

Share

FAILED LOGIN webmaild: user password hash is missing from system (user probably does not exist

October 4th, 2009

From http://forums.cpanel.net/f43/account-based-email-login-problem-97109.html

root@servername [/home]# authtest -s imap test@normaldomain.info password
Authentication succeeded.

Authenticated: test@normaldomain.info (system username: normaldo)
Home Directory: /home/normaldo/mail/normaldomain.info/test
Maildir: /home/normaldo/mail/normaldomain.info/test
Quota: 262144000S
Encrypted Password: $1$KHntyoqN$wih5o0N7ZTf6Fm4vasrxj.
Cleartext Password: password
Options: (none)

FOR MY PROBLEMATIC DOMAIN:::

root@servername [/home]# authtest -s imap info@problemdomain.info password
Authentication FAILED: Operation not permitted

What you want to do next is check /usr/local/cpanel/logs/login_log to see what the exact issue is. In my circumstance, I received this error:

208.74.121.102 - info@jurnamakelaars.nl [10/04/2009:14:37:11 -0000] "POST /login/ HTTP/1.1" FAILED LOGIN webmaild: user password hash is missing from system (user probably does not exist)

I then checked the user’s shadow file in /home/USERNAME/etc/domain.com/shadow and saw that it was corrupt. I removed the file, created a new one, and applied user:mail permissions. I then created a new email account, then copied the user’s encrypted password after making entries in shadow for the existing users. I was then able to login to each webmail account without issue.

Share

cPanel Web Site Hosting by IntraHost