Author: admin

  • lighttpd & Apache together on multipleIPs

    Say you need to run lighttpd & Apache together on the same server, same port 80, but on different IP addresses. Have this in lighttpd.conf: server.port = 80 server.bind = “lighttpd_IP1” $SERVER[“socket”] == “lighttpd_IP2:80” {} And listen to a specific IP in Apache’s httpd.conf Listen Apache_IP:80

  • Count source code lines recursively

    Since wc itself does not have a recursive option built-in, it’s as simple as: find . -name ‘*.php’ | xargs wc -l

  • lighttpd & image serving benchmark

    The difference between serving image from MySQL & from a static file is huge so there is clearly no question which one is better in term of performance. ab -n 1000 -c 10 25131.php Requests per second: 66.33 [#/sec] (mean) ab -n 1000 -c 10 25131.gif Requests per second: 632.39 [#/sec] (mean)

  • lighttpd, php5, eAccelerator by RPMs

    Install the require RPMs (php, php-mysql, php-eAccelerator). For Fedora, use yum (lighttpd and lighttpd-fastcgi). For CentOS and other distros that do not include lighttpd in their repository, use DAG repository Find out the path to php-cgi and whether it supports fastcgi (should show cgi-fcgi) $ php-cgi -v PHP 5.0.4 (cgi-fcgi) (built: Nov 8 2005 08:25:54)…

  • Google Earth v4 & Vietnam maps

    Google Earth recently released version 4 (beta) and also it supports higher resolutions maps for Vietnam metros (like Saigon, Hanoi, and other cities). Great kudos for them. Love those maps, now I see things I never know about Saigon before.

  • Shell-script: MySQL optimize all tables

    Using myisamchk sometime requires shutting down MySQL server and that’s not very easy in certain situation. This shell script accepts a database name from input and gets all table names and runs a SQL query against these tables. Currently, it only optimizes all the tables and could be expanded to do a lot more. OPTIMIZE…

  • APF & iptables issue

    If you try to restart APF and somehow got this message: Unable to load iptables module (ipt_state), aborting. change this in the conf.apf SET_MONOKERN=”0″ change to “1”

  • LVS-TUN Director Notes

    Director server needs at least 2 IP addresses, one for the Virtual IP and one for other things. With just one, SSH seems to forward to the other machine among other unexpected behaviors. Real/Worker server needs just one IP address each. Kernel 2.6.x seems to have no problem with the ARP problem and no need…

  • PowerDNS & geobackend fixed

    Problem: dig query returns ;; connection timed out; no servers could be reached Solution: It’s very important to bind the PowerDNS server to specific IPs. (local-address=DNS_IP1,DNS_IP2,etc.)

  • PowerDNS geobackend README

    PowerDNS geobackend setup notes =============================== These are the steps I went through to set up geobackend for PowerDNS on FreeBSD -STABLE. By the time you read this maybe geobackend is part of the PowerDNS main CVS so perhaps not much of this will apply. In that case you should skip further down to the configuration…