Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Wednesday, 27 August 2014

How to clear eximstats db

If the your size of eximstats database is getting large, you can do the following steps to clear it.

Login to mysql

#mysql
mysql> use eximstats
mysql> delete from sends;
mysql> delete from smtp;
mysql> delete from failures;
mysql> delete from defers;

You can also use the following steps.
mysqladmin drop eximstats

mysqladmin create eximstats

mysql eximstats < /usr/local/cpanel/etc/eximstats_db.sql

Monday, 28 July 2014

Update Nagios Plugins- ERROR "NRPE: Unable to read output"

Update the nagios plugins if you're getting the ERROR "NRPE: Unable to read output"

Do the below steps by login to the server by root.
# cd /usr/local/src/
# wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
# tar -zxvf nagios-plugins-2.0.3.tar.gz
# cd nagios-plugins-2.0.3
# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
# make
# make install
# chown nagios:nagios /usr/local/nagios
# chown -R nagios:nagios /usr/local/nagios/libexec
# service xinetd restart
Use the below command to check the result from your nagios server.

# /usr/local/nagios/libexec/check_nrpe -H <server_IP> -c check_serviceName

Thats all.

Tuesday, 8 July 2014

Install cPanel on a Virtual Server Running Centos 6

cPanel
cPanel is a convenient application that allows users to administer servers through a GUI interface instead of the traditional command line. Although the installation for cPanel is relatively simple, the script does take several hours to run.


Note:
Once cPanel is installed, it cannot be removed from the server without a complete server restore. cPanel does not offer an uninstaller and cPanel is subject to a licensing fee

Setup

Before installing cPanel on our droplet, we need to take two additional steps.
  • First we need to make sure that Perl is installed on the server
# yum install perl
After installing perl we need to take one more preliminary step. cPanel is very picky about making sure that server that it is installed on has a Fully Qualified Domain Name. To that effect, we need to provide it with a valid hostname.
#hostname  host.example.com
Install cPanel

The cPanel installation only has several steps and the installation will take a long time. Although using program "screen" is not necessary in order to install cPanel, it can be a very helpful addition to the installation process. It can be especially useful if you know that you may have issues with intermittent internet or that you will need to pause the lengthy install process.

To start off, go ahead and install screen:

# yum install screen
Once screen is installed, start a new session running:

#screen -S cPanel
After opening screen, you can proceed to install cPanel with WHM or a DNS only version of cPanel.
 # cd /usr/local/src
  •  Use this this command to install cPanel with WHM:
#wget -N http://httpupdate.cPanel.net/latest
  • Use this command to install the DNS only version of cPanel:
#wget -N http://httpupdate.cPanel.net/latest-dnsonly
With the requested package downloaded, we can go ahead and start the script running:
#sh latest
Detach screen type by "Ctrl+a+d" combination key. The script, which may take one to two hours to complete will continue running while in the background,even if you close out the of server.

To reattach to your screen you can use the command:
#screen -r <Screen_ID
Once cPanel has finally installed, you can access the login by going to your https://ip_address:2087 or domain (https://example.com:2087)

From there, you can create your cpanel user and finally login in at ipaddress/cpanel or domain/cpanel.

Thats it. :-)


Tuesday, 1 July 2014

[FIX] A DNS entry for “Domain.com” already exists. You must remove this DNS entry from all servers in the DNS cluster to proceed.

If you getting the following ERROR while try to create a parked domain in your cPanel account.

"A DNS entry for “Domain.com” already exists. You must remove this DNS entry from all servers in the DNS cluster to proceed"
 Solution:

 Login to server through ssh and execute the following command.

# /scripts/killdns domain.com

After that try again to add. Hope you can add the domain as parked successfully :-)

You can check it through.

# grep -R domain.com /var/cpanel/userdata/*

You can see the list of subdomains and addon/parked domains from this file of the user.

# cat /var/cpanel/userdata/user_name/main

 Thats it.

Wednesday, 25 June 2014

[FIX] 403 forbidden error - pcfg_openfile: unable to check htaccess file, ensure it is readable

