如何使用Yum在CentOS和RHEL上安裝Lighttpd Web服務器

lighttpd是一種適合在生產環境中運行的高性能web服務器。它是高度優化,安全且非常靈活的web服務器;與其他web服務器相比,lighttpd使用的內存和cpu非常低。其事件驅動架構針對大量并行連接進行了優化(保持活躍狀態)

如何使用Yum在CentOS和RHEL上安裝Lighttpd Web服務器

Lighttpd為一些流行的Web 2.0站點提供了支持。它提供了高速IO基礎設施,使它們能夠在相同的硬件上擴展好幾倍。這是在考慮未來網絡的情況下開發的,如:更快的FastCGI、COMET符合mod_mailbox、異步IO。

可以按照以下步驟在基于RHEL的系統上安裝Lighttpd。

步驟1:添加EPEL存儲庫

EPEL yum存儲庫擁有最新的Lighttpd包,首先在你的系統中添加EPEL yum存儲庫。

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

步驟2:安裝LightTPD服務器

使用yum包管理器安裝lighttpd

#?yum?install?lighttpd?lighttpd-fastcgi
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。

#?getenforece

現在編輯Lighttpd配置文件/etc/lighttpd/lighttpd.conf

server.use-ipv6?=?"disable" server.max-fds?=?2048

server.use-ipv6:將此值設置為“diable”將允許服務器監聽IPv6連接并禁用IPv6連接。

server.max-fds?Lighttpd是單線程服務器,其主要資源限制是文件描述符的數量,默認情況下設置為1024(在大多數系統上)。要處理高流量站點,可以將此設置為2048。

步驟4:啟動LightTPD服務器

最后使用以下命令啟動lighttpd服務

#?service?lighttpd?start

要停止或重新啟動服務器,請使用以下命令。

#?service?lighttpd?stop #?service?lighttpd?restart

使lighttpd在服務器啟動時啟動

#?chkconfig?lighttpd?on

【相關推薦:Linux視頻教程

? 版權聲明
THE END
喜歡就支持一下吧
點贊7 分享