Showing posts with label WHM. Show all posts
Showing posts with label WHM. Show all posts

How to add SPF record from WHM

0 comments
Please refer to this to understand what is SPF: http://openspf.org

Once you know what SPF record you need to enter into your dns zone, please login to WHM. Go to DNS Functions, Edit DNS Zone. Select the zone to edit, and click the Edit button.

Now you are editing the dns zone. On this page, when adding spf record for the first time, add the new record below the line which says:

Add New Entries Below this Line

The first text field will contain your domain name with a terminating dot i.e. example.com.

Leave the number as it is in next field. After IN, select TXT from the drop down. In the next text field, add the SPF record with quotation marks e.g.

"v=spf1 a ~all"

Click Save button and allow a couple of hours for dns propagation.

How do i fix the error “License File Expired” ?

0 comments
First, check the license on http://verify.cpanel.net/ to ensure it is still licensed.
If it is not, please contact who you purchase the license from directly.

If it says it is valid, try the following as root via SSH:

# rdate -s rdate.cpanel.net
# /usr/local/cpanel/cpkeyclt

Fixing a Suddenly “Broken” cPanel Installation

0 comments
Sometimes out of nowhere cPanel will just break. You don’t know why, you don’t know when, and you don’t know how…it just happens. In my experience it’s usually when a cPanel update fails for some reason or perl is borked, but either way – it just sucks. This article will go over how to fix a malfunctioning cPanel installation or botched upgrade.

How do I know it’s broken?

It’s usually pretty obvious, but when you get error every time you open cPanel or WHM, or get perl errors when you try to run any of the scripts in /scripts, accompanied by a slew of errors in the cPanel error log (/usr/local/cpanel/logs/error_log), it’s clear that cPanel and/or Perl is malfunctioning.

The good thing is, cPanel and Perl can usually be fixed rather easily.

First things first, if you’re just getting a simple Perl error, you may just be missing a couple Perl modules. Take for example an error that looks like this:


Can't locate IPC/Open3.pm in @INC (@INC contains: /scripts /usr/local/cpanel /usr/local/lib/perl5/5.8.8/x86_64-linux /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/x86_64-linux /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl .) at /scripts/pkgacct line 22.
BEGIN failed--compilation aborted at /scripts/pkgacct line 22.


This references a Perl module that does not exist, in which case you can just install it. The name of the Perl module is indicated in the error, just replace the slash with double-colons and pass it through /scripts/perlinstaller :
/scripts/perlinstaller IPC::Open3

If that fixes the problem, great…you may have to do this a couple more times for other perl modules. But you know there’s a REAL problem when the Perl installer fails, or the perl module is made by cPanel and doesn’t exist in the standard CPAN repos. In that case, you may need to resync the cPanel scripts.

First, run the following command to get your cPanel version branch:
cat /usr/local/cpanel/version

This should return something like 11.24.5-STABLE_38506, indicating that the branch is STABLE. Other branches indicated could be RELEASE, CURRENT, BETA, or EDGE. Use this branch to download the scripts folder from the cPanel repo. The below example is for STABLE:
wget -O scripts.tar.bz2 http://httpupdate.cpanel.net/cpanelsync/STABLE/scripts.tar.bz2
tar -xvC / -j -p -f scripts.tar.bz2
chmod 755 /scripts/cpanelsync
/scripts/cpanelsync httpupdate.cpanel.net /cpanelsync/STABLE/scripts /scripts
/scripts/upcp –force

Problem still not fixed? Try reinstalling Perl:
cd /usr/src
wget http://layer2.cpanel.net/perl588installer.tar.gz
tar -xvzf perl588installer.tar.gz
cd perl588installer
./install

Then run /scripts/upcp –force again to reinstall the cPanel files

Cpanel WHM: License expired error

0 comments
If “License expired” error is encountered while accessing the cpanel/whm, it can be fixed by following below mentioned steps:

1. Check whether the license is expired.

This is the most obvious cause and simple to verify. Access the URL ‘http://verify.cpanel.net/’ and check the IP of the server.

2. If it is “active”, Run the following command:

$ /usr/local/cpanel/cpkeyclt

This should promptly return to the command line with no messages. If it takes a while, then there is likely a connectivity issue between your server and the licensing server.

3. In that case, check whether the firewall is blocking connections to the licensing server.

Verify that port 2089 TCP outgoing traffic is allowed in the firewall rules.

4. If you’re not sure that your firewall is properly configured, then the best thing to do is temporarily flush your firewall rules. Before flushing the firewall rules, you need to save the firewall rules enabled in the server.

