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儲存庫。
# 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
server.use-ipv6 = "disable" server.max-fds = 2048
步驟4:啟動LightTPD伺服器
最後使用下列指令啟動lighttpd服務# service lighttpd start
# service lighttpd stop # service lighttpd restart
# chkconfig lighttpd on
Linux影片教學】
以上是如何使用Yum在CentOS和RHEL上安裝Lighttpd Web伺服器的詳細內容。更多資訊請關注PHP中文網其他相關文章!