前端运维

尝试利用CentOS环境安装LiteSpeed WEB服务环境的过程

对于普通的网站搭建的环境虚拟主机就足够使用,不过近期公司的网站需要上线VPS主机,于是采用到LNMP(http://lnmp.org/)一键包安装的,运行还是比较好的,这不最近我也开始尝试接触VPS方面的技术内容,有看到不少文章提供LITESPEED WEB服务环境效率更高,而且节省资源。正好今天有休息准备试试这个WEB环境是如何安装的,有看到官方还有提供OPENLITESPEED版本,但是我发现用的多的还是LITESPEED,虽然有付费版本,但是免费版本基本的网站环境也够了。

为了演示的真实性,我不准备在本地的虚拟机上测试,而采用前天刚购买的VULTR VPS主机(新购买还送了我20美元能免费用30天:http://www.vultrkvm.com/how-to-use-vultr-code/ 正好可以给我用来测试项目使用)这边我先给服务器安装CENTOS6环境,我还是比较熟悉这个环境的,因为公司的环境我也是这个版本。

第一、登录SSH远程然后升级系统版本安装包

yum update -y

我还是有必要升级下安装包的,因为后面的编译过程可能导致出现不能实现的问题。

第二、安装环境需要的部署包

sudo yum groupinstall 'Development Tools'
sudo yum install libxml2-devel.x86_64 openssl-devel.x86_64 bzip2-devel.x86_64 libcurl-devel.x86_64 db4-devel.x86_64 \
libjpeg-devel.x86_64 libpng-devel.x86_64 libXpm-devel.x86_64 freetype-devel.x86_64 gmp-devel.x86_64 \
libc-client-devel.x86_64 openldap-devel.x86_64 libmcrypt-devel.x86_64 mhash-devel.x86_64 freetds-devel.x86_64 \
zlib-devel.x86_64 mysql-devel.x86_64 ncurses-devel.x86_64 pcre-devel.x86_64 unixODBC-devel.x86_64 postgresql-devel.x86_64 \
sqlite-devel.x86_64 aspell-devel.x86_64 readline-devel.x86_64 recode-devel.x86_64 net-snmp-devel.x86_64 \
libtidy-devel.x86_64 libxslt-devel.x86_64 t1lib-devel.x86_64

如果我们不明白的也不要紧,直接贴进去回车。如果有遇到需要输入Y/N的时候,输入Y继续回车。

我们等待安装就可以。

第三、下载LITESPEED面板版本

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

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

下载和解压,这里我是用的免费版本,基本上小网站足够了,除非我们的流量并发大约150,那就需要用到付费。

第四、安装LITESPEED

cd lsws*

./install.sh

我们先看到服务条款,按空格键,然后到最下面。

然后输入Yes回车,其他项目是这样的。

Please specify the destination directory. You must have permissions to
create and manage the directory. It is recommended to install the web server
at /opt/lsws, /usr/local/lsws or in your home directory like '~/lsws'.

ATTENTION: The user 'nobody' must be able to access the destination
           directory.

Destination [/usr/local/lsws]:

这里回车。

Please specify the user name of the administrator.
This is the user name required to log into the administration web interface.

User name [admin]:

继续回车或者我们设定一个面板登录用户名,默认是ADMIN

Please specify the administrator's password.
This is the password required to log into the administration web interface.

Password:

设置密码,需要输入2次。

Please specify administrators' email addresses.
It is recommended to specify a real email address,
Multiple email addresses can be set by a comma
delimited list of email addresses. Whenever something
abnormal happened, a notificiation will be sent to
emails listed here.

Email addresses [root@localhost]:

都是回车,我们也可以设定一个邮箱,问题不大。

As you are the root user, you must choose the user and group
whom the web server will be running as. For security reason, you should choose
a non-system user who does not have login shell and home directory such as
'nobody'.

User [nobody]:

继续回车。

Please choose the group that the web server running as.

User 'nobody' is the member of following group(s):  nobody
Group [nobody]:

依旧回车。

Please specify the port for normal HTTP service.
Port 80 is the standard HTTP port, only 'root' user is allowed to use
port 80, if you have another web server running on port 80, you need to
specify another port or stop the other web server before starting LiteSpeed
Web Server.
You can access the normal web page at http://<YOUR_HOST>:<HTTP_PORT>/

HTTP port [8088]: 80

开放80端口。

Please specify the HTTP port for the administration web interface,
which can be accessed through http://<YOUR_HOST>:<ADMIN_PORT>/

Admin HTTP port [7080]:

设置面板登录端口,默认7080,我们可以修改。

You can setup a global script handler for PHP with the pre-built PHP engine
shipped with this package now. The PHP engine runs as Fast CGI which  
outperforms Apache's mod_php.
You can always replace the pre-built PHP engine with your customized PHP
engine.

Setup up PHP [Y/n]: Y

下面全部回车,然后安装完毕。

最后,设定防火墙

iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tcp --dport 7080 -j ACCEPT
service iptables save

这样,我们在CENTOS系统中就可以安装LITESEPPD,然后登陆面板可以管理。不过好像这个真不如一键包方便,还缺数据库,缺PHP没有编译完整。先玩到这里,以后再看看。

参考文章:

1、http://www.itbulu.com/centos-litespeed-php.html

2、http://www.litespeedtech.com/docs/webserver/install

posted on 2015-11-01 15:00  前端运维  阅读(818)  评论(0编辑  收藏  举报

导航