Install LiteSpeed Web Server on Centos

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.

LiteSpeed Web Server has superior performance in terms of both raw speed and scalability. Our benchmarks demonstrate that it is more than 6 times faster than Apache. When serving static content, LiteSpeed surpasses well-respected content accelerators including thttpd, boa and TUX. When it comes to dynamic content, LiteSpeed is more than 50% faster in PHP content delivery than Apache with mod_php. Don’t just take our word for it. Download the LiteSpeed free or trial version and experience it for yourself.

Install atomic repository, it will install latest package.
[# wget -q -O – http://www.atomicorp.com/installers/atomic | sh

yum –y install libxml2-devel openssl-devel bzip2-devel curl-devel db4-devel libjpeg-devel libpng-devel libXpm-devel freetype freetype-devel gmp-devel libc-client-devel openldap-devel libmcrypt-devel libmhash-devel freetds-devel libz-devel mysql-devel ncurses-devel pcre-devel unixODBC-devel postgresql-devel sqlite-devel aspell-devel readline-devel recode-devel net-snmp-devel libtidy-devel libxslt-devel t1lib-devel

yum -y remove httpd php mysql

Install the latest version modules using “yum” / otherwise you can install it from source.

cd /usr/src/
wget ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.11.tar.gz
tar -zxvf gnupg-1.4.11.tar.gz
cd gnupg-1.4.11
./configure
make
make install
cd..

wget http://ftp.gnu.org/gnu/libidn/libidn-1.9.tar.gz
tar -zxvf libidn-1.9.tar.gz
cd libidn-1.9
./configure
make
make install
ln -s /usr/local/lib/libidn* /usr/lib
cd..

wget http://curl.haxx.se/download/curl-7.21.4.tar.gz
tar -zxvf curl-7.21.4.tar.gz
cd curl-7.21.4
[# ./configure –with-openssl –with-libidn –enable-ipv6
make
make install
ln -s /usr/local/lib/libcurl* /usr/lib
cd..

wget ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
tar -zxvf libxml2-2.7.8.tar.gz
cd libxml2-2.7.8
./configure
make
make install
rm -rf /usr/lib/libxml2*
ln -s /usr/local/lib/libxml2* /usr/lib
cd..

wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
tar -zxvf libxslt-1.1.26.tar.gz
cd libxslt-1.1.26
./configure
make
make install
rm -rf /usr/lib/libxslt* /usr/lib/libexslt*
ln -s /usr/local/lib/libxslt* /usr/lib
ln -s /usr/local/lib/libexslt* /usr/lib
cd..

Install MySQL

yum install mysql
yum install mysql-server
yum install mysql-client
yum install mysql-embedded
yum install mysql-shared
yum install mysql-libs

MySQL configuration

There are 5 default MySQL configuration:

my-small.cnf
choose one of those configurations depending on your needs, move to “/etc/” directory and rename it to “my.cnf”.

cp /usr/share/mysql/my-small.cnf /etc/my.cnf

vim /etc/my.cnf
add the following lines to “[mysqld]” section

default-storage-engine=MyISAM
skip-innodb

Now start MySQL, create system tables.

/etc/init.d/mysqld start
/usr/bin/mysql_install_db
mysql_secure_installation
/etc/init.d/mysqld stop
chkconfig –add mysqld
chkconfig mysqld on

Install LiteSpeed

wget http://www.litespeedtech.com/packages/4.0/lsws-4.0.20-std-i386-linux.tar.gz
tar -zxvf lsws-4.0.20-std-i386-linux.tar.gz
cd lsws-4.0.20
chmod +x install.sh
./install.sh

Do you agree with above license: Yes
Destination: /usr/local/lsws (my preferred 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 with required modules

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:

[# –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-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 –with-bz2 –with-curl –with-curlwrappers –with-gettext –with-pcre-regex –with-imap –with-imap-ssl=/usr/lib –enable-exif –enable-ftp –enable-magic-quotes –enable-sockets –enable-ucd-snmp-hack –enable-memory-limit –enable-dbx –with-mime-magic –enable-soap –enable-zip –with-mhash –enable-mbregex

Add-on Modules: Check only XCache or eAccelerator for PHP Opcode Cacher module, we will install Suhosin extension later.
– Push build button and wait until configure process has finished or check the status until**PREPARE_DONE**
– After finished, click next button and run the following command from your ssh (root)

/usr/local/lsws/phpbuild/buildphp_manual_run.sh
wait about 5 – 10 minutes until the process finished (it will shown **COMPLETE** status)
– Apply changes and Graceful restart

Check your PHP installation status
# /usr/local/lsws/fcgi-bin/lsphp5 -v
PHP 5.3.5 (litespeed) (built: Dec 8 2012 15:08:51)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Install IonCube Loader
# wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
# tar -xvf ioncube_loaders_lin_x86.tar.gz
# mv ioncube/ioncube_loader_lin_5.3.so /usr/lib/extensions/no-debug-non-zts-20090626/

Install Suhosin Extension

# 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

Copy php.ini to lib directory
# cp /usr/local/lsws/php/php.ini /usr/lib
declare the installed extensions to php.ini (IonCube, eAccelerator, Suhosin)

vim /usr/lib/php.ini

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/xcache.so”
extension=”/usr/lib/extensions/no-debug-non-zts-20090626/suhosin.so”

Restart LiteSpeed
/usr/local/lsws/bin/lswsctrl restart

check PHP 5.3.5 and other modules
# /usr/local/lsws/fcgi-bin/lsphp5 -v
PHP 5.3.5 (litespeed) (built: Dec 8 2012 15:08:51)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd., and
with XCache v1.3.1, Copyright (c) 2005-2010, by mOo
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

Now let’s create and configure Virtual Host.

Install PureFTPD
# wget http://download.pureftpd.org/pure-ftpd/releases/pure-ftpd-1.0.30.tar.gz
# tar -xvf pure-ftpd-1.0.30.tar.gz
# cd pure-ftpd-1.0.30
# ./configure
# make install-strip
# echo “/usr/local/sbin/pure-ftpd &” >> /etc/rc.d/rc.local

start PureFTPD
/usr/local/sbin/pure-ftpd &

Create domain root directory
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

Configure domain virtual host

– Open: http://yourip:youradminport
– Go to Configuration – Virtual Host Templates, choose PHP_SuEXEC (i prefer phpsuexec)
– Go to General tab and edit Template Settings
Virtual Host Root: /home/$VH_NAME/
Config File: $SERVER_ROOT/conf/$VH_NAME.xml
Max Keep-Alive Requests: leave this empty
Smart Keep-Alive: Yes
Document Root: $VH_ROOT/public_html/
Enable GZIP Compression: Yes
Enable IP GeoLocation: Not Set
Administrator Email: your email
– Save and Graceful 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/
– Save and Graceful Restart

*you might get the following error:
Input error detected. Please resolve the error(s).
*path /home/domain.com/ is not readable

Solution:
chmod 755 -R /home/domain.com

Now create phpinfo.php
Vim /home/domain/public_html/phpinfo.php
======================================================================>
Reference:
http://www.litespeedtech.com
http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:php:lsapi:troubleshoot

Advertisements

83 thoughts on “Install LiteSpeed Web Server on Centos

  1. It is not my first time to pay a quick visit this web site, i am visiting
    this web site dailly and take pleasant information from here daily.

  2. You could certainly see your expertise within the work you write. The sector hopes for even more passionate writers such as you who are not afraid to say how they believe. Always go after your heart.

  3. Great items from you, man. I’ve be mindful your stuff prior to and you are just extremely wonderful. I actually like what you have received here, really like what you are saying and the best way by which you are saying it. You make it entertaining and you continue to take care of to stay it smart. I cant wait to learn much more from you. This is really a great website.

  4. It was very useful article.
    But I’m getting an error during the installation of suhosin. after I enter ./configure command. I’m getting the bellow error :

    configure: WARNING: you should use –build, –host, –target
    configure: error: invalid variable name: .with-php-config

    • Hi Poorya,

      Could you please use ./configure –enable-suhosin –with-php-config=/usr/local/lsws/lsphp5/bin/php-config ( please note use double minus for –enable –with )

      Also check the file /usr/local/lsws/lsphp5/bin/php-config config. Please let me know the issue still persist.

  5. An interesting discussion is worth comment. There’s no doubt that that you should publish more on this topic, it might not be a taboo subject but typically people don’t speak about such subjects.
    To the next! Many thanks!!

  6. Its like you read my mind! You appear to know so much about this, like you wrote the book in it or
    something. I think that you could do with some pics to
    drive the message home a bit, but other than that, this is wonderful blog.
    A fantastic read. I will certainly be back.

  7. Hi, I do think this is an excellent site. I stumbledupon it
    😉 I’m going to revisit yet again since I bookmarked it. Money and freedom is the best way to change, may you be rich and continue to guide other people.

  8. I blog frequently and I genuinely thank you for your content.
    Your article has truly peaked my interest. I will
    bookmark your website and keep checking for new
    details about once per week. I subscribed to
    your RSS feed too.

  9. I am not sure where you’re getting your information, but great topic. I needs to spend some time learning more or understanding more. Thanks for excellent info I was looking for this info for my mission.

  10. Hmm it appears like your site ate my first comment (it was super long) so I guess I’ll just sum it up what I had
    written and say, I’m thoroughly enjoying your blog.

    I too am an aspiring blog blogger but I’m still new to the whole thing.
    Do you have any suggestions for rookie blog writers?
    I’d genuinely appreciate it.

  11. Pingback: bcHGc6SoQZ

  12. It’s very straightforward to find out any matter on web as compared to textbooks, as I found this article at this site.

  13. Can I just say what a relief to find someone who genuinely knows
    what they are talking about over the internet. You certainly realize
    how to bring a problem to light and make it important. More and more people must look at this and understand this side of the story.
    I was surprised you’re not more popular since you certainly have the gift.

  14. Wonderful work! This is the type of information that
    are supposed to be shared across the internet. Shame on the search engines for now not positioning this put up
    upper! Come on over and consult with my site .
    Thanks =)

  15. We are a gaggle of volunteers and opening a brand new scheme in our community.
    Your site offered us with helpful info to
    work on. You’ve performed an impressive process and our entire community will probably be grateful to you.

  16. Hello there, I found your website by the use of Google at the same time
    as searching for a similar subject, your website got here
    up, it seems to be good. I’ve bookmarked it in my google
    bookmarks.
    Hi there, simply changed into alert to your
    weblog via Google, and found that it is truly informative.
    I am gonna be careful for brussels. I’ll appreciate if you proceed this in future.
    A lot of folks shall be benefited out of your writing.
    Cheers!

  17. What’s Happening i am new to this, I stumbled upon this
    I’ve found It positively useful and it has aided me out loads.

    I am hoping to give a contribution & assist other customers like its helped me.
    Great job.

  18. Hi there, just became aware of your blog through Google, and found that it is
    truly informative. I am going to watch out for
    brussels. I will be grateful if you continue this in future.
    Many people will be benefited from your writing.
    Cheers!

  19. What’s up, yeah this paragraph is actually pleasant and I have learned lot
    of things from it on the topic of blogging. thanks.

  20. It’s remarkable to pay a quick visit this website and reading the views of all colleagues about this article, while I
    am also eager of getting knowledge.

  21. Hello there, I discovered your website by means of Google whilst looking for a similar matter, your site got here up, it looks great.

    I have bookmarked it in my google bookmarks.
    Hello there, just turned into alert to your weblog thru Google,
    and located that it is truly informative. I’m gonna watch out for brussels.
    I’ll be grateful when you proceed this in future.
    Many other people might be benefited out of your writing.

    Cheers!

  22. I appreciate, lead to I found just what I was taking a look for.
    You have ended my four day long hunt! God Bless you
    man. Have a great day. Bye

  23. Magnificent items from you, man. I’ve take note your stuff prior to and you’re simply too excellent.
    I really like what you have received here, certainly like what you are saying
    and the way wherein you say it. You are making it enjoyable
    and you continue to care for to stay it sensible.

    I can not wait to learn much more from you. This is actually
    a terrific site.

  24. Excellent blog here! Also your website loads up fast! What host are you using?
    Can I get your affiliate link to your host? I wish my
    site loaded up as quickly as yours lol

  25. Simply want to say your article is as astonishing. The clarity in your post is
    simply spectacular and i could assume you are an expert
    on this subject. Fine with your permission let me to grab your RSS feed
    to keep up to date with forthcoming post. Thanks a million and please continue the
    rewarding work.

  26. Great weblog here! Additionally your web site quite a bit up very
    fast! What host are you the use of? Can I get your affiliate link to your host?
    I desire my site loaded up as fast as yours lol

  27. My family all thee time say that I am killing my time here at net, except I
    know I am getting know-how all the time byy reading such
    good articles.

  28. My family every time say that I am wasting my time
    here at web, but I know I am getting familiarity daily by reading such pleasant articles or reviews.

  29. An outstanding share! I’ve just forwarded this onto a friend who has been conducting a little homework on this.

    And he in fact ordered me breakfast simply because I found it
    for him… lol. So allow me to reword this…. Thanks for the meal!!

    But yeah, thanks for spending time to discuss
    this topic here on your web page.

  30. Hey There. I found your blog using msn. This
    is a really well written article. I will be sure to bookmark it and return to read more of your useful
    info. Thanks for the post. I will definitely return.

  31. Good web site you have here.. It’s difficult to find
    quality writing like yours nowadays. I truly appreciate individuals
    like you! Take care!!

  32. Howdy! I could have sworn I’ve visited this blog before but after looking at a few of the posts I realized it’s new to me.
    Anyways, I’m definitely pleased I stumbled upon it and I’ll be book-marking it and checking
    back regularly!

  33. You can certainly see your expertise in the article you write.
    The arena hopes for even more passionate writers like you
    who are not afraid to mention how they believe. At all times follow your heart.

  34. That is a very good tip particularly to those new to the blogosphere. Brief but very precise info¡­ Thanks for sharing this one. A must read post!

  35. Thanks on your marvelous posting! I truly enjoyed reading
    it, you are a great author.I will be sure to bookmark your blog and will eventually come back in the future.
    I want to encourage one to continue your great writing, have a nice weekend!

  36. Heya i am for the first time here. I came across this
    board and I find It truly useful & it helped me out a lot.
    I am hoping to present something again and help others
    like you helped me.

  37. Hello i am kavin, its my first occasion to commenting anywhere, when i
    read this paragraph i thought i could also make comment
    due to this good post.

  38. I blog often and I genuinely thank you for your information. The article has truly peaked my interest.

    I will take a note of your blog and keep checking for new information about once a week.
    I subscribed to your Feed too. visit site

  39. You are so cool! I do not think I have read something like that before.
    So good to discover someone with some genuine thoughts on this subject matter.
    Really.. thank you for starting this up. This website is one thing that’s needed on the internet, someone
    with a bit of originality!

  40. Excellent site you have got here.. It’s difficult to
    find high quality writing like yours nowadays. I really appreciate individuals like you!
    Take care!!

  41. I have been browsing online more than 2 hours today, yet
    I never found any interesting article like yours. It is pretty
    worth enough for me. Personally, if all web owners and bloggers made good content as you did, the internet will be much more useful than ever before.

  42. I blog quite often and I seriously thank you for
    your information. Your article has really peaked my interest.
    I’m going to bookmark your blog and keep checking
    for new information about once a week. I subscribed to your Feed
    as well.

  43. I am truly happy to read this webpage posts which contains lots of valuable facts,
    thanks for providing these information.

  44. Wow, wonderful weblog structure! How lengthy have
    you been running a blog for? you made running a blog look easy.

    The toltal gglance oof your website is great, as smartly
    as the content material!

  45. Very good post! We are linking to this particularly great content on our site.
    Keep up the great writing.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s