linux 安装lighttpd和配置

由于一个电子商务网站,我需要建立一个图片服务器,考虑再三,我决定采用lighttpd来作为其软件载体。

以前我用过apapche http,相对apache http 来说lighttpd在静态文件的展示方面有着不错的性能提升,个人

认为apache http功能很强大很稳定,基于这种前提下apache http设计的考虑到方方面面,难免在性能方面有所损失。

而lighttpd呢则是轻装上阵,在静态文件的方面的性能的确非常令我砰然心动。

安装的时候也参考了不少的网络上的资料,可是没有一个成功的,也许大家的系统环境有所差异,比如安装linux操作系统的时候,有些东西没有安装,而这些确实是我们lighttpd所需依赖的。

步骤一:

下载 pcre-8.01.tar.gz, lighttpd-1.4.26.tar.gz

步骤二(安装pcre):

cd /usr/local/src
tar -zxvf pcre-8.01.tar.gz
cd pcre-8.01
./configure --prefix=/usr/local/pcre
make
make install

#有好多网上资料其实少了下面环境变量的设置,所以怎么试也是不可以的

PCRE_HOME=/usr/local/pcre
PATH=$PCRE_HOME/bin:$PATH
export PATH
LD_LIBRARY_PATH=$PCRE_HOME/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

步骤三(安装lighttpd):

tar -zxvf lighttpd-1.4.26.tar.gz
cd lighttpd-1.4.26
./configure --prefix=/usr/local/lighttpd
make
make install

步骤四(参数配置):

cd /usr/local/src/lighttpd-1.4.26
cp doc/sysconfig.lighttpd /etc/sysconfig/lighttpd
cp doc/rc.lighttpd.redhat /etc/init.d/lighttpd
vi /etc/init.d/lighttpd [lighttpd="/usr/sbin/lighttpd" 改为 lighttpd="/usr/local/lighttpd/sbin/lighttpd"]


mkdir /var -p /www/htdocs
mkdir /usr/local/lighttpd/logs
mkdir /usr/local/lighttpd/compress
mkdir /etc/lighttpd
cp doc/lighttpd.conf /etc/lighttpd/lighttpd.conf

vi /etc/lighttpd/lighttpd.conf 修改相应的参数
---server.document-root = "/var/www/htdocs/"
---server.errorlog = "/usr/local/lighttpd/logs/error.log"
---accesslog.filename = "/usr/local/lighttpd/logs/access.log"
---compress.cache-dir = "/usr/local/lighttpd/compress/"
---compress.filetype = ("text/plain", "text/html","text/javascript","text/css")
---把#server.port = 81 前的#去掉
---server.modules(mod_rewrite,mod_access,mod_fastcgi,mod_simple_vhost,mod_ssi,mod_compress,mod_accesslog)

---server.event-handler = "poll"

lighttpd常用操作:

/etc/init.d/lighttpd start
/etc/init.d/lighttpd stop
/etc/init.d/lighttpd restart


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/wangxuefeng_yctc/archive/2010/06/07/5652654.aspx
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值