用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
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
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" #图片文件存储目录
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
ps auxww |grep lighttpd|grep -v grep
启动lighttpd服务 startlighttpd.sh
#!/bin/bash
/usr/local/lighttpd/sbin/lighttpd -f /usr/local/lighttpd/config/lighttpd.conf
/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
kill -9 $LIGHTTPD_PID
相关推荐
OwenJi 2020-04-30
hygbuaa 2020-02-02
82463862 2011-09-13
boante 2008-07-17
httphttpcn 2007-06-27
87204950 2011-08-22
afterlake 2011-07-16
方正SOA中间件 2011-06-23
85234850 2011-05-19
87447007 2011-03-10
89401052 2010-09-29
梦想启航 2010-06-14
kaiwangic 2010-04-01
afterlake 2009-12-25
bglmmz 2009-04-04
luyinlian 2011-09-23
MARQUIS 2012-08-13
87510793 2011-06-30
snowman 2014-08-07