Howto: Configure CloudLinux kernel on pv xen

In other to switch your hosted server with pv xen to CloudLinux server, you may refer to the step as below,

1. Make sure that /etc/sysconfig/kernel is as line below, if the file is not exist, create it,

UPDATEDEFAULT=yes
DEFAULTKERNEL=kernel-xen

2. Install grub if it is not,

yum install grub

3. Check /etc/modprobe.conf is exists and with the following line it is not,

alias eth0 xennet
alias scsi_hostadapter xenblk

4. If you have install the newer kernel, run the following line,

mkinitrd -f /boot/initrd-2.6.xxx.img 2.6.xxx

‘xx’ should be the same as you newly installed kernel-xen version

5. Else, install kernel,

yum install kernel-xen

6. Check if /boot/grub/grub.conf exists, else create it,

ln -s /boot/grub/grub.conf /boot/grub/menu.lst
ln -s /boot/grub/grub.conf /etc/grub.conf

7. Make sure that the /etc/grub.conf is look like,

default=0
timeout=10
title CentOS (2.6.18-308.11.1.el5xen)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-308.11.1.el5xen console=xvc0 root=/dev/sda1 ro
initrd /boot/initrd-2.6.18-308.11.1.el5xen.img

Make sure that the vmlinuz and initrd should be the same.

8. Ask your hosting provider to change the kernel type to pygrub and reboot it.

R1Soft: Replication driver missing

I was discovery that the R1Soft server hosted for client server getting the following error,

An exception occurred during the request. Replication driver missing; Unable to open driver at '/dev/hcp'; No such device or address.

To get this issue fixed, you should make sure that you have the kernel similar version with your kernel-header. Then you could verify if the Linux Hot Copy module is loaded. To verify the them,

To check the kernel version,

uname -r

To check the kernel-header version,

yum list kernel-devel

If you have PAE, xen or Enterprise kernel, use the corresponding version like kernel-PAE-devel, kernel-xen-devel or kernel-ent-devel.

Next, build the kernel header with source,

r1soft-setup --get-module --no-binary

Next, restart the CDP-Agent to load the new driver,

/etc/init.d/cdp-agent restart

After that, you may check if the module loaded

lsmod | grep hcpdriver

You have done and the error should away by now.

Apache: service httpd does not support chkconfig

As you know, when you installed your Apache service to your Centos/Redhat server manually (make & make install but not yum) and could like to run the service automatically, you should copy the apachectl from the Apache bin folder to /etc/init.d/ folder as named httpd.

Then you might want to set the chkconfig and facing the error as below,

service httpd does not support chkconfig

To fix this issue, you may simply add the following line to your file at /etc/init.d/httpd.

#
# Startup script for the Apache Web Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server. It is used to serve
# HTML files and CGI.
# processname: httpd
# pidfile: /usr/local/apache/logs/httpd.pid
# config: /usr/local/apache/conf/httpd.conf

Then you may chkconfig again,

chkconfig --level 235 httpd on

And now restart your httpd service.

Howto: Install Apache 2.2.x and PHP 5.3.x on CentOS 5

Assume that you do not want to spend money on your server to have a control panel and having minimal requirement for your website,

1. Install the required packages,

yum install bison flex gcc db4 db4-devel libxml2-devel libpng-devel mysql-devel make

2. Download Apache source (refer the latest one from http://httpd.apache.org/)

wget http://apache.petsads.us//httpd/httpd-2.2.21.tar.gz

3. Download PHP source (refer the latest one from http://www.php.net/)

wget http://my.php.net/get/php-5.3.8.tar.gz/from/us.php.net/mirror

4. Build the Apache,

tar zxvf httpd-2.2.21.tar.gz
cd httpd-2.2.21
./configure --enable-so --enable-rewrite=shared
make
make install
cd ..

5. Build the PHP,

tar zxvf php-5.3.8.tar.gz
cd ../php-5.3.8
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --enable-bcmath \
--enable-ftp --enable-magic-quotes --with-pear --enable-sockets --with-zlib --with-gd
make
make install
cp php.ini-production /usr/local/lib/php.ini
cd ..

6. Now, start the Apache services,

/usr/local/apache2/bin/apachectl start

cPanel: Uninstall CloudLinux

It is not hard to install CloudLinux, but you will found more step to uninstall it.

Before you convert CloudLinux back to normal Centos, you shall check if your box come with CloudLinux,
/usr/local/cpanel/bin/cloudlinux_system_install -c

1. Update CentOS RPMs.
yum upgrade -y
2. Rebuild Apache
/usr/local/cpanel/scripts/easyapache –build
3. Reinstall a non-CloudLinux kernel.
yum –disableexcludes=all install kernel
4. Remove the CloudLinux-provided kernel.
rpm -qa |awk ‘/^kernel.*lve/ {print $1|”xargs yum -y erase”}’ Continue reading cPanel: Uninstall CloudLinux

Install pico and set as default editor through CentOS

I could see many people around me are using pico instead of other editor like vim which come with centos.

As you know, pico is not come together with centos and you may refer to this article and apply to your server.
yum install nano
cd /usr/bin/
ln -s nano pico
export EDITOR=”pico”

Now, try to pico and you will be able to use it.

Install pdo_MySQL manually from CentOS

As you know, MGe is missing for sometimes for iOS and Android. 🙂

Today, MGe wish to share on how to install pdo_mysql from CentOS manually.

1. Basically, you will need to compile pear and mysql from your Apache. Run the command as below to get it updated.

yum install php-devel php-pear mysql-devel httpd-devel
pecl install pdo
PHP_PDO_SHARED=1 pecl install pdo_mysql

2. Open your php.ini file and insert the line as below.

extension=pdo.so
extension=pdo_mysql.so

3. Restart the Apache services.

PHP Compilation Error

It is not my first time to install PHP to the Linux server, but I am always not remember the error and which packages should install to get away the error.

So I am sharing some error code with the packages needed as below.

Error: Configure: error: xml2-config not found. Please check your libxml2 installation.
Solution:

yum install libxml2-devel

Error: Checking for pkg-config… /usr/bin/pkg-config configure: error: Cannot find OpenSSL’s
Solution:

yum install openssl-devel

Error: Configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!
Solution:

yum install mysql-devel

Error: Checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!
Solution:

yum install unixODBC-devel

Error: Configure: error: Cannot find pspell
Solution:

yum install pspell-devel

APC install error

Today, I was trying to add APC to the cPanel server which it is part of PHP PECL. I am getting the error as below.

The APC.so object is not in
/usr/local/lib/php/extensions/no-debug-non-zts-20090626

I have look around and found out that the server do not come with pcre installed. Below is the fixed from my step.

1. Run Shell Access,

yum install pcre

2.Go back to WHM PECL and install the APC.