如何使用Yum在CentOS和RHEL上安装Lighttpd Web服务器


本文摘自PHP中文网,作者不言,侵删。

Lighttpd是一种适合在生产环境中运行的高性能Web服务器。它是高度优化,安全且非常灵活的Web服务器;与其他Web服务器相比,LightTPD使用的内存和CPU非常低。其事件驱动架构针对大量并行连接进行了优化(保持活跃状态)

Lighttpd为一些流行的Web 2.0站点提供了支持。它提供了高速IO基础设施,使它们能够在相同的硬件上扩展好几倍。这是在考虑未来网络的情况下开发的,如:更快的FastCGI、COMET符合mod_mailbox、异步IO。

可以按照以下步骤在基于RHEL的系统上安装Lighttpd。

步骤1:添加EPEL存储库

EPEL yum存储库拥有最新的Lighttpd包,首先在你的系统中添加EPEL yum存储库。

1

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

步骤2:安装LightTPD服务器

使用yum包管理器安装lighttpd

1

# yum install lighttpd lighttpd-fastcgi

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

 * base: mirror.nbrc.ac.in

 * epel: mirrors.ispros.com.bd

 * extras: mirror.nbrc.ac.in

 * updates: mirror.nhanhoa.com

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package lighttpd.i686 0:1.4.35-1.el6 will be installed

---> Package lighttpd-fastcgi.i686 0:1.4.35-1.el6 will be installed

--> Processing Dependency: spawn-fcgi for package: lighttpd-fastcgi-1.4.35-1.el6.i686

--> Running transaction check

---> Package spawn-fcgi.i686 0:1.6.3-1.el6 will be installed

--> Finished Dependency Resolution

 

Dependencies Resolved

 

===================================================================================================

 Package                       Arch              Version                   Repository         Size

===================================================================================================

Installing:

 lighttpd                      i686              1.4.35-1.el6              epel              300 k

 lighttpd-fastcgi              i686              1.4.35-1.el6              epel               45 k

Installing for dependencies:

 spawn-fcgi                    i686              1.6.3-1.el6               epel               16 k

 

Transaction Summary

===================================================================================================

Install       3 Package(s)

 

Total download size: 361 k

Installed size: 818 k

Is this ok [y/N]: y

Downloading Packages:

(1/3): lighttpd-1.4.35-1.el6.i686.rpm                                       | 300 kB     00:00

(2/3): lighttpd-fastcgi-1.4.35-1.el6.i686.rpm                               |  45 kB     00:00

(3/3): spawn-fcgi-1.6.3-1.el6.i686.rpm                                      |  16 kB     00:00

---------------------------------------------------------------------------------------------------

Total                                                              206 kB/s | 361 kB     00:01

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Warning: RPMDB altered outside of yum.

** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:

google-chrome-stable-34.0.1847.116-1.i386 has missing requires of libnss3.so(NSS_3.14.3)

  Installing : lighttpd-1.4.35-1.el6.i686                                                      1/3

  Installing : spawn-fcgi-1.6.3-1.el6.i686                                                     2/3

  Installing : lighttpd-fastcgi-1.4.35-1.el6.i686                                              3/3

 

Installed:

  lighttpd.i686 0:1.4.35-1.el6                 lighttpd-fastcgi.i686 0:1.4.35-1.el6

 

Dependency Installed:

  spawn-fcgi.i686 0:1.6.3-1.el6

 

Complete!

步骤3:配置LightTPD服务器

在启动lighttpd配置之前,请确保系统中禁用了selinux。

1

# getenforece

现在编辑Lighttpd配置文件/etc/lighttpd/lighttpd.conf

1

2

server.use-ipv6 = "disable"

server.max-fds = 2048

server.use-ipv6:将此值设置为“diable”将允许服务器监听IPv6连接并禁用IPv6连接。

server.max-fds Lighttpd是单线程服务器,其主要资源限制是文件描述符的数量,默认情况下设置为1024(在大多数系统上)。要处理高流量站点,可以将此设置为2048。

步骤4:启动LightTPD服务器

最后使用以下命令启动lighttpd服务

1

# service lighttpd start

要停止或重新启动服务器,请使用以下命令。

1

2

# service lighttpd stop

# service lighttpd restart

使lighttpd在服务器启动时启动

1

# chkconfig lighttpd on

【相关推荐:Linux视频教程】

以上就是如何使用Yum在CentOS和RHEL上安装Lighttpd Web服务器的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

如何使用yum在centos和rhel上安装Lighttpd web服务器

如何使用yum在centos和rhel上安装Lighttpd web服务器

更多相关阅读请进入《Lighttpd》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...