文章转自 http://www.cyberciti.biz/tips/rhel-lighttpd-15-installation-configuration-howto.html
Download and untar lighttpd-1.5.0-r1691.tar.gz tar ball
# cd /opt # wget http://www.lighttpd.net/assets/2007/2/23/lighttpd-1.5.0-r1691.tar.gz # tar -zxvf lighttpd-1.5.0-r1691.tar.gz
You need to install following libraries to compile required modules and features:
Configure required modules and features:
./configure --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --with-openssl
Just compile and install lighttpd:
# make # make install
First add lighttpd user:
adduser -m -d /var/www -s /sbin/nologin lighttpd
Next create configuration directories:
# mkdir /etc/lighttpd/ # mkdir /etc/lighttpd/ssl # mkdir /var/log/lighttpd # mkdir -p /var/www/html # chown lighttpd:lighttpd /var/log/lighttpd
Now you need to create basic configuration file. Just grab my default configuration file:
# cd /etc/lighttpd # wget http://www.cyberciti.biz/files/lighttpd/1.5.0/lighttpd.conf.txt # mv lighttpd.conf.txt lighttpd.conf
Make changes as per your setup:
# vi lighttpd.conf
Copy lighttpd init.d file:
# cd /etc/init.d # wget http://www.cyberciti.biz/files/lighttpd/1.5.0/lighttpd.init.d.txt # mv lighttpd.init.d.txt lighttpd # chmod +x lighttpd # chkconfig on lighttpd
My setup:
# uname -mrs
Now start lighttpd:
/etc/init.d/lighttpd start
Starting lighttpd: mod_proxy_core_address.c.63: (trace) adding unix:/tmp/php-fastcgi.sock to the address-pool [ OK ] spawn-fcgi.c.209: child spawned successfully: PID: 6344