Showing posts with label CentOS | Fedora. Show all posts
Showing posts with label CentOS | Fedora. Show all posts

Sunday, August 24, 2014

// // Leave a Comment

How to install Varnish Cache [CPANEL]

Varnish Cache is a web accelerator, sometimes referred to as a HTTP accelerator or a reverse HTTP proxy, that will significantly enhance your web performance.
Varnish speeds up a website by storing a copy of the page served by the web server the first time a user visits that page. The next time a user requests the same page, Varnish will serve the copy instead of requesting the page from the web server.
This means that your web server needs to handle less traffic and your website’s performance and scalability go through the roof. In fact Varnish Cache is often the single most critical piece of software in a web based business.

How to install varnish cache on cpanel

First, you need to change Apache listening port to another port 82 or anything else.
vi /etc/httpd/conf/httpd.conf
or you can change via WHM -> Tweak Settings -> set value of field Apache non-SSL IP/port to 82.
You can install varnish through YUM or manually download varnish RPM.
yum install varnish
or
for EL6
wget http://repo.varnish-cache.org/redhat/varnish-3.0/el6/noarch/varnish-release-3.0-1.el6.noarch.rpm
rpm ivh varnish-release-3.0-1.el6.noarch.rpm
Once installation completed, Edit configuration file and change listening port to 80
vi /etc/sysconfig/varnish
VARNISH_LISTEN_PORT=80
Edit proxy settings in varnish
vi /etc/varnish/default.vcl or check with /usr/local/varnish/etc/varnish/vhost.vcl
backend default {
.host = "184.82.165.4";
.port = "82";
}

sub vcl_recv {
if (req.url ~ "\.(png|gif|jpg|swf|css|js)$") {
return(lookup);
}
}

# strip the cookie before the image is inserted into cache.

sub vcl_fetch {
if (req.url ~ "\.(png|gif|jpg|swf|css|js)$") {
unset beresp.http.set-cookie;
}
}
Enable chkconfig  and restart varnish service
chkconfig varnish on
service varnish start
Thats all… You can monitor varnish cache through this monitoring tool.
varnishstat
Read More

Saturday, August 31, 2013

// // Leave a Comment

[CPanel] How to install ffmpeg mplayer and mencoder on CentOS6 (FFMpeg 0.7.11)

Hello Guys,

Installation of FFMPEG is treated as the toughest installations as it has many dependencies. Check with the below steps for easy installation.

1. Enable 9xhost and EPEL yum repositories

    The CentOS 6 RPM packages of ffmpeg, mplayer and MP4Box packages are available on 9xhost.net. These RPM packages are copied from ATrpms and RPM Fusion YUM repositories for a simplified installation.

    Some packages on 9xhost YUM repo depend on EPEL repo. To enable EPEL repo, install the epel-release RPM package

    rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

1.1 To enable 9xhost YUM repository, create the file /etc/yum.repos.d/9xhost.repo

    nano /etc/yum.repos.d/9xhost.repo

    and add following repository configuration:

    [9xhost]
    name=9xhost Packages CentOS 6 - $basearch
    baseurl=http://dl.9xhost.info/yumrepo/centos/6/$basearch/
    enabled=1
    gpgcheck=0

2. Install ffmpeg mplayer and mencoder

    for x86 (32bit system)

    yum install ffmpeg mplayer

    for x86_64 (64bit system)

    yum install ffmpeg mplayer --exclude "*.i386"

    Note: there is no separate package for mencoder. It is also provided by mplayer package.

    This will also install various dependency packages like libtheora, libvorbis, libogg, lame, opencore-amr, x264, xvidcore etc.

3. Install flvtool2

    cPanel has its own ruby installer script. So install ruby using following cPanel script:

    /scripts/installruby

    Flvtool2 is available as a Ruby Gems package. Use following gem command to install flvtool2:

    gem install flvtool2

4. Install MP4Box2

    MP4Box is provided by gpac package. Install gpac and its library packages:

    for x86 (32bit system)

    yum install gpac gpac-libs

    for x86_64 (64bit system)

    yum install gpac gpac-libs --exclude "*.i386"

