CPanel Issue Troubleshooting
From BlueFur.com Support Wiki
What is this process called cpsrvd?
As of 9.1.0-E10 cpaneld,whostmgrd,webmaild have all been replaced by one process, which is called cpsrvd.
This process cpsrvd is your cpanel daemon, webmail daemon, and WHM daemon, in one process.
Help! I'm being DoS'd, how can I block an IP from accessing my server?
There is numerous methods for blocking users from accessing your server, let me say, first I recommend downloading APF, however if you want to manually block this IP, you should use the command:
iptables -A INPUT -s ip ip.address -j REJECT
Replace ip.address with the ip.address you would like to block.
How do I Secure my /tmp directory?
Exploiting the /tmp directory and using it to execute files is a very popular method hackers and those with malcious intent use now days.
It's also pretty simple to prevent this, or at least put a roadblock up!
First, let me say, I highly recommend taking the easy way out on this one, because the easy way in my opinion in this case is also the best way, to do this simply run this command as root:
/scripts/securetmp
cPanel wrote this script to make it easier on everyone, this script in my opinion also implements it more safely by not having it mount in /etc/fstab!
However, if you are the type who wants to do it manually, here you go... First you will need to SSH into your server and su to root. You'll need to tart off in the /dev directory.
cd /dev
Now, first you will create a loopback file that is 300mybte, you can create larger by editing the count variable.
dd if=/dev/zero of=tmpMnt bs=1024 count=300000
Next, you'll make this loopback file a extended filesystem:
/sbin/mke2fs /dev/tmpMnt
Let's back up your current /tmp directory just in case, remember /tmp directories are emptied on each reboot anyhow, but just in case:
cp -R /tmp /tmp_backup
Next, mount the new /tmp as noexec:
mount -o loop,noexec,nosuid,rw /dev/tmpMnt /tmp
Let's chmod it correctly:
chmod 1777 /tmp
Almost done..restore the /tmp directory and delete the backup:
cp -R /tmp_backup/* /tmp/
rm -rf /tmp_backup
Now, next we'll set /tmp to mount on bootup, this is the reason why I recommend at the beginning using the cPanel script, because the script does not use /etc/fstab, instead of loads it after the filesystems are mounted. It's not very wise to load a non-partition on bootup as it can't be fsck'd if neccessary.
At the bottom of your /etc/fstab, add this line:
/dev/tmpMnt /tmp ext2 loop,noexec,nosuid,rw 0 0
The above lines, should look very similar. Remember each space in the above line is a tab, after this is done, just save and exit out of your editor.
Lastly, you'll create a symlink between /var/tmp/ and /tmp. To do this simply:
ln -s /var/tmp /tmp
How Do I Install ImageMagick
ImageMagick is one of the more popular, borderlining neccessary additions to most cPanel servers, yet it does not come installed by default..
Here is a quick howto on installing it, it's very simple, and can be followed step by step for a successful install:
ImageMagick is one of the more popular, borderlining neccessary additions to most cPanel servers, yet it does not come installed by default..
Here is a quick howto on installing it, it's very simple, and can be followed step by step for a successful install:
mkdir /home/src cd /home/src wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-5.5.7-17.tar.gz tar xvzf ImageMagick-5.5.7-17.tar.gz cd ImageMagick-5.5.7 ./configure make make install cd PerlMagick perl Makefile.PL make make install
Is it possible to disable and enable statistics for certain accounts?
You can't do this in WHM, however the server admins can do this via the shell.
It's not a very known fact, but you can enable and disable each statistics application per user. For example, if you have Weblizer and Analog enabled for all users, yet one user wants Awstats only, this can be done!
Let's say the user's username is johndoe, first you will need to SSH into the server as root, now use your favorite editor, and edit the file:
/var/cpane/users/johndoe
Now, if you wanted to disable all statistics applications and enable awstats, you would add these lines:
skipanalog=1 skipawstats=0 skipwebalizer=1
Next, you'll need to restart cPanel, you can normally do this by doing :
/etc/init.d/cpanel restart
Now, when the user johndoe logs into cPanel, he'll see Awstats, but not Analog and Webalizer!
How can I access my client's cpanel without their password?
You can the root password to access all the accounts on the server you just need the user password.
I changed one of my user's passwords, and now their FTP password isn't working?
This is a pretty common bug in cPanel, if you experience this click on the Sychronize FTP passwords link in WHM.
Does WHM/Cpanel come with a Zend or ionCube Optimizer so that automation scripts will work?
cPanel comes with a script to install Zend Optimizer.
The easiest way of installing this is to run this command as root:
/scripts/installzendopt now
Spam Assassin is no longer working after resetting exim in WHM
Restart Spam Assassin (spamd) after you reset exim within WHM.
If you use WHM to restart exim ... It does not restart Spam Assassin.
So, restart exim from a command line like this --
service exim restart
This will restart spamd along with exim, and your new config line will be loaded, and spam assassin will go back to marking the subject lines.
My Quotas do not work, how do I fix them?
Ensure the quota files are present, and not corrupt, to do this look for the files aquota.user or quota.user. If you do not find these files, you can execute the script:
/scripts/initquotas
If you do find these files, however quotas still are not working, you should execute the script:
/scripts/fixquotas
Is there anyway to disable Horde, or other webmail applications for users who don't want them?
You can enable and disable webmail applications per user as well!
Let's say the user's username is janedoe, first you will need to SSH into the server as root, now use your favorite editor, and edit the file:
/var/cpane/users/johndoe
Now, if you wanted to disable all webmail applications and enable squirrelmail, you would add these lines:
skiphorde=1 skipsqmail=0 skipneomail=1
Next, you'll need to restart cPanel, you can normally do this by doing :
/etc/init.d/cpanel restart
Now, when the user janedoe logs into webmail, she'll only see Squirrelmail, and not two other options she doesn't use
How do I restart cpanel?
There's numerous ways to restart cpanel, however the common methods on linux are:
service cpanel restart /etc/init.d/cpanel resatrt
My stats stopped running! What could it be?
There is two common causes of this, and a number of solutions:
1. Server Load (major Issue) 2. Stats logs (thats true if it goes beyond 2 GB it does not update as domlogs gets data from the stats log also.
Now, there's a few resolutions...
1. UPGRADE. If your servers are overloaded, although you can use this tweak, I recommend upgrading your server, however, if yo uwant to do the tweak :
WHM Tweak Settings set the the CPU Count to 4 (it'll warn you while running stats/logs manually, but thats OK.
2. If it's your log files, and your server load is low, than you can run these scripts as root:
/scripts/cleanbw /scripts/runlogsnow
I want to make my server more secure! How do I disable compilers?
Well, different people have different opinions on this, most likely, you found a tutorial that said this was a critical part of securing your server. I disagree, and so does cPanel, cPanel (and I) recommend using this command:
/scripts/compilers (off|on)
With this command, you can turn compilers on and off while still maintaining the permissions that cPanel prefers.
Is it possible to limit message size in Exim?
To limit message size you simply need to add this line to your exim.conf :
message_size_limit = 5M
This line can be added below these two lines:
- !!# message_filter renamed system_filter
system_filter = /etc/antivirus.exim message_body_visible = 5000
(Note, I used 5 megabytes in my example, you change change 5m to whichever size you would like.)
My user's quotas are showing double for each of my users?
This is typically caused by the user's backups being owned by them instead of by root. To resolve this you should check the permissions on the backups, for example:
ls -la /backup/cpbackup/weekly/username/homedir
If that is indeed owned by the user, you can issue this command:
chown -R root:root /backup/cpbackup/weekly/*/homedir/ to resolve this
How can I change the time my cPanel backups and upgrades are done?
By default, backups are done around 5:41am EST. This is okay if you are in most of the USA, but what if you are a cPanel host in the UK? That's prime time.
Well have no fear, it's easy to fix.
First, you'll need to login to the server as root, next use this command:
crontab -e
Now you will see a crontab entry for /scripts/upcp, it should look something like this:
21 3 * * * /scripts/upcp
This example is set to run nightly at 3:21am. You will want to adjust this, for instance if you want it to run at 8:00am GMT (1:00pm EST) you would set it like this:
00 13 * * * /scripts/upcp
Transfer cPanel accounts from another server
Login to your WHM of your new machine you want to transfer the files to. Scroll down the left side till you get to the Transfers section Choose Copy an account from another server with account password Enter the Server IP, Domain Name, Username and Password for the account. Click Setup and you will begin to transfer all your files from the old server to the new one.
If you are moving from FreeBSD to RedHat or vice versa you will notice near the end of the transfer you will get a CheckSum Error. This is caused by FreeBSD using /user/home and RedHat using just /home. To finish the install you need to login to Shell and change to your /home directory. Then type:
/script/restorepkg
Note: replace with the previous account name on your other server.
Exim Does Not Seem to Work
Login to your Shell and type /scripts/eximup --force and hit enter.
This will update your Exim to the latest version. If the problem persists click restart in your WHM for Exim and send support your error message.
