水滴
分类: LINUX
2018-05-08 13:40:52
Lighttpd使用fastcgi方式运行php,它会使用很少的PHP进程响应很大的并发量。
Fastcgi的优点在于:
从稳定性上看, fastcgi是以独立的进程池运行来cgi,单独一个进程死掉,系统可以很轻易的丢弃,然后重新分配新的进程来运行逻辑.
从安全性上看, fastcgi和宿主的server完全独立, fastcgi怎么down也不会把server搞垮,
从性能上看, fastcgi把动态逻辑的处理从server中分离出来, 大负荷的IO处理还是留给宿主server, 这样宿主server可以一心一意作IO,对于一个普通的动态网页来说, 逻辑处理可能只有一小部分, 大量的图片等静态IO处理完全不需要逻辑程序的参与(注1)
从扩展性上讲, fastcgi是一个中立的技术标准, 完全可以支持任何语言写的处理程序(php,java,python...)。
因此,在许多嵌入式设备上采用了lighttpd作为web服务器,针对本人工作方向,选择以lighttpd作为web服务器框架,搭建web-server。
Optional libraries provide additional feature capabilities to the modules.
|
feature |
|
required libs |
|
'''what?''' |
|
|
auth-crypt |
|
crypt() from libc/libcrypt |
|
provides htpasswd and htdigest for basic/digest auth |
|
|
auth-ldap |
|
libopenldap |
|
auth users against an ldap server |
|
|
compress-bzip2 |
|
libbz2 |
|
optional, non-standard bzip2 compress for mod_compress |
|
|
compress-deflate |
|
libz |
|
deflate compress for mod_compress |
|
|
compress-gzip |
|
libz |
|
gzip compress for mod_compress |
|
|
large-files |
|
libc/os |
|
large files support |
|
|
network-ipv6 |
|
libc/os |
|
ipv6 support |
|
|
network-openssl |
|
libopenssl |
|
ssl cabability |
|
|
regex-conditionals |
|
libpcre |
|
=~ and !~ in config conditionals |
|
|
stat-cache-fam |
|
libfam/gamin |
|
caches stat() calls with the help of FAM |
|
|
storage-gdbm |
|
libgdbm |
|
local, non-cluster storage for mod_trigger_b4_dl |
|
|
storage-memcache |
|
libmemcached |
|
distributed storage for mod_trigger_b4_dl |
|
|
webdav-locks |
|
libxml2, sqlite3, libuuid |
|
file locking for mod_webdav |
|
|
webdav-properties |
|
libxml2, sqlite3 |
|
property storage for mod_webdav |
|
通过makefile之间编译,并将其安装到指定目录
LIGHTTPD = ./lighttpd-1.4.49
GCC = gcc
INSTALLDIR = /home/cdl/workspace/install
all:WebServer
WebServer:
(cd $(LIGHTTPD);./autogen.sh;./configure CC=$(GCC) --prefix $(INSTALLDIR); make; make install)
clean:
(cd $(LIGHTTPD);make uninstall;make clean)
可参考文件/lighttpd-1.4.49/tests/lighttpd.conf
简单测试
多一个尖括号要去掉哦!
《html》
sudo ./lighttpd -D -f lighttpd.conf
环境搭建完成。