5. Install ffmpeg-php

    Ffmpeg-php requires ffmpeg development package. Install it using yum:
    for x86 (32bit system)

    yum install ffmpeg-devel

    for x86_64 (64bit system)

    yum install ffmpeg-devel --exclude "*.i386"

    Now download the latest ffmpeg-php package:

    wget http://downloads.sourceforge.net/ffmpeg-php/ffmpeg-php-0.6.0.tbz2

    Untar this package, build and install it with following commands:

    tar xjf ffmpeg-php-0.6.0.tbz2
    cd ffmpeg-php-0.6.0
    sed -i 's/PIX_FMT_RGBA32/PIX_FMT_RGB32/g' ffmpeg_frame.c
    phpize
    ./configure
    make
    make install

    The make install command will show PHP extensions path where ffmpeg PHP extension is installed:

    root@server [~/ffmpeg-php-0.6.0]# make install
    Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20060613/

    Now edit php.ini file

    nano /usr/local/lib/php.ini

    and make sure that value of extension_dir is set to PHP extension directory as given by above make install command:


    extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"

    Add following line just below extension_dir and this will enable ffmpeg PHP extension:

    extension="ffmpeg.so"

    Restart Apache to make this change effective:

    /scripts/restartsrv_httpd

    You can verify the status of ffmpeg extension on a PHP info web page or from command line as given below:


    root@server [~]# php -i | grep ffmpeg
    ffmpeg
    ffmpeg-php version => 0.6.0-svn
    ffmpeg-php built on => Jun 2 2012 20:48:04
    ffmpeg-php gd support => enabled
    ffmpeg libavcodec version => Lavc52.123.0
    ffmpeg libavformat version => Lavf52.111.0
    ffmpeg swscaler version => SwS0.14.1
    ffmpeg.allow_persistent => 0 => 0
    ffmpeg.show_warnings => 0 => 0
    OLDPWD => /root/ffmpeg-php-0.6.0
    _SERVER["OLDPWD"] => /root/ffmpeg-php-0.6.0
    _ENV["OLDPWD"] => /root/ffmpeg-php-0.6.0

6. Installation paths

    Following are the file system paths of tools that we installed:

    ffmpeg: /usr/bin/ffmpeg
    mplayer: /usr/bin/mplayer
    mencoder: /usr/bin/mencoder
    flvtool2: /usr/bin/flvtool2
    MP4Box: /usr/bin/MP4Box
Read More

Tuesday, July 30, 2013

// // 1 comment

Install FTP in CentOS 6.3

This tutorial shows you how to install and configure FTP server in CentOS 6.3. Though the steps provided here are tested in CentOS 6.3, it should work on RHEL 6.x(x stands for version) and Scientific Linux 6.x too. In this tutorial my ftp server ip and hostname are 192.168.1.200 andmainserver.ostechnix.com respectively. I have already configured a local repository and i am gonna to install FTP from my local repository. For more information navigate to setup your local repoistory in CentOS 6 / RHEL 6 / Scientific Linux.
Before proceed, stop the firewall.
[root@mainserver ~]# service iptables stop
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
[root@mainserver ~]# service ip6tables stop
ip6tables: Flushing firewall rules:                        [  OK  ]
ip6tables: Setting chains to policy ACCEPT: filter         [  OK  ]
ip6tables: Unloading modules:                              [  OK  ]
[root@mainserver ~]# chkconfig iptables off
[root@mainserver ~]# chkconfig ip6tables off
[root@mainserver ~]# 
Now let us install FTP service.
[root@mainserver ~]# yum install -y vsftpd
[root@mainserver ~]# Start vsftpd service.
[root@mainserver ~]# service vsftpd start
Starting vsftpd for vsftpd:                                [  OK  ]
[root@mainserver ~]# 
Enable vsftpd in multi-user levels.
[root@mainserver ~]# chkconfig vsftpd on
Now edit the /etc/vsftpd/vsftpd.conf file. Uncomment and edit the lines in the vsftpd.conf file which are shown in bold.
[root@mainserver ~]# cat /etc/vsftpd/vsftpd.conf 
# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# The target log file can be vsftpd_log_file or xferlog_file.
# This depends on setting xferlog_std_format parameter
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# The name of log file when xferlog_enable=YES and xferlog_std_format=YES
# WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log
#xferlog_file=/var/log/xferlog
#
# Switches between logging into vsftpd_log_file and xferlog_file files.
# NO writes to vsftpd_log_file, YES to xferlog_file
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
ascii_upload_enable=YES
ascii_download_enable=YES
#
# You may fully customise the login banner string:
ftpd_banner=Welcome to OSTECHNIX FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd/banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_local_user=YES
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd/chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd with two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
use_localtime=YES
Now let us restart the vsftpd service and try to connect to ftp server.
[root@mainserver ~]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
Connect to the ftp server.
Note: Root is not allowed to connect to ftp server by default for security purpose. So lets us create a new user called ostechnix.
[root@mainserver ~]# useradd ostechnix
[root@mainserver ~]# passwd ostechnix
Changing password for user ostechnix.
New password: 
BAD PASSWORD: it is based on a dictionary word
Retype new password: 
passwd: all authentication tokens updated successfully.
Connet to FTP server using the new user ostechnix.
[root@mainserver ~]# ftp 192.168.1.200
-bash: ftp: command not found
[root@mainserver ~]# 
Oops! ftp package is not installed. So let us install ftp package first.
[root@mainserver ~]# yum install -y ftp
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ftp.i686 0:0.17-51.1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
 Package       Arch           Version                 Repository           Size
