I have proved this to be working for me. I hope this is helpful to others
Compiling Lighttpd from source
./configure –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 –with-pcre –with-zlib –with-bzip2 –disable-ipv6 –with-PACKAGE=mod_redirect –with-rewrite –with-redirect ./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 –with-pcre –with-zlib –with-bzip2 –disable-ipv6 –with-PACKAGE=mod_redirect –with-rewrite –with-redirect ;
$ make
# make install
Light-httpd-conf
=======
server.document-root = “/var/www/html”
server.port = 80
server.username = “lighttpd”
server.groupname = “lighttpd”
server.bind = “192.168.1.245″
server.tag =”lighttpd”
server.errorlog = “/var/log/lighttpd/error.log”
accesslog.filename …
Results > Posts Filed Under > Server
Lighttpd with PHP. The complete configuration explained
Null Route an IP
Adding a null route to a host on linux
This is done by adding the following line to the /etc/sysconfig/static-routes file:
any host 111.111.111.111 reject (being 111.111.111.111 the ip address to block)
When you perform a “route -n” you will see this IP with “-” as it’s gateway. This will cause your server to drop all response traffic to this IP.
Some useful Commands.
Creating Linux install drive.
mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom
cd /cdrom/images
dd if=boot.img of=/dev/fd0 bs=1440k
cut -d: -f1,7 /etc/passwd | grep sh | grep -v noshell
List: iptables -L -n | grep <IP Address>
Remove: iptables -D INPUT -s <IP 1> -d <IP 2> -j DROP
Insert: iptables -I INPUT -s <IP> -j DROP
Flush: iptables -F
Remove: iptables -D OUTPUT -s 0.0.0.0/0 -d 66.93.33.185 -j DROP
netstat -nap | grep :80 | wc -l //list number of connections connected to port 80
netstat -ntu | awk ‘{print $5}’ …
Add Swap partition to Linux
You have two options: add a swap partition or add a swap file. It is recommended that you add a swap partition, but sometimes that is not easy if you do not have any free space available.
To add a swap partition (assuming /dev/hdb2 is the swap partition you want to add):
The hard drive can not be in use (partitions can not be mounted, and swap space can not be enabled). The easiest way to achieve this it …