用lighttpd做图片服务器

1、安装pcre 、 zlib 、bzip2

以pcre为例 : ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.10.tar.gz

 
  
tar - zxvf pcre - 8.10 .tar.gz
cd pcre
- 8.10
.
/ configure
make
make install

2、安装lighttpd 

http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.28.tar.gz

 
  
tar - zxvf lighttpd - 1.4 . 28 .tar.gz
cd lighttpd
- 1.4 . 28
groupadd lighttpd
useradd –g lighttpd lighttpd
.
/ configure -- prefix =/ usr / local / lighttpd
make
make install

3、拷贝配置文件

 
  
cp - r doc / config / usr / local / lighttpd

4、修改配置文件

 
  
var.log_root = " /usr/local/lighttpd/log "
var.server_root
= " /var/www "
var.state_dir
= " /var/run "
var.home_dir
= " /usr/local/lighttpd/sbin/lighttpd "
var.conf_dir
= " /usr/local/lighttpd/config "

server.document
- root = server_root + " /image " #图片文件存储目录

5、创建启动、关闭服务的脚本文件

检查lighttpd进程 checklighttpd.sh

 
  
# !/ bin / bash
ps auxww
| grep lighttpd | grep - v grep

启动lighttpd服务 startlighttpd.sh

 
  
# !/ bin / bash
/ usr / local / lighttpd / sbin / lighttpd - f / usr / local / lighttpd / config / lighttpd.conf

关闭lighttpd服务 killlighttpd.sh

 
  
#!/bin/bash
LIGHTTPD_PID = `ps auxww | grep lighttpd | grep - v grep | awk ' {print $2} ' `
kill
- 9 $LIGHTTPD_PID

转载于:https://www.cnblogs.com/nicholas_f/archive/2011/06/15/lighttpd.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值