轻量型thttpd+php5
thttpd是一个非常小巧的轻量级web server,它非常非常简单,仅仅提供了HTTP/1.1和简单的CGI支持,thttpd 也类似于lighttpd,对于并发请求不使用fork()来派生子进程处理,而是采用多路复用(Multiplex)技术来实现。因此效能很好。thttpd还有一个较为引人注目的特点:基于URL的文件流量限制,这对于下载的流量控制而言是非常方便的。象Apache就必须使用插件实现,效率较thttpd低。
php有 thttpd 编译选项,可以作为thttpd模块,这样就比nginx lighttpd 的 php-fpm 更节省资源,相应速度要快!但是目前 thttpd 对PHP的支持限于版本的要求,今天搜索搜索到有一达人出了php5.2.11版本的补丁。
下载php-5.2.11-thttpd-2.25b
thttpd $> wget http://download2.3tera.net/oss/files/osm/thttpd-2.25b/php-5.2.11-thttpd-2.25b.tar.bz2
下载 thttpd-2.25b
thttpd $> wget http://www.acme.com/software/thttpd/thttpd-2.25b.tar.gz
1. 创建用户
thttpd $> groupadd -g 33 www
thttpd $> useradd -g 33 www
2. 编译php-5.2.11 作为 thttpd模块
thttpd $> tar jxvf php-5.2.11-thttpd-2.25b.tar.bz2
thttpd $> cd php-5.2.11
thttpd $> ./configure –prefix=/usr/local/php5 –with-thttpd=/root/thttpd-2.25b #这里我就默认安装的,你需要什么模块自行添加
thttpd $> make
thttpd $> make install
3.安装 thttpd-2.25b
thttpd $> tar zxvf thttpd-2.25b.tar.gz
thttpd $> cd thttpd-2.25b
thttpd $> ./configure –prefix=/usr/local/thttpd
thttpd $> sed -i ‘s#getline#get_line#g’ extras/htpasswd.c #在这里必须要修改一下htpasswd.c源码,不然会出现
近期评论