因为想要学下CGI 程序,所以在寻求一个简单easy 的http 服务器。 除去大名鼎鼎的apache、nigix 等,我找了一个 轻量级的,lightttpd 。
本想着搭建应该十分简单,但也有坑。记录如下:
说明:
搭建平台: Centos
0、下载 ,到官网下载。 包名为: lighttpd-1.4.4.41.tar.gz.
1、解压 tar -xzf lighttpd-1.4.4.41.tar.gz.
2、cd 到 lighttpd-1.4.4.41
到了此处,建议使用 专有用户进行操作,不要使用root。使用root 会有麻烦,且不符合规范。
新建用户:
useradd lighttpd
su lighttpd
passwd (设置密码)
3、配置安装路径
configure --prefix=/usr/local/lighttpd
由于我图简单,没有安装依赖库 pcre,所以我的配置如下:
configure --prefix=/usr/local/lighttpd --without-pcre
这里不好,不要这样做,对使用lighttpd 有很多不方便,建议 还是先安装 pcre库,使用 http://chenzhou123520.iteye.com/blog/1817563 的过程。