Monthly Archives: January 2012

Controlling your visitors/users bandwidth usage and speed using mod_cband

Again, I’m using my beloved Debian 6 squeeze distribution to test this tutorial.
What is mod_cband? Directly taken from the one that maintain this piece of work:

mod_cband is an Apache 2 module provided to solve the problem of limiting users’ and virtualhosts’ bandwidth usage. The current versions can set virtualhosts’ and users’ bandwidth quotas, maximal download speed (like in mod_bandwidth), requests-per-second speed and the maximal number of simultanous IP connections (like in mod_limitipconn)

I recommend you to install this module into your server if your site providing download or stream service. Benefit after installing this module is: justice for all. For you as server owner: you can control the bandwidth usage and limiting your user’s download/stream speed, keep your server’s memory usage in control. For users: high availability server, no users dominate the bandwidth alone.

OK, let’s start:
install needed package (you need to compile mod_cband by yourself)

download and extract mod_cband

EDIT: it seems that site is not hosting mod-cband anymore, you can download mod-cband form my site instead:

go inside mod-cband directory and do ./configure

fixing Makefile; without doing this trick, you will get error message when trying to restart Apache2 afterwards. This is the error messages:

apache2: Syntax error on line 203 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/cband.load: Cannot load /usr/lib/apache2/modules/ into server: /usr/lib/apache2/modules/ undefined symbol: truncf
Action ‘configtest’ failed.
The Apache error log may have more information.

edit Makefile produced by ./configure before. add “-lm ” after “APXS_OPTS=” and before “-Wc” on line 12. See screenshot:

cband Makefile

Watch for line #12

save it and then do “make&&make install

restart apache2

This isn’t enough. Now, configure your virtual host to use mod_cband. This just example virtual host configuration that I use:

For more extensive and descriptive options, head to mod_cband documentation page

Example result:

Debian 6 apps/tools that I installed after fresh OS install (for server purpose)

Another personal notes for me. These are all small applications/tools that I should install after fresh OS install, most of them are tools to monitor server performance.
nmap : check sever’s open TCP/IP ports. For security reason.
nmap result
mc: a better text based file manager with 2 panes and also provide a good text editor (mcedit)
htop: a better view of top command
htop result
iftop: watch your detailed network traffic at certain ethernet device; see who’s the fastest bandwidth eater.
iftop result
bwm-ng: also bandwidth monitoring but only show overview for each ethernet
bwm-ng result
libwww-perl : this one is dependency for CSF firewall
links: text based browser
curl: this one is used later in most of my PHP scripts

Personal Notes: Debian 6 additional repositories

This is personal note for myself. All of my servers I bought is self-managed and most of them is Debian 6 (squezee). I need to add additional repositories beside the default ones.

Additional Debian 6 repositories added:

  • dotdeb repository –> for latest PHP and MySQL packages
  • debian-multmedia repository  –> for latest multimedia packages such as ffmpeg, mencoder, mplayer
  • debian-backports  –> additional software from Debian previous version that not included in main repository

Full /etc/apt/sources.list

Additional steps for dotdeb repository: before doing “apt-get update“, must download and install dotdeb key first

Additional steps for debian-multimedia repository: must install debian-multimedia-keyring after apt-get update


Pinballpublishernetwork review

What/who is
They are advertising company. They provide pay-per-install advertising, means: you got money when visitors install applications/toolbar from They also had referral program. Publisher (us) can promote Pinbalpublishernetwork’s applications via banner, text link, interstitial or pop-over.

What kind of applications that they offer?
Free applications, games, smileys content program

Publisher can choose which to promote


Do they pay? payment proof?
Yes, they absolutely pay. Payment term: NET30 (just like Adsense). I already paid twice via Paypal (forgot to say: you can either paid via Paypal or check/wire). Here’s my paypal screenshot: payment proof #1

First payment from payment proof #2

Second payment from

I would say that: is suitable if your site content are one of these: download-related, free-online game and software-related tutorial (including PC desktop modification/tips/trick)

Do you still use it?
No. Why? See my report from dashboard:

pinballpublishernetwork reports

My payment schedule report

Look closely and compare it to my paypal payment proof. First payment should be sent at November 11th but they send me payment at November 23rd; I said: Okay, a little 12 days late is rather fine.
Now look at the second payment schedule and compare it to my second paypal payment proof. I should been paid at Nov 29th but they sent the payment at January 13th 2012. That’s almost 2 months late. In the middle of the payment delay, my account manager had been replaced, I had to re-send my W8-BEN form and do some back-and-fort email communications with my account manager more than 10 times. Crazy! I think maybe they were a runner at that time.
So, that’s my simple reason for removing their ads code from my site. If they pay on-time, I would love to continue to use them.

Final words: you should try them!

Achieving what W3 Total Cache does for your non-WordPress site

Before implementing this tips, your server/web host had to use Apache and activated all modules needed as I already posted.
W3 Total Cached had a good .htacess settings that will made your site/blog score higher in Google Page Speed and YSlow. I noticed that these .htaccess settings is quite generic and can be implemented in non-blog, non-Wordpress site.
Here’s the .htaccess settings that you need to copy and paste to your site’s .htaccess:

What it does?

  • enabling gzip compression, your site’s HTML codes will be compressed on-the-fly before served to users/visitors
  • minifying CSS, JS and HTML files from your site
  • add expiry header to your files based on file types
  • set ETag value
  • Specify a Vary: Accept-Encoding header

I’ve implemented this on, the result is as expected.