$ /etc/init.d/iptables save

After that you can flush your firewall rules using the command

$ iptables -F

If “License expired” error is encountered while accessing the cpanel/whm, it can be fixed by following below mentioned steps:

1. Check whether the license is expired.

This is the most obvious cause and simple to verify. Access the URL ‘http://verify.cpanel.net/’ and check the IP of the server.

2. If it is “active”, Run the following command:

$ /usr/local/cpanel/cpkeyclt

This should promptly return to the command line with no messages. If it takes a while, then there is likely a connectivity issue between your server and the licensing server.

3. In that case, check whether the firewall is blocking connections to the licensing server.

Verify that port 2089 TCP outgoing traffic is allowed in the firewall rules.

4. If you’re not sure that your firewall is properly configured, then the best thing to do is temporarily flush your firewall rules. Before flushing the firewall rules, you need to save the firewall rules enabled in the server.


$ /etc/init.d/iptables save


After that you can flush your firewall rules using the command


$ iptables -F



Go_GrEen^ThiNk_GReeN~LoVE_GreEn - Pushkar



Go_GrEen^ThiNk_GReeN~LoVE_GreEn - Pushkar

Reseller list missing in WHM

0 comments
This article discusses how to resolve issues where the WHM reseller list has disappeared however they still exist

in Apache’s configuration and the users’ directories still exist in /home

Resolutions

# /var/cpanel/users/

/var/cpanel/users/username should have the following syntax per line “DNS=domain.com” line. If not, edit this

file and change the line to DNS=domain.com

Secondly, be sure to check that the DNS zone above exists in “Edit DNS Zone” in WHM. If not, add it via “Add DNS

Zone” in WHM.

# /etc/httpd/conf/httpd.conf

Double check that there is a VirtualHost container per domain in /var/named/

# /etc/userdomains

/etc/userdomains should have the following syntax per line “domain.com: user” where user is the reseller. If not,

edit this file and change the file to match.

# /etc/trueuserdomains

/etc/trueuserdomains should also have the following syntax per line “domain.com:user”where user is the domain

owner user. If not:

# mv /etc/trueuserowners /etc/trueuserowners1

# /scripts/updateuserdomains

This article discusses how to resolve issues where the WHM reseller list has disappeared however they still exist

in Apache’s configuration and the users’ directories still exist in /home

# /var/cpanel/users/

/var/cpanel/users/username should have the following syntax per line “DNS=domain.com” line. If not, edit this file and change the line to DNS=domain.com

Secondly, be sure to check that the DNS zone above exists in “Edit DNS Zone” in WHM. If not, add it via “Add DNS Zone” in WHM.

# /etc/httpd/conf/httpd.conf

Double check that there is a VirtualHost container per domain in /var/named/

# /etc/userdomains

/etc/userdomains should have the following syntax per line “domain.com: user” where user is the reseller. If not,

edit this file and change the file to match.

# /etc/trueuserdomains

/etc/trueuserdomains should also have the following syntax per line “domain.com:user”where user is the domain owner user. If not:

# mv /etc/trueuserowners /etc/trueuserowners1

# /scripts/updateuserdomains

Go_GrEen^ThiNk_GReeN~LoVE_GreEn - Pushkar

Go_GrEen^ThiNk_GReeN~LoVE_GreEn - Pushkar

Not able to create or remove accounts / New accounts not in list accounts

0 comments
There was a thread on this, however vb seems to have eaten it when multiple threads got merged together

===

Anyways, here is the fix:

1) Check your /etc/resolv.conf. If its missing valid nameservers this can be the cause

dig . NS

If this times out then this is the problem. You have to fix your /etc/resolv.conf

2) Make sure you aren't missing perl modules or have 11.x scripts on a 10.x machine

run

/scripts/perlinstaller File::Copy::Recursive
/usr/local/cpanel/bin/checkperlmodules --bootstrap
/usr/local/cpanel/bin/checkperlmodules --full

If you want to keep 10.x:
echo "CPANEL=stable" >> /etc/cpupdate.conf

/scripts/upcp --force

WHM locked out - cphulkd(burte force error)

0 comments
While trying to browse the site, if you get this
--------------------------------------------------------------------------------------------
The requested URL /suspended.page/ was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
------------------------------------------------------------------------------------------
It could be due to due to
Brute force attempt was detected.

Brute Force Protection
This account is currently locked out because a brute force attempt was detected.
Please wait 10 minutes and try again. Attempting to login again will only increase this delay.
If you frequently experience this problem, we recommend having your username changed to something less generic.

Solution / Fix

Account Locks Out Due to Brute Force Protection in cPanel WebHost Manager (WHM)

login via ssh and disable cphulkd using the command below.


root@HOST [~]# /usr/local/cpanel/etc/init/stopcphulkd


This should allow you to login to WHM and double check your cphulk settings.


You can view IP addresses that have been blocked via the WHM interface: WHM -> Security -> Security Center -> cPHulk Brute Force Protection in the Brutes table. On that screen, you can also customize brute force protection settings.


Then log into your WHM >> Security Center >> cPHulk Brute Force Protection >> Flush DB


Make Sure to restart cphulkd protection from SSH, simply fire the following command


root@HOST [~]# /usr/local/cpanel/etc/init/startcphulkd


Well the other way to this is to remove the IP’s blocked by cPHulk from its database .


ssh to the server login as root and type the following at the prompt


[root@server:] mysql


mysql> use cphulkd;


mysql>BACKUP TABLE brutes TO ‘/path/to/backup/directory’;


mysql> SELECT * FROM brutes WHERE `IP`=’xxx.xxx.xxx.xxx’;


mysql> DELETE FROM brutes WHERE `IP`=’xxx.xxx.xxx.xxx’;


mysql>quit

cPanel icon missing from WHM list accounts

0 comments
Problem :-

Cpanel Icon Missing From WHM List Accounts.

Cause :-

Following option selected in WHM >> Tweak Settings

Disable login with root or reseller password into the users’ cPanel interface. Also disable switch account dropdown in themes with switch account feature

You need to uncheck the following option in WHM >> Tweak Settings under System tab

Disable login with root or reseller password into the users’ cPanel interface. Also disable switch account dropdown in themes with switch account feature

Save the changes, now you will be able to see an Icon of cPanel in WHM List Accounts.

Problem :-

Cpanel Icon Missing From WHM List Accounts.

Cause :-

Following option selected in WHM >> Tweak Settings

Disable login with root or reseller password into the users’ cPanel interface. Also disable switch account dropdown in themes with switch account feature

You need to uncheck the following option in WHM >> Tweak Settings under System tab

Disable login with root or reseller password into the users’ cPanel interface. Also disable switch account dropdown in themes with switch account feature

Save the changes, now you will be able to see an Icon of cPanel in WHM List Accounts.

Brute Force Error - WHM locked out

0 comments
cPHulk Brute Force Protection prevents malicious forces from trying to access your server’s services by guessing the login password for that service. BUT sometimes it becomes troublesome when you are accessing the cPanel with incorrect password and cPanel assuming you as attacker blocks you with below message :- This account is currently locked out because a brute force attempt was detected. Please wait 10 minutes and try again. Attempting to login again will only increase this delay. If you frequently experience this problem, we recommend having your username changed to something less generic.

To figure out of such situation you can disable cphulkd protection :

login via ssh and disable cphulkd using the command below.

root@PUSHKAR [~]# /usr/local/cpanel/etc/init/stopcphulkd

This should allow you to login to WHM and double check your cphulk settings.

You can view IP addresses that have been blocked via the WHM interface: WHM -> Security -> Security Center -> cPHulk Brute Force Protection in the Brutes table. On that screen, you can also customize brute force protection settings.


Then log into your WHM >> Security Center >> cPHulk Brute Force Protection >> Flush DB


Make Sure to restart cphulkd protection from SSH, simply fire the following command



root@PUSHKAR [~]# /usr/local/cpanel/etc/init/startcphulkd


Well the other way to this is to remove the IP’s blocked by cPHulk from its database .

ssh to the server login as root and type the following at the prompt

[root@server:] mysql

mysql> use cphulkd;

mysql>BACKUP TABLE brutes TO ‘/path/to/backup/directory’;

mysql> SELECT * FROM brutes WHERE `IP`=’xxx.xxx.xxx.xxx’;

mysql> DELETE FROM brutes WHERE `IP`=’xxx.xxx.xxx.xxx’;

mysql>quit

Go_GrEen^ThiNk_GReeN~LoVE_GreEn - Pushkar

Not able to login WHM

4 comments
Failure Reason: Unable to connect to port 2086

/etc/init.d/chkservd restart

Error : Failure Reason: Unable to connect to port 2086
#  /etc/init.d/chkservd restart

SquirrelMail Error

0 comments
**Error :
root@fs1 [/scripts]# ./fixwebmail
chown: cannot access `/usr/local/etc/cpanel/base/webmail/data’: No such file or directory
chmod: cannot access `/usr/local/etc/cpanel/base/webmail/data’: No such file or directory

