源码编译安装配置Lighttpd


1. 安装系统依赖
# yum -y install glib2-devel openssl-devel pcre-devel
# yum -y install gcc gcc-c++ make

2. 下载源码包并编译安装
# wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.32.tar.gz
# tar -zxvf lighttpd-1.4.32.tar.gz
# cd lighttpd-1.4.32
# ./configure
# make
# make install

3. 创建启动脚本与配置文件
# sed -e 's/FOO/lighttpd/g' doc/initscripts/rc.lighttpd.redhat > /etc/init.d/lighttpd
# chmod 755 /etc/init.d/lighttpd
# echo "LIGHTTPD_CONF_PATH=/etc/lighttpd/lighttpd.conf" > /etc/sysconfig/lighttpd
# install -Dp ./doc/config/lighttpd.conf /etc/lighttpd/lighttpd.conf
# cp -R doc/config/conf.d/ /etc/lighttpd/
# cp doc/config/conf.d/mod.template /etc/lighttpd/modules.conf

4. 创建执行用户
# ln -s /usr/local/sbin/lighttpd /usr/sbin/lighttpd
# mkdir -p /srv/www/htdocs
# groupadd lighttpd
# adduser -M -g lighttpd -s /sbin/nologin lighttpd
# chown -R lighttpd:lighttpd /srv/www

# mkdir /var/log/lighttpd
# chown lighttpd:lighttpd /var/log/lighttpd

5. 修改相关配置
# vim /etc/lighttpd/modules.conf
---
#server.modules += ( "mod_Foo" )

# vim /etc/lighttpd/lighttpd.conf
---
server.use-ipv6 = "disable"

6. 启动Lighttpd
# /etc/init.d/lighttpd start

  1. No comments yet.
(will not be published)
*