Posted by: Mangesh_Linux_Administrator | January 20, 2011

LiteSpeed installation on plain server


LiteSpeed installation on plain server (Compile with php, suhosin)

Fresh server, without other web server installed
———————
Install LiteSpeed
———————
Go to this path :

cd /usr/local/

Download LiteSpeed :

wget http://www.litespeedtech.com/packages/3.0/lsws-3.2.3-std-i386-linux.tar.gz

Unpack the lsws-3.2.3-std-i386-linux source :

tar -zxvf lsws-3.2.3-std-i386-linux.tar.gz

Change directory to lsws-3.2.3/ :

cd lsws-3.2.3/

Install lsws :

:
./install.sh
* Do you agree with above license? Yes
* Destination [/opt/lsws]: /usr/local/lsws --> i used /usr/local/lsws ; u can use other destination
* User name [admin]: admin
* Password: 123456 --> change with your own admin password
* Retype password: 123456
* User [nobody]: nobody --> use a non-system user that doesn't have a shell access and home directory
* Group [nobody]: nobody --> group the webserver will be running as
* HTTP port [8088]: 80
* Admin HTTP port [7080]: 7080
<strong>Don't forget, both these ports should be enabled in the firewall</strong>
* Setup up PHP [Y/n]: Y
* Suffix for PHP script(comma separated list) [php]: php
* Would you like to change PHP opcode cache setting [y/N]? N
* Would you like to install AWStats Add-on module [y/N]? N
* Would you like to import Apache configuration [y/N]? N
* Would you like to have LiteSpeed Web Server started automatically when the machine restarts [Y/n]? Y
* Would you like to start it right now [Y/n]? Y

Check litespeed :
http://192.168.1.14/ –&gt; LiteSpeed welcome page
http://192.168.1.14:7080/ –&gt; manage LiteSpeed admin area
My local machine’s ip address is 192.168.1.14
Change with your own machine’s IP address.

By default, LiteSpeed comes with PHP 4.x.x compiled with LSAPI and hence we have to install latest stable version of PHP with LSAPI for our LiteSpeed.

Upgrading PHP LSAPI
—————————

Download the latest PHP source, currently at version 5.2.4, from php.net :

wget http://us2.php.net/distributions/php-5.2.4.tar.bz2

Download the suhosin-patch for PHP :

wget http://www.hardened-php.net/suhosin/_media/suhosin-patch-5.2.4-0.9.6.2.p...

Unpack the PHP source :

tar -jxvf php-5.2.4.tar.bz2

Unpack the suhosin-patch source :

gunzip suhosin-patch-5.2.4-0.9.6.2.patch.gz

Change directory to php-5.2.4 :

cd php-5.2.4/

Patching suhosin :

patch -p 1 -i ../suhosin-patch-5.2.4-0.9.6.2.patch

Change directory to sapi :

cd sapi

Download the latest PHP LSAPI source, currently at version 4.1, from litespeedtech.com :

wget http://www.litespeedtech.com/packages/lsapi/php-litespeed-4.1.tgz

Unpack the PHP LSAPI source :

tar -zxvf php-litespeed-4.1.tgz

Change directory to the parent directory. You should now be in the base directory of the PHP source ( /usr/local/ ) :

cd ..

Run commands :

touch ac*
./buildconf --force

after I run this step, I got problem which must install autoconf-2.13
but if you didn’t get this problem, you can ignore this step and continues to configuring PHP step
————————–
install autoconf-2.13
————————–
Download the autoconf-2.13 source :

wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz

Unpack the the autoconf-2.13 source :

tar zfvx autoconf-2.13.tar.gz

Change directory to autoconf-2.13 :

cd autoconf-2.13

Configure autoconf-2.13 :

./configure

Compile autoconf-2.13 :

make
make install

OK. autoconf-2.13 installed.
Back to php-5.2.4 directory :

cd ..

Run this command again :

./buildconf --force

After it, now go to configure and compile PHP step
Configure PHP :

./configure '--prefix=/usr/local/php5' '--with-litespeed' '--with-config-file-path=../php' '--with-mysql=../mysql' '--with-zlib' '--with-zlib-dir=..' '--with-gd' '--with-jpeg-dir=..' '--with-png-dir=..' '--enable-shmop' '--enable-track-vars' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-magic-quotes' '--prefix=/php5' '--with-freetype' '--with-freetype-dir=/usr/include/freetype2' '--with-ttf'

after configure, I got problem which must install libjpeg :

yum install libjpeg*

Reconfigure PHP :

./configure '--prefix=/usr/local/php5' '--with-litespeed' '--with-config-file-path=../php' '--with-mysql=../mysql' '--with-zlib' '--with-zlib-dir=..' '--with-gd' '--with-jpeg-dir=..' '--with-png-dir=..' '--enable-shmop' '--enable-track-vars' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-magic-quotes' '--prefix=/php5' '--with-freetype' '--with-freetype-dir=/usr/include/freetype2' '--with-ttf'

I got problem again which must install libpng :

yum install libpng*

Reconfigure PHP again :

./configure '--prefix=/usr/local/php5' '--with-litespeed' '--with-config-file-path=../php' '--with-mysql=../mysql' '--with-zlib' '--with-zlib-dir=..' '--with-gd' '--with-jpeg-dir=..' '--with-png-dir=..' '--enable-shmop' '--enable-track-vars' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-magic-quotes' '--prefix=/php5' '--with-freetype' '--with-freetype-dir=/usr/include/freetype2' '--with-ttf'

If success, lets compile PHP :

make
make install

Replace the lsphp binary in /usr/local/lsws/fcgi-bin/lsphp with /usr/local/lsws-3.2.3/php-5.2.4/sapi/litespeed/php:

cd /usr/local/lsws/fcgi-bin
mv lsphp lsphp.old
cp /usr/local/lsws-3.2.3/php-5.2.4/sapi/litespeed/php ./lsphp

To check installation success :

./lsphp -v

It should return something like:
PHP 5.2.4 (litespeed) (built: Sep 26 2007 07:10:58)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
Finally restart LSWS and use our new PHP binary :

service lsws restart

Done!!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

Categories

%d bloggers like this: