This is the installation steps for 1 virtual host, i used for my one host before :
mkdir lightp
cd /root/lightp
wget
http://www.lighttpd.net/download/lighttpd-1.4.18.tar.gz
tar xvzf lighttpd-1.4.18.tar.gz
cd /root/lightp/lighttpd-1.4.18
./configure
make
make install
mkdir /etc/lighttpd/
mkdir /var/log/lighttpd/
cp doc/lighttpd.conf /etc/lighttpd/
vi /etc/lighttpd/lighttpd.conf
you find it that line : server.document-root
and change it same as httpd.conf document root for example :
server.document-root = "/srv/www/htdocs/"
find that lines and comment out :
$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}
to
#$HTTP["url"] =~ "\.pdf$" {
# server.range-requests = "disable"
#}
find that line and change port than comment in :
#server.port = 81
server.port = 9999
than save and quit..
add lighttpd to services (CentOS, Redhat or Fedora) :
cp doc/rc.lighttpd.redhat /etc/init.d/lighttpd
cp doc/sysconfig.lighttpd /etc/sysconfig/lighttpd
chkconfig lighttpd on
go to :
vi /etc/init.d/lighttpd
and find that line :
lighttpd="/usr/sbin/lighttpd"
than change it :
lighttpd="/usr/local/sbin/lighttpd"
save and quit...
start lighttpd service :
service lighttpd start
and check it lighttpd service running or no ?
ps -ef|grep -v grep|grep lighttpd
if you see,
root 15741 1 0 Sep12 ? 16:25:30 /usr/local/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
go to httpd.conf :
vi /etc/httpd/conf/httpd.conf
and add this lines between tags VirtualHost :
<VirtualHost xxxxx>
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /images
http://0.0.0.0:9999/images
ProxyPassReverse /
http://0.0.0.0:9999/
</VirtualHost xxxxx>
save and quit from httpd.conf and restart service :
service httpd restart
You can check it now, lighttpd is running or no :
tail -f /var/log/lighttpd/access.log
if you find lines starting with 127.0.0.1 that you installed success, apache using lighttpd for static pages now.
this is only for one VirtualHost, if you want to use lighttpd more than 1 VirtualHost you need :
1. All VirtualHosts must start from one directory.
example: /var/doc/virtualhost1, /var/doc/virtualhost2 the partner directory is /var/doc
2. You must change documentroot line in the lighttpd config file same as partner directory.
3. Apache configuration settings in the new partner will be considered directory should be changed.
I used i liked performance when i use together apache and lighttpd but if you want you can set ngix proxy/load balancer for the apache or DirectAdmin can add these features, we can select or change any time apache+lighttpd or ngix+apache. It can be perfect feature for DirectAdmin.