If you're getting the "403  forbidden error" while accessing your website.  This issue is generally due to permissions.

Step 1:

  • Check error log,

# tailf /usr/local/apache/logs/error_log | grep <Your IP/website name>
 You'll get below error,

 [Wed Jun 25 15:39:08 2014] [crit] [client XX.XX.XX.XX] (13)Permission denied: /home/user_name/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable


Step 2:

  • Most often, setting folder permissions back to 755 should resolve this issue.
The default permissions for folders should be 755. When reviewing your account,I recommend setting these folders back to 755 and then testing again. If you have sub folders within those that are not 755, you'll want to adjust those as well.
  •  # chmod 755 /home/user_name
That's it.



Friday, 13 June 2014

cPanel logs for access, Apache, email, error, ftp, mysql, and WHM

cPanel logs
  • Access logs and user actions    /usr/local/cpanel/logs/access_log
  • Account transfers and misc. logs    /var/cpanel/logs
  • Auditing log (account creations, deletions, etc)    /var/cpanel/accounting.log
  • Backup logs    /usr/local/cpanel/logs/cpbackup
  • Brute force protection (cphulkd) log    /usr/local/cpanel/logs/cphulkd.log
  • Cpanel dnsadmin dns clustering daemon    /usr/local/cpanel/logs/dnsadmin_log
  • Cpanel taskqueue processing daemon    /usr/local/cpanel/logs/queueprocd.log
  • DBmapping    /usr/local/cpanel/logs/setupdbmap_log
  • EasyApache build logs    /usr/local/cpanel/logs/easy/apache/
  • Error log    /usr/local/cpanel/logs/error_log
  • Installation log    /var/log/cpanel
  • License updates and errors    /usr/local/cpanel/logs/license_log
  • Locale database modifications    /usr/local/cpanel/logs/build_locale_database_log
  • Login errors (CPSRVD)    /usr/local/cpanel/logs/login_log
  • Horde    /var/cpanel/horde/log/
  • RoundCube    /var/cpanel/roundcube/log/
  • SquirrelMail    /var/cpanel/squirrelmail/
  • Panic log    /usr/local/cpanel/logs/panic_log
  • Per account bandwidth history (Cached)    /var/cpanel/bandwidth.cache/{USERNAME}
  • Per account bandwidth history (Human Readable)    /var/cpanel/bandwidth/{USERNAME}
  • Service status logs    /var/log/chkservd.log
  • Tailwatch driver tailwatchd log    /usr/local/cpanel/logs/tailwatch_log
  • Update analysis reporting    /usr/local/cpanel/logs/updated_analysis/{TIMESTAMP}.log
  • Update (UPCP) log    /var/cpanel/updatelogs/updated.{TIMESTAMP}.log
  • WebDisk (CPDAVD)    /usr/local/cpanel/logs/cpdavd_error_log
  • Website statistics log    /usr/local/cpanel/logs/stats_log
cPanel access log
  • Access logs and user actions    /usr/local/cpanel/logs/access_log
cPanel apache log
  • Apache restarts done through cPanel and WHM    /usr/local/cpanel/logs/safeapcherestart_log
  • Domain access logs    /usr/local/apache/domlogs/{DOMAIN}
  • Processing of log splitting    /usr/local/cpanel/logs/splitlogs_log
  • suPHP audit log    /usr/local/apache/logs/suphp_log
  • Web server and CGI application error log    /usr/local/apache/logs/error_log

cPanel email log
  • Delivery and receipt log    /var/log/exim_mainlog
  • Incoming mail queue    /var/spool/exim/input/
  • Log of messages rejected based on ACLS or other policies    /var/log/exim_rejectlog
  • Unexpected/Fatal error log    /var/log/exim_paniclog
  • IMAP, POP login attempts, transactions, fatal errors and spam scoring    /var/log/maillog    /var/log/messages
  • Mailman    /usr/local/cpanel/3rdparty/mailmain/logs

MySQL log
  • MySQL error log    /var/lib/mysql/{SERVER_NAME}.err
  • MySQL slow query log (if enabled in my.cnf)    /var/log/slowqueries