1) Try Unchecking HordeMail & SquirrelMail in WHM >> Tweak Settings >> Save >> Re-check >> Save

Try now …………

2) Hey,

Is there any usecpphp file in /var/cpanel/ directory?.

If no create it by the following command

touch /var/cpanel/usecpphp

If the file is exist, run the following commands,

cp -p /usr/local/cpanel/base/3rdparty/squirrelmail/config/config_default.php /usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php

I hope this will solve your problem. If problem exists run the following commands.

/scripts/updatenow
/scripts/makecpphp

Reinstalling Webmail

0 comments
I’ve experienced from time to time a problem with webmail functioning after cPanel updates, particularly on larger servers. You can reinstall all three webmail applications, while not disrupting user content, with the following commands:

Roundcube:
/usr/local/cpanel/bin/update-roundcube –force

Horde:
/usr/local/cpanel/bin/update-horde –force

or
/scripts/fullhordereset

Squirrelmail
/usr/local/cpanel/bin/update-squirrelmail –force

Rvsitebuilder installation in Cpanel

3 comments


1. If the server has RVSkin installed, update RVSkin to v6.75 up. (Skip this step if you don't have it).

perl /root/rvadmin/auto_rvskin.pl

2. After getting the license confirmation, SSH to the cPanel server as root, download the installer using the command below:

cd /usr/local/cpanel/whostmgr/docroot/cgi/
rm -f rvsitebuilderinstaller.tar
wget http://download.rvglobalsoft.com/rvsitebuilderinstaller.tar
tar -xvf rvsitebuilderinstaller.tar
chmod 755 addon_rvsitebuilder.cgi

3. Open WHM as root user, at the bottom left menu under Plugins section, you can find RVSiteBuilder Installer menu.

4. Click RVSiteBuilder Installer to begin the installation process.

5. After complete the installation, you will be sent to RVSiteBuilder Manager automatically.

Common cPanel commands that are used in root

0 comments
Restart chkservd:

/etc/init.d/chkservd restart

Tail Apache log:

tail -f /usr/local/apache/logs/error_log

Updates the cpanel server software:

/scripts/upcp

Reinstalls exim:

/scripts/exim4

View traffic or if you think a site is being DDoS:

cd /usr/local/apache/domlogs
tail -f targetsite.com

Correct bandwidth issues

/scripts/cleanbw

To fix problem in webalizer that stop updating stats

/scripts/fixwebalizer

Fix everything

/scripts/fixcommonproblems
/scripts/fixeverything

Fixing Mail List MailMan

/usr/local/cpanel/bin/convertmailman2

Reinstall MailMan

/scripts/reinstallmailman

/scripts/fixhome

pico /etc/my.cnf

Edit php.ini (may be in a differant place if you have Zend installed)

pico /usr/local/lib/php.ini

Edit Apache Conf

pico /etc/httpd/conf/httpd.conf

Checking Real Time Top Processes Login to SSH and run

top

Run cpanel backup

/scripts/cpbackup

To try and fix domain controller

/scripts/fixndc

Quotas

/scripts/initquotas - takes a while to run
/scripts/resetquotas
/scripts/fixquotas - takes a while to run

Add a Dns Entry

/scripts/adddns

Install Frontpage Mail Exts

/scripts/addfpmail

Add JavaServlets to an account (jsp plugin required)

/scripts/addservlets

Add a User

/scripts/adduser

Run WHM Lite

/scripts/admin

Add Rlimits (cpu and mem limits) to apache

/scripts/apachelimits

Resync with a master DNS Server

/scripts/dnstransfer

Edit A User's Quota

/scripts/editquota

Search For Trojans in /dev

/scripts/finddev

Locate Trojan Horses

/scripts/findtrojans

Suggest Usage

/scripts/findtrojans > /var/log/trojans

/scripts/fixtrojans /var/log/trojans

Make Interchange work with suexec

/scripts/fixcartwithsuexec

Fix Most Problems with Interchange

/scripts/fixinterchange

Run on a trojans horse file created by findtrojans to remove them

/scripts/fixtrojans

Run this if a user's stats stop working

/scripts/fixwebalizer

Fix a broken valias file

/scripts/fixvaliases

Turn on DMA and 32bit IDE hard drive access (once per boot)

/scripts/hdparamify

Re-scan quotas. Usually fixes Disk space display problems

/scripts/initquotas

Turn on SUEXEC (probably a bad idea)

/scripts/initsuexec

Display Ipusage Report

/scripts/ipusage

Terminate an Account

/scripts/killacct

Delete "Security Problem Infested RPMS"

/scripts/killbadrpms

Fix Various Mail Permission Problems

/scripts/mailperm

Attempt to Troubleshoot a Mail Problem

/scripts/mailtroubleshoot

Change a Mysql Password

/scripts/mysqlpasswd

Kill Potential Security Problem Services

/scripts/quicksecure

Rebuild Ip Address Pool

/scripts/rebuildippool

Delete Nasty SSL entry in apache default httpd.conf

/scripts/remdefssl

Restart a Service (valid services: httpd,proftpd,exim,sshd,cppop,bind,mysql)

/scripts/restartsrv?? (example: /scripts/restartsrv httpd)

Syncup Security Updates from RedHat/Mandrake

/scripts/rpmup

Force a webalizer/analog update

/scripts/runlogsnow

Remove non-important suid binaries

/scripts/secureit

Install Frontpage 4+ on an account

/scripts/setupfp4

Return a Simple process list. Useful for finding where cgi scripts are running from

/scripts/simpleps

Suspend an account

/scripts/suspendacct

Syncup Cpanel RPM Updates

/scripts/sysup

Unblock an IP

/scripts/unblockip

UnSuspend an account

/scripts/unsuspendacct

Update Cpanel

/scripts/upcp

Update /scripts

/scripts/updatenow

Create a New Account

/scripts/wwwacct

Awstats to run manually

/scripts/runweblogs account_username

License Not working

rdate -s rdate.darkorb.net

Sometimes such behavior of apache/httpd (taking more and more memory until it dies or crashes the server) can be caused by

corrupted MySQL database. Try to do the following:
1) Kill the mysql server
/etc/rc.d/init.d/mysql stop

