v2-9de68c4afe55a8076779ed99b485fd79.jpg
wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.39.tar.gz
tar zxvf lighttpd-1.4.39.tar.gz
cd lighttpd-1.4.39
./configure --prefix=/usr/local/lighttpd --with-pcre
报错:
configure: error: pcre-config not found, install the pcre-devel package or build with --without-pcre
安装:yum install pcre-devel
configure: error: bzip2-headers and/or libs where not found, install them or build with --without-bzip2
安装:
yum -y install bzip2-*
./configure --prefix=/usr/local/lighttpd --with-pcre
make && make install
pwd
/root/lighttpd-1.4.39
cp doc/config/lighttpd.conf /etc/sysconfig/lighttpd
cp doc/config/initscripts/rc.lighttpd.redhat /etc/init.d/lighttpd #此脚本用来控制启动、关闭和重起。
修改/etc/init.d/lighttpd,,把lighttpd="/usr/sbin/lighttpd" 改为 lighttpd="/usr/local/lighttpd/sbin/lighttpd"

mkdir -p /var/www-lighttpd/htdocs 创建网站根目录文件夹

mkdir /etc/lighttpd
cp ~/lighttpd-1.4.39/doc/config/lighttpd.conf /etc/lighttpd/lighttpd.conf lighttpd的主配置文件
修改此文件:
var.log_root = "/var/log/lighttpd"
var.server_root = "/var/www-lighttpd"
var.state_dir = "/var/run"
var.home_dir = "/var/lib/lighttpd"
var.conf_dir = "/etc/lighttpd"
var.cache_dir = "/var/cache/lighttpd"
server.port = 80
server.username = "lighttpd"
server.groupname = "lighttpd"
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".scgi" )
server.errorlog = log_root + "/error.log"
server.max-fds = 2048
server.max-connections = 1024

创建用户
useradd lighttpd
chown –R lighttpd:lighttpd /usr/local/lighttpd/
chown –R lighttpd:lighttpd /var/www-lighttpd/

Stopping lighttpd: [FAILED]
Starting lighttpd: 2016-03-04 09:43:27: (plugin.c.223) dlopen() failed for: /usr/lib64/lighttpd/mod_fastcgi.so /usr/lib64/lighttpd/mod_fastcgi.so: cannot open shared object file: No such file or directory
2016-03-04

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code