Saturday, September 21, 2013

php: undefined symbol: client_errors

 [~]# php -v
php: symbol lookup error: php: undefined symbol: client_errors

500 error for all the domains on your cPanel Clould Linux server.

Latest  MySQL governor version will break mysqli if your server is running CloudLinux witn mysql 5.5 version

I have fixed this issue my recompiling the apache by disabling Mysqli php extension.

If your domains are using Mysqli then remove  MySQL governor and recompile the apache again with the default settings.

# /usr/share/lve/dbgovernor/mysqlgovernor.py --delete
# /scripts/easyapache

moving one vm from one disk to another disk

Moving your openVZ container from one disk to another disk in the same server.

That is moving vm locally on the server. Normally we are doing this when your current Hard disk space is over.

Let say the new disk is mounted on your server as disk2

We are trying to migrate a vm (2013 CTID) to disk 2

1. cd /disk2/
mkdir private
mkdir 2002
2. cp -a /var/lib/vz/private/2013/* /disk2/private/2013/

3. vzctl stop 2013   => stop the vm

4. vzquota drop 2013  => drop the quota , otherwise you will find some quota related issues.


Then edit the config file and enter the new VE_PRIVATE value,

5. vi /etc/vz/conf/2013.conf

VE_PRIVATE="/disk2/private/2013"  

6. mv /var/lib/vz/private/2013  /var/lib/vz/private/2013.bak  //taking backup to restore if needed, once successfully you can remove this file

*Start the vps

7. vzctl start 2013

Sunday, August 4, 2013

Installing iftop

Using the iftop we can monitor the server network traffic and find out which is slowing down your server.

1. cd /usr/local/src/
2. wget http://www.ex-parrot.com/~pdw/iftop/download/iftop-0.17.tar.gz
3. tar zxf  iftop-0.17.tar.gz
4.  cd iftop-0.17
5. ./configure
6. make
7. make install

Commands:

iftop -i etho
iftop -i eth0:cp2
S -> display source port
D -> display destination port

Error while installing iftop.

ISSUE :1.
./configure
checking for library containing gethostbyaddr_r... none required
checking how to call gethostbyaddr_r... 8 args, int return
checking gethostbyaddr_r usability... yes
checking where to find pcap.h... no idea
configure: error: can't find pcap.h
You're not going to get very far without libpcap.

Fix :
yum install libpcap-devel



Saturday, July 13, 2013

Installing Java for development

For your java development you may need to install JDK package for your system instead of installing jre. Once you install JDK package jre will automatically installed.

Please note down the steps for implementing java environment on your computer.

First you should download the java package from here : http://www.oracle.com/technetwork/java/javase/downloads/index.html

 * Click on "Java" 
* Then you need to click "Accept License Agreement"
* Download the 64bit Package 
(For windows 7) => jdk-7u25-windows-x64.exe 
(for Xp ) => jdk-7u25-windows-i586.exe

Double click on jdk-7u25-windows-x64.exe package and follow the installation instructions (clieck next ..next )

Finally you will receive the following out put.
Successfully installed Java SE Development Kit 7 Update 25(64-bit) : This will create "jdk as well as "jre" on your installation.
Click "Close" in the installation window. Thats it you have installed your java software on your machine.

Setting Environment path in windows 7:
Sometimes you will encountered the following error while running java on you your machine.

'javac' is not recognized as an internal or external command, operable program or batch file,

For correcting this error please do the following steps: 
Control Panel > System
Or
Right click on your MyComputer > Properties > Advanced System Settings >  Advanced > Environment Variables
Click "New" Set Variable name as " java" and Variable value as "C:\Program Files\Java\jdk1.7.0_25\bin" without any quotes click ok and now you can execute your command anywhere on your command prompt.

If you don't want to set an environment path you can change the installed "bin" directory on your command prompt and execute the java command.

That is cd command ,
For example : > cd C:\Program Files\java\
C:\Program Files\Java>cd jdk1.7.0_25
cd bin



Friday, July 5, 2013

Root Login Email alert

cPanel / WHM / Centos server root login alert to your email address:
open bashrc file and and the following line at the end of the file

 vi /root/.bashrc


echo 'ALERT - Root Shell Access ( server.ajeesh.com )on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`"   ajeesh@xxxx.com

Sunday, June 30, 2013

Grub2 recovery

centos / cPanel server grub2 recovery steps : 
1. Boot your server from a live CD 
2. type fdisk -l command to find out your primary disk partition where you want to recover your grub. 

3. mkdir /media/sda1
4.  mount /dev/sda1 /media/sda1 
5.  mount --bind /dev /media/sda1/dev
6.  mount --bind /proc /media/sda1/proc 
7.  chroot /media/sda1
8.  grub-install /dev/sda
9.  If you get an error, then we need to execute this command -> grub-install --recheck /dev/sda 

10 After the grub installation we will exist from chroot => exit

11 umount /media/sda1/proc
12 umount /media/sda1/dev
13 umount /media/sda1 
14 reboot the server

Friday, June 28, 2013

CSF WHM Internal Server Error

When trying to access CSF via WHM it's coming back with:

Internal Server Error

500
No response from subprocess (/usr/local/cpanel/whostmgr/docroot/cgi/addon_csf.cgi): subprocess exited with status 2

=================
We can check the error log here tail -f /usr/local/cpanel/logs/error_log while accessing csf through your WHM.

From the error log we can see which perl module is missing for csf. We can install the missing perl module using the follows command.

/usr/sbin/csf -x
/scripts/perlinstaller --force Net::LibIDN
/usr/sbin/csf -e
/usr/sbin/csf -u

But this is not fixed my 500 internal server error. I have fixed this issue by executing the following command.

curl -s configserver.com/free/csupdate | perl