================================================================================
Installing:
 ftp           i686           0.17-51.1.el6           localrepo            55 k
Transaction Summary
================================================================================
Install       1 Package(s)
Total download size: 55 k
Installed size: 91 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : ftp-0.17-51.1.el6.i686                                       1/1 
  Verifying  : ftp-0.17-51.1.el6.i686                                       1/1 
Installed:
  ftp.i686 0:0.17-51.1.el6                                                      
Complete!
[root@mainserver ~]# 
Again connect to the FTP server.
[root@mainserver ~]# ftp 192.168.1.200
Connected to 192.168.1.200 (192.168.1.200).
220 Welcome to OSTECHNIX FTP service.
Name (192.168.1.200:root): ostechnix
331 Please specify the password.
Password:
500 OOPS: cannot change directory:/home/ostechnix
Login failed.
ftp> 
It shows a error that the user cannot change to his $HOME directory. Type exit to return back from the ftp console and allow vsftpd daemon to change users into their $HOME directories. To do that update SELinux configuration using the command below.
[root@mainserver ~]# setsebool -P ftp_home_dir on
And finally connect to the FTP server.
[root@mainserver ~]# ftp 192.168.1.200
Connected to 192.168.1.200 (192.168.1.200).
220 Welcome to OSTECHNIX FTP service.
Name (192.168.1.200:root): ostechnix
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/home/ostechnix"
ftp> 
Its working now. You can use your FTP server.

Connect to FTP server using Filezilla from Client:

Download and install Filezilla client software to any one of the client systems. Open the Filezilla client and enter the username and password which we have created earlier and click connect.

Connect to FTP server via browser from the client:

