Configure Litespeed Webserver With PHP 5.3.0, Mail Header Patch and Suhosin Patch
Posted by adminOct 27
What is LiteSpeed Web Server ?
LiteSpeed Web Server is the leading high-performance, high-scalability web server. It is completely Apache interchangeable so LiteSpeed Web Server can quickly replace a major bottleneck in your existing web delivery platform. With its comprehensive range of features and easy-to-use web administration console, LiteSpeed Web Server can help you conquer the challenges of deploying an effective web serving architecture.
In this tutorial we will upgrade current litespeed PHP to support PHP 5.3.0, Mail header patch and suhosin patch
What is Suhosin ?
Suhosin is the big brother to the Hardened-PHP patch which adds an extra level of protection to PHP.
In this tutorial, i’ve tried to compile all packages from litespeed web server web interface but it’s failed.
so i prefer to configured it manually.
Download All Sources
Login as root
#cd /root
#wget http://uk.php.net/distributions/php-5.3.0.tar.gz
#wget http://download.suhosin.org/suhosin-patch-5.3.0-0.9.8-BETA-1.patch.gz
#wget http://choon.net/opensource/php/php-5.3.0-mail-header.patch
#wget http://www.litespeedtech.com/packages/lsapi/php-litespeed-4.10.tgz
#wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz
Extract Packages
#cd /root
#tar -zxvf php-5.3.0.tar.gz
#gunzip suhosin-patch-5.3.0-0.9.8-BETA-1.patch.gz
#tar -zxvf autoconf-2.13.tar.gz
Install autoconf
#cd /root
#cd autoconf-2.13
#./configure && make && make install
Compile PHP 5.3.0 with PHP mail header , Suhosin and PHP-Litespeed
#cd /root
#cd php-5.3.0
Patching PHP mail header & Suhosin
#patch -p1 < /root/php-5.3.0-mail-header.patch
#patch -p1 < /root/suhosin-patch-5.3.0-0.9.8-BETA-1.patch
Exctract and Compile PHP-litespeed
#cd /root
#cp php-litespeed-4.10.tgz /root/php-5.3.0/sapi
#tar -zxvf php-litespeed-4.10.tgz
#cd /root/php-5.3.0
#touch ac*
#./buildconf --force
Compile All
#cd /root/php-5.3.0
# ./configure --with-litespeed --prefix=/usr/local/lsws/lsphp5 --with-mysql --with-zlib --with-gd --enable-shmop --enable-track-vars --enable-sockets --enable-sysvsem --enable-sysvshm --enable-magic-quotes --enable-mbstring --with-iconv --with-mcrypt --with-curl --with-ftp --with-gettext --with-ttf --enable-suhosin --enable-gd-native-ttf --with-jpeg-dir=/usr/local/lib --with-freetype-dir=/usr/local/lib --with-kerberos --with-openssl --with-mhash --with-pcre-regex=/usr/local --with-pear --with-png-dir=/usr/local/lib --enable-zip -enable-bcmath --enable-calendar --with-mysqli=/usr/bin/mysql_config
#make
If make is running successfully then stop here.
Copy PHP Binary to litespeed fcgi-bin Directory
#cd /usr/local/lsws/fcgi-bin
#unlink lsphp5
#cp /root/php-5.3.0/sapi/litespeed/php lsphp-5.3.0
#ln -s ./lsphp-5.3.0 lsphp5
Verify PHP Version
#./lsphp5 -v
PHP 5.3.0 with Suhosin-Patch (litespeed) (built: Sep 13 2009 22:29:50)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
If you see any error like below :
#./lsphp5 -v
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/suhosin.so’ – Cannot open "/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/suhosin.so" in Unknown on line 0PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/xcache.so’ – Cannot open "/usr/local/lsws/lsphp5/lib/php/extensions/no-debug-non-zts-20090626/xcache.so" in Unknown on line 0PHP 5.3.0 with Suhosin-Patch (litespeed) (built: Sep 13 2009 22:29:50)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
IMPORTANT :
This is mean you need to recompile XCACHE and SUHOSIN Packages.
Restart Litespeed Webserver
#/usr/local/lsws/bin/lswsctrl stop
#/usr/local/lsws/bin/lswsctrl start
Here is the PHPINFO result :


No comments
You must be logged in to post a comment.