Clear eximstats mail database in cpanel/WHM


First check the disk space on eximstats directory

root@server [~]# du -sh /var/lib/mysql/eximstats

To clear the database entries , login to mysql

root@server [~]# mysql

Once logged in just fire the below commands :-

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

Thats it.

 

Mysql error :- ERROR! MySQL is not running, but lock exists root@server


Mysql is not running on the server. when I try to connect to mysql I get the following error :-

 

===================================

root@server [~]# mysql
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
root@server [~]# /etc/init.d/mysql status
ERROR! MySQL is not running, but lock exists
root@server [~]#

===================================

When checked with the mysql service I got this error

========================================

root@server [~]# /etc/init.d/mysql status

ERROR! MySQL is not running, but lock exists
root@server [~]#

========================================

 

Here are the steps that should fix the issue.

root@server [~]# rm /var/lock/subsys/mysql
rm: remove regular empty file `/var/lock/subsys/mysql’? y

root@server [~]# /etc/init.d/mysql start

If still it doesnt  solve the issue, The best possibility is that the mysql PID file was left after the system restart and I assume that mysql server was not stopped properly.

So please check mysql by following command

root@server [~]# top |grep mysql

OR

root@server [~]# ps aufx | grep mysql

If it shows the mysql process, Kill that mysql process and again run the command :-

root@server [~]# rm /var/lock/subsys/mysql

and start the mysql service by

root@server [~]# /etc/init.d/mysql start

This should resolve the issue

 

 

 

FTP stops at MLSD


Just has an issue with the client that whenever he connects his domain via FTP through Filezilla , it connects but it stops at MLSD.

=====================

Status:   Resolving address of ftp.hi2.ro
Status:   Connecting to 89.42.38.160:21…
Status:   Connection established, waiting for welcome message…
Response:   220 ProFTPD 1.3.2 Server (fast FTP) [89.42.38.160]
Command:   USER andreeib
Response:   331 Password required for andreeib
Command:   PASS ***************
Response:   230 User andreeib logged in
Command:   SYST
Response:   215 UNIX Type: L8
Command:   FEAT
Response:   211-Features:
Response:    MDTM
Response:    MFMT
Response:    MFF modify;UNIX.group;UNIX.mode;
Response:    MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
Response:    REST STREAM
Response:    SIZE
Response:   211 End
Status:   Connected
Status:   Retrieving directory listing…
Command:   PWD
Response:   257 “/” is the current directory
Command:   TYPE I
Response:   200 Type set to I
Command:   PASV
Response:   227 Entering Passive Mode (89,42,38,160,234,169).
Command:   MLSD

===================

So This is how it was fixed :-

==> Login to the server using SSH as root user

==> Open the file /etc/csf/csf.conf

==>Search for TCP_IN and TCP_OUT and see if port 30000:35000 is added, If not Do add the port as 30000:35000

TCP_IN = “20,21,22,25,26,53,443,30000:35000”
TCP_OUT = “20,21,22,25,26,53,443,30000:35000”

==> Exit and save

Now Edit the pure-ftpd.conf file

==> Open the file /etc/pure-ftpd.conf

==> Scroll down and look for the line that says “PassivePortRange 30000 35000″

==> Make sure it is not commented out (with a # at the front)
Save the file

==>Restart the FTP server

Thats It.. The FTP then worked for me.

How to Assign single/One IP to multiple domains/Accounts in Cpanel


Assign single/One IP to multiple domains/Accounts  in Cpanel :-

Lets say you have domain1.com, domain2.com, and domain3.com on the same server and you want to keep them as individual accounts while allowing them to share an IP address. This works much is shared hosting

1.) Login to the WHM and click Show IP Address Usage

2.) Find an available IP address that you would like to use and Copy it in a Notepad

3.) Click on Basic cPanel/WHM Setup – Search for The IP address (only one address) that will be used for setting up shared IP virtual hosts.
Setting an IP not associated with this server is possible but not advised. – This should be your primary server IP (Write down this IP for future reference). Update this with the newly copied IP address that you’d like to use and click Save Changes
– Note this does not change any sites to this IP

4.) Click Change Multiple Sites’ IP Addresses
Locate and check the domains that should share this new IP i.e. domain1.com, domain2.com, domain3.com

5.) Click Change IPs of Selected Accounts


6.) Next to each site there should be a drop down box. Select the last option in each drop down box which should read:
0.0.0.0 (main shared IP) where 0.0.0.0 is the new IP for the sites to share
7.) Click Change IPs

You now have a group of accounts sharing the same IP in cpanel!

Important Note– Once you are done Click on Basic cPanel/WHM Setup – Main Shared Virtual Host IP – replace this value with the original Main Shared Virtual Host IP and click Save Changes. If you don’t newly created accounts will receive the IP address that you just setup for a specific group

Installing Postgres (PostgreSQL) in Cpanel Server


PostgreSQL is a free object-relational database server.It offers an alternative to other open-source database systems such as MySQL

Installing Postgres database on Cpanel server is very easy. Just run following command on SSH prompt as root.

root@server1 [~]#  /scripts/installpostgres

The script will fetch Postgres database and required other programs and install.

root@server1 [~]# /scripts/installpostgres
This script will install Postgres 7.3.x or later
If you have an older version installed you wil need to
Dump your databases to a file and then restore them
after the install as 7.3.x is not backwards compatible.
If you do not have any databases, you can just run:
mv /var/lib/pgsql /var/lib/pgsql.old
/sbin/service postgresql stop
/sbin/service postgresql start
to force creating a 7.3.x style setup. Do not do this if
you have databases that you wish to keep!

Are you sure you wish to proceed? y
Repository base is listed more than once in the configuration
.
.
.
.
Initializing database: [ OK ]
Starting postgresql service: [ OK ]
You should now configure postgresql from WHM!
root@server1 [~]#

Following packages are installed on CentOS server

root@server [~]# rpm -qa | grep postgre
postgresql-libs-8.1.23-1.el5_7.3
postgresql-8.1.23-1.el5_7.3
postgresql-devel-8.1.23-1.el5_7.3
postgresql-server-8.1.23-1.el5_7.3

Now login to your WHM, click on Postgres Config under SQL Services. Set a new password for Postgres. You should avoid using any non-alpha numeric charaters as these cause problems.

Go back to the Postgres Config and click on the option to install a postgres pg_hba.conf file.

postgre sql installation on cpanel

 

You can check  the version of postgresql  by following command :-

root@s709 [~]# postgres –version
postgres (PostgreSQL) 8.1.23

Now Postgres SQL is installed on your server, you will be able to see it in Cpanel.

 


 

 

 

How to check if the server is 32 or 64 bit in Linux and Windows ?


IN LINUX :-

[root@server]# uname -a 

Linux root.server.com 2.6.32-042stab044.11 #1 SMP Wed Dec 14 16:02:00 MSK 2011 x86_64 x86_64 x86_64 GNU/Linux

[root@server]# uname -i

x86_64

[root@server]# arch

x86_64

[root@server]# getconf LONG_BIT

64

IN WINDOWS :-

Windows Vista

Method 1
Click Start, then click on Run or Start Search.
Type msinfo32.exe and then press Enter key.
In “System Information”, review the value for the System Type item:
For 32-bit editions of Windows, the value of the System Type item is x86-based PC.
For 64-bit editions of Windows, the value of the System Type item is x64-based PC.

Method 2
Click Start, type system in the “Start Search” box, and then click system in the “Programs” list.
The operating system appears as follows:
For a 64-bit version operating system: 64-bit Operating System appears for the “System type” under “System”.
For a 32-bit version operating system: 32-bit Operating System appears for the “System type” under “System”.
Method 3
Click Start, type system in the “Start Search” box, and then click System Information in the “Programs” list.
The operating system appears as follows:
For a 64-bit version operating system: x64-based PC appears for the “System type” under “Item”.
For a 32-bit version operating system: x86-based PC appears for the “System type” under “Item”.

Microsoft Windows XP Professional

Method 1
Click Start, then click on Run or Start Search.
Type msinfo32.exe and then press Enter key.
In “System Information”, review the value for the System Type item:
For 32-bit editions of Windows, the value of the System Type item is x86-based PC.
For 64-bit editions of Windows, the value of the System Type item is x64-based PC.

Method 2
Click Start, click Run, type sysdm.cpl, and then click OK.
Click the General tab. The operating system appears as follows:
For a 64-bit version operating system: Microsoft Windows XP Professional x64 Edition Version <Year> appears under System.
For a 32-bit version operating system: Microsoft Windows XP Professional Version <Year> appears under System.
Note <Year> is a placeholder for a year.

Method 3
Click Start, click Run, type winmsd.exe, and then click OK.
In the details pane, locate Processor under Item. Note the value.
If the value that corresponds to Processor starts with x86, the computer is running a 32-bit version of the Windows operating system.
If the value that corresponds to Processor starts with ia64 or AMD64, the computer is running a 64-bit version of the Windows operating system.

Microsoft Windows Server 2003

Method 1
Click Start, click Run, type sysdm.cpl, and then click OK.
Click the General tab. The operating system appears as follows:
For a 64-bit version operating system: Microsoft Windows Server 2003 Enterprise x64 Edition appears under System.
For a 32-bit version operating system: Microsoft Windows Server 2003 Enterprise Edition appears under System

Method 2
Click Start, click Run, type winmsd.exe, and then click OK.
In the details pane, locate Processor under Item. Note the value.
If the value that corresponds to Processor starts with x86, the computer is running a 32-bit version of the Windows operating system.
If the value that corresponds to Processor starts with EM64T or ia64, the computer is running a 64-bit version of the Windows operating system.

PhpMyAdmin asking for username password in the login screen.


Please follow the steps given below to change the cpanel password to avoid this from happening.

1) Login to cPanel with current password

2) Goto cpanel >> Preferences >> Change Password

3) Put OldPassword and NewPassword.

4) Keep “Allow MySQL password change” checked and then click on “Change your password now”.

You should get the output :
================================================== =
Your password has been changed!
The following services were updated (if any):

system

ftp

mail

mySQL <= important to get this (You will not see it if you uncheck “Allow MySQL password change”)

FrontPage (you will get this if frontpage is provided on the server)
================================================== =

5) Logout (Again important)

6) Login with new password and then go to cpanel >> Databases >> PhpMyAdmin

Now you should be able to get into the PhpMyAdmin without login Screen.