How to install lighttpd from source code

Lighttpd is a secure, fast, compliant, and very flexible web server that has been optimized for high-performance environments. In this post, we will be installing Lighttpd by compiling the source code. To install lighttpd from the source, first, let’s install the requirements For RHEL, CentOS, AlmaLinux, etc.. dnf -y install wget dnf -y group install … Read more

lighttpd too many open files

lighttpd server crashes with fllowing error in error_log file. 2019-11-05 09:39:02: (network_linux_sendfile.c.143) open failed: Too many open files 2019-11-05 09:39:02: (connections.c.603) connection closed: write failed on fd 1228 2019-11-05 09:39:02: (response.c.537) file not found … or so: Too many open files /4032/1_451.jpg -> As lighttpd is a single-threaded server, its main resource limit is the … Read more

lighttpd

lighttpd is a lightweight web server used mainly to serve static files. Youtube used lighttpd before it was purchased by Google. I was using lighttpd with some file hosting/image hosting sites with mod_secdownload that allows the link to expire after a predefined time. https://www.lighttpd.net lighttpd mod alias lighttpd too many open files bind lighttpd to … Read more

lighttpd mod alias

mod_alias lighttpd module allow you to map urls to file system. For example, you need /mrtg show /var/www/mrtg You need to first enable mod_alias in lighttpd.conf vi /etc/lighttpd/lighttpd.conf Find server.modules = ( # “mod_rewrite”, # “mod_redirect”, # “mod_alias”, and remove the comment # on “mod_alias” line. It should look like server.modules = ( # “mod_rewrite”, … Read more

bind lighttpd to one ip address

I want to bind lighttpd on IP address 76.76.18.20, so i can use other IP’s for Apache, Apache have “Listen” option to bind apache to specific IP address. vi /etc/lighttpd/lighttpd.conf Find #server.bind = “127.0.0.1” Replace with server.bind = “76.76.18.20” See lighttpd

Auto restart lighttpd on crash

To restart lighttpd if it went down or crashed, create a file check_lighttpd.sh mkdir /usr/serverok vi /usr/serverok/check_lighttpd.sh With the following content #!/bin/bash /usr/bin/wget –tries=1 –timeout=30 -O /dev/null http://localhost:80/up.html if [ $? -ne 0 ]; then ( killall -9 lighttpd; killall -9 gam_server; killall -9 php-cgi; /etc/init.d/lighttpd stop; mv /var/log/lighttpd/access.log /var/log/lighttpd/access.$(date +%Y%m%d_%H).log mv /var/log/lighttpd/error.log /var/log/lighttpd/error.$(date +%Y%m%d_%H).log … Read more