Open the browser and navigate to ftp://192.1168.1.200. Enter the username and password which we cretaed earlier.
If you want to browse ftp server using domain name(i.e ftp://ostechnix.com) instead of ip address, add the ftp server ip in the DNS server records. For more information to configure DNS server navigate to Setup DNS server in CentOS 6.3/RHEL 6.3/Scientific Linux 6.3.
Thats it. You can access your FTP server from any client now using Filezilla and as well as from your client web browser.
Have a good day!!!
Read More

Saturday, April 14, 2012

// // Leave a Comment

LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5


Install dependensi PHP, modul, and tools
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#yum -y install gcc gcc-c++ glibc make automake GeoIP GeoIP-devel GeoIP-data fontconfig fontconfig-devel gd gd-devel pam pam-devel openldap openldap-devel libXpm libXpm-devel libtool libaio libaio-devel libtool-ltdl libtool-ltdl-devel libmcrypt libmcrypt-devel mhash mhash-devel unixODBC unixODBC-devel zip unzip nano perl openssl openssl-devel pcre pcre-devel bzip2 bzip2-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel aspell aspell-devel
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#yum -y update
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#yum -y install gnupg curl curl-devel libidn libidn-devel libc-client libc-client-devel.`uname -i` libxslt tidy libtidy libtidy-devel
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#yum -y install libxml2-devel
Install MySQL 5.5.10
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#wget http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.5/MySQL-shared-compat-5.5.10-1.linux2.6.`uname -i`.rpm
#wget http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.5/MySQL-shared-5.5.10-1.linux2.6.`uname -i`.rpm
#wget http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.5/MySQL-devel-5.5.10-1.linux2.6.`uname -i`.rpm
#wget http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.5/MySQL-embedded-5.5.10-1.linux2.6.`uname -i`.rpm
#wget http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.5/MySQL-server-5.5.10-1.linux2.6.`uname -i`.rpm
#wget http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.5/MySQL-client-5.5.10-1.linux2.6.`uname -i`.rpm
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#rpm -Uvh http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.5/MySQL-shared-compat-5.5.10-1.linux2.6.`uname -i`.rpm
#rpm -Uvh http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.5/MySQL-shared-5.5.10-1.linux2.6.`uname -i`.rpm
#rpm -Uvh http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.5/MySQL-devel-5.5.10-1.linux2.6.`uname -i`.rpm
#rpm -Uvh http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.5/MySQL-embedded-5.5.10-1.linux2.6.`uname -i`.rpm
#rpm -Uvh http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.5/MySQL-server-5.5.10-1.linux2.6.`uname -i`.rpm
#rpm -Uvh http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.5/MySQL-client-5.5.10-1.linux2.6.`uname -i`.rpm
MySQL configuration
There are 5 default MySQL configuration:
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
my-innodb-heavy-4G.cnf
my-huge.cnf
my-large.cnf
my-medium.cnf
my-small.cnf
move to “/etc/” directory and rename it to “my.cnf”
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#cp /usr/share/mysql/my-small.cnf /etc/my.cnf
to save memory can by using MyISAM engine rather than InnoDB.
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#nano /etc/my.cnf

add the following lines to “[mysqld]” section
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
default-storage-engine=MyISAM
skip-innodb
Start MySQL, create system tables, and securing.
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#/etc/init.d/mysql start
#/usr/bin/mysql_install_db
#mysql_secure_installation
#/etc/init.d/mysql stop
#chkconfig --add mysql
#chkconfig mysql on
Install LiteSpeed
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#wget http://www.litespeedtech.com/packages/4.0/lsws-4.1-std-i386-linux.tar.gz
#tar -zxvf lsws-4.1-std-i386-linux.tar.gz
#cd lsws-4.1
#chmod +x install.sh
#./install.sh
Do you agree with above license: Yes
Destination: /usr/local/lsws (standart LiteSpeed directory)
Username: your preferred username for administration panel
Password: your preferred password for administration panel
Email addresses: your email address
User: nobody
Group: nobody
HTTP port: 80
Admin HTTP port: choose any port above 2000
Setup PHP: Y
Suffix for PHP script: php
Install AWStats Add-on modul: N
LiteSpeed restart automatically when server restarts: Y
Would you like to start it now: Y
Compiling PHP 5.3.5 
Login to your LiteSpeed administration panel
Open: http://yourip:youradminport
Go to Action – Compile PHP, select PHP 5.3.5 and push next button
Extra PATH environment: Leave this empty
Install Path Prefix: /usr/local/lsws/lsphp5
Configure Parameters 32bit OS:
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
--prefix=/lsphp5 --with-litespeed --enable-cli --with-mcrypt --enable-mbstring --with-openssl --with-mysql=/usr/bin --with-mysqli --with-mysql-sock=/var/lib/mysql/mysql.sock --with-pdo-mysql --with-gd --with-zlib --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-png --with-jpeg --with-gmp --with-sqlite --enable-pdo --with-libdir=lib --with-xpm-dir=/usr/lib --with-freetype-dir=/usr/include/freetype2 --with-ttf=/usr/include/freetype2 --libdir=/usr/lib --enable-gd-native-ttf --enable-fileinfo --disable-debug --with-pic --with-bz2 --with-curl --with-curlwrappers --without-gdbm --with-gettext --with-iconv --with-pspell --with-pcre-regex --with-imap --with-imap-ssl=/usr/lib --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --disable-sysvsem --disable-sysvshm --disable-sysvmsg --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-kerberos --enable-ucd-snmp-hack --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --with-mime-magic --with-system-tzdata --with-odbc --enable-gd-jis-conv --enable-dom --disable-dba --enable-xmlreader --enable-xmlwriter --with-tidy  --with-xml --with-xmlrpc --with-xsl --enable-bcmath --enable-soap --enable-zip --enable-inline-optimization --with-mhash --enable-mbregex
Configure Parameters 64bit OS:
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
--prefix=/lsphp5 --with-litespeed --enable-cli --with-mcrypt --enable-mbstring --with-openssl --with-mysql=/usr/bin --with-mysqli --with-mysql-sock=/var/lib/mysql/mysql.sock --with-pdo-mysql --with-gd --with-zlib --with-jpeg-dir=/usr/lib64 --with-png-dir=/usr/lib64 --with-png --with-jpeg --with-gmp --with-sqlite --enable-pdo --with-libdir=lib64 --with-xpm-dir=/usr/lib64 --with-freetype-dir=/usr/include/freetype2 --with-ttf=/usr/include/freetype2 --libdir=/usr/lib64 --enable-gd-native-ttf --enable-fileinfo --disable-debug --with-pic --with-bz2 --with-curl --with-curlwrappers --without-gdbm --with-gettext --with-iconv --with-pspell --with-pcre-regex --with-imap --with-imap-ssl=/usr/lib64 --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --disable-sysvsem --disable-sysvshm --disable-sysvmsg --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-kerberos --enable-ucd-snmp-hack --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --with-mime-magic --with-system-tzdata --with-odbc --enable-gd-jis-conv --enable-dom --disable-dba --enable-xmlreader --enable-xmlwriter --with-tidy  --with-xml --with-xmlrpc --with-xsl --enable-bcmath --enable-soap --enable-zip --enable-inline-optimization --with-mhash --enable-mbregex
Add-on Modules: eAccelerator
and then click build php and wait until configuration process done.
Click next and run this command on ssh root
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#/usr/local/lsws/phpbuild/buildphp_manual_run.sh
wait about until the process finished (it will shown **COMPLETE** status) and apply changes and Graceful restart
Check your PHP installation status
http://yourip/phpinfo.php
or
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#/usr/local/lsws/fcgi-bin/lsphp5 -v
Additional Modules
Install IonCube Loader
32bit OS:
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
#tar -zxvf ioncube_loaders_lin_x86.tar.gz
#cd ioncube
#mv ioncube/ioncube_loader_lin_5.3.so /usr/lib/extensions/no-debug-non-zts-20090626/
64bit OS:
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
#tar -zxvf ioncube_loaders_lin_x86-64.tar.gz
#mv ioncube/ioncube_loader_lin_5.3.so /usr/lib64/extensions/no-debug-non-zts-20090626/
Install Suhosin Extension
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#wget http://download.suhosin.org/suhosin-0.9.32.1.tar.gz
#tar -zxvf suhosin-0.9.32.1.tar.gz
#cd suhosin-0.9.32.1
#/usr/local/lsws/lsphp5/bin/phpize
#./configure --enable-suhosin --with-php-config=/usr/local/lsws/lsphp5/bin/php-config
#make
#make install
Create folder cache file eAccelerator
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#mkdir /tmp/eaccelerator
#chmod 0777 /tmp/eaccelerator
Edit php.ini
32bit OS:
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#cp /usr/local/lsws/php/php.ini /usr/lib
#nano /usr/lib/php.ini

64bit OS:
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#cp /usr/local/lsws/php/php.ini /usr/lib64
#nano /usr/lib64/php.ini
Add config on php.ini:
32bit OS:
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
zend_extension="/usr/lib/extensions/no-debug-non-zts-20090626/ioncube_loader_lin_5.3.so"
zend_extension="/usr/lib/extensions/no-debug-non-zts-20090626/eaccelerator.so"
eaccelerator.shm_size= 16
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable=1
eaccelerator.optimizer=1
eaccelerator.check_mtime=1
eaccelerator.debug=0
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
extension="/usr/lib/extensions/no-debug-non-zts-20090626/suhosin.so"
64bit OS:
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
zend_extension="/usr/lib64/extensions/no-debug-non-zts-20090626/ioncube_loader_lin_5.3.so"
zend_extension="/usr/lib64/extensions/no-debug-non-zts-20090626/eaccelerator.so"
eaccelerator.shm_size= 16
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable=1
eaccelerator.optimizer=1
eaccelerator.check_mtime=1
eaccelerator.debug=0
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
extension="/usr/lib64/extensions/no-debug-non-zts-20090626/suhosin.so"
Restart LiteSpeed:
Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#/usr/local/lsws/bin/lswsctrl restart
#/usr/local/lsws/fcgi-bin/lsphp5 -v

PHP 5.3.5 (litespeed) (built: Apr 23 2011 19:21:41)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.0.8, Copyright (c) 2002-2011, by ionCube Ltd., and
with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
Create virtual host and add Domain:

Source codecode LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 printer LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 info LiteSpeed Standard Edition, PHP, and MySQL on CentOS 5 
#useradd domain.com
#passwd domain.com
#mkdir /home/domain.com/public_html /home/domain.com/cgi-bin /home/domain.com/logs
#chown -R domain.com:domain.com /home/domain.com
#chmod 755 -R /home/domain.com
Now go to litespeed admin panel
Click on Configuration –-> Virtual Host Template –-> PHP_SuEXEC
Click General tab and click edit on Template Setting
set configuration like this :

Virtual Host Root: /home/$VH_NAME/
Config File: $SERVER_ROOT/conf/$VH_NAME.xml
Max Keep-Alive Requests: -
Smart Keep-Alive: Yes
Document Root: $VH_ROOT/public_html/
Enable GZIP Compression: Yes
Enable IP GeoLocation: Not Set
Administrator Email: your email
apply changes and do gracefull restart
Add domain:
Go to Configuration – Virtual Host Templates, choose PHP_SuEXEC
Go to Template tab and add Member Virtual Hosts
Virtual Host Name: domain.com
Domain: domain.com
Aliases: domain.com
Virtual Host Root: /home/domain.com/
apply changes and do gracefull restart
Source:  http://fr3akz.com
Read More