2) Repair all SQL databases:
myisamchk -r /var/lib/mysql/*/*.MYI

3) Start mysql again:
/etc/rc.d/init.d/mysql start

-------------------------------------------------------------------------------

Restarting cpanel

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

To run your clients stats now

/scripts/runlogsnow

Restart the background proccess that runs the stats for your clients

/usr/local/cpanel/startup

To run your clients stats now

/scripts/runstatsonce

To run one clients stats:

/scripts/runweblogsnow username

Shut down http

httpd stop

Start http with SSL

httpd startssl

Start http

httpd start

/scripts/runweblogs

lynx: Can’t access startfile http://localhost/whm-server-status

1 comments

ERROR :-



Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.

lynx: Can’t access startfile http://localhost/whm-server-status



#  ipcs -s | grep nobody | perl -e 'while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}'

This may sort out your issue, if you still face the error

#  /scripts/easyapache

WHM locked out – Brute Force Error

0 comments
cPHulk Brute Force Protection prevents malicious forces from trying to access your server’s services by guessing the login password for that service. BUT sometimes it becomes troublesome when you are accessing the cPanel with incorrect password and cPanel assuming you as attacker blocks you with below message :

—————————————————————————————
This account is currently locked out because a brute force attempt was detected. Please wait 10 minutes and try again. Attempting to login again will only increase this delay. If you frequently experience this problem, we recommend having your username changed to something less generic.
—————————————————————————————


To get out of such situation you can disable cphulkd protection :

login via ssh and disable cphulkd using the command below.

root@HOST [~]# /usr/local/cpanel/etc/init/stopcphulkd

This should allow you to login to WHM and double check your cphulk settings.

You can view IP addresses that have been blocked via the WHM interface: WHM -> Security -> Security Center -> cPHulk Brute Force Protection in the Brutes table. On that screen, you can also customize brute force protection settings.

Then log into your WHM >> Security Center >> cPHulk Brute Force Protection >> Flush DB

Make Sure to restart cphulkd protection from SSH, simply fire the following command

root@HOST [~]# /usr/local/cpanel/etc/init/startcphulkd


Well the other way to this is to remove the IP’s blocked by cPHulk from its database .

ssh to the server login as root and type the following at the prompt

[root@server:] mysql

mysql> use cphulkd;

mysql>BACKUP TABLE brutes TO ‘/path/to/backup/directory’;

mysql> SELECT * FROM brutes WHERE `IP`=’xxx.xxx.xxx.xxx’;

mysql> DELETE FROM brutes WHERE `IP`=’xxx.xxx.xxx.xxx’;

mysql>quit

110 Can’t open SMTP stream

0 comments
I found the config for cpanel’s SM:

/usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php

I just changed:
$useSendmail = false;

to:
$useSendmail = true;

(around line 33)

This will probably get written over with the next cpanel update, but it at least helps get my users sending mail again for