Subscribe via

WP-Cache, the Untold Way to Set It Up

WP-Cache is a WordPress plugin that improves your WordPress speed by caching a static version of each dynamic page request and deliverying that static version for subsequent requests to that page. This in combination with WordPress internal cache, Apache cache, eAccelerator op code cache, and Varnish proxy cache provides the ultimate setup to combat traffic storms if your article gets dugg. *Note* that there is also a method that helps you turn on WP-Cache on demand (only during traffic storms), but I will discuss that in a later article.

If you’ve ever tried to install the WP-Cache plugin for WordPress just by uploading to the wp-content/plugins directory and activating it via WordPress Plugins administration, then you know that 99% of the time that method will not work because of some file permission problems.

Here is the proper way to do it: Read on…

Best Question Asked by Our Customer

Comments Off on Best Question Asked by Our Customer

I changed jobs about 2 months ago to a Test Engineer at Coral8. We develop and sell Complex Events Processing software and one of the things we brag about is high availability and guaranteed message delivery. One of the questions we got from one of our customers today was, “Can we run over UDP for greater reliability?” I can tell you that UDP does NOT stand for “Undropped Data Protocol”, see Wikipedia (first sentence of second paragraph).

Keeping BSD Ports Up-to-date Effortlessly

If you don’t have ‘cvsup’ installed, do so by following the tutorial on Open Addict (section: Rebuild the World, and Recompile the Kernel):

Since all you have to do to update your ports is run the command:

cvsup -g -L 2 /root/ports-supfile

Just stick that command in your crontab and make it run every midnight.

crontab -e # This opens the crontab in the vi editor.

Add this line to the crontab:

0 0 * * * /usr/local/bin/cvsup -g -L 2 /root/ports-supfile

Shift+zz to save and you are done.

This it one of the reasons why I love Unix. With little thought, everything is script-able and customizable.

How to Encrypt Your Internet Traffic

This is the coolest trick I learned while working at Blinkx. At the time, our management really hated when we go on any type of instant messaging applications. I also suspected that our messenger conversations and other internet activities were being monitored. I was pissed so this is what I did to combat their nosiness. Read on…

The Simple Explaination and Use of SSH keys

What are SSH Keys? (Easier than what you learned in Computer Security class)

SSH keys are one of the common authentication techniques people use to log into a Unix session (the most common authentication technique is login & password).

If you are like me, you get sick and tired of typing in your login and password every single time you open a new terminal to connect to a Unix session. This is where SSH keys help me everyday by letting me authenticate against the key once, and every new shell session I start will authenticate using the same SSH key.

All you have to do is create a pair of public and private keys. In this analogy, the public key is the house lock and the private key is equivalent to the house key.

Private Key = House key

Public Key = House locks

Using an SSH key to authenticate is like using one key for all the doors in your house instead of having a bunch of combination padlocks (with the same unlock combination) on all your doors.
Read on…

Recapping: Setting up a FreeBSD 6.2 Web Server

I hope I can get some part-time consulting jobs to do this optimization for small businesses. All in all, it doesn’t seem too hard to do and I enjoyed doing it. If you run into a problem just google it for the answer. Anyway, here is the recap of the steps I took to set up my FreeBSD 6.2 Web Server.

  1. Installing OS
  2. Setting Up Apache, MySQL, and Other Services
  3. Migrating WordPress from WinXP to FreeBSD
  4. Optimizing Apache
  5. Optimizing MySQL
  6. Optimizing PHP
  7. Proxy Caching
  8. Optimizing WordPress with WP-Cache
  9. Keeping Your FreeBSD Ports Up-to-Date Effortlessly
  10. Setting Up Sendmail on FreeBSD 6.2

Setting up a FreeBSD 6.2 Web Server: Proxy Caching (Part 7)

Okay I lied, eAccelerator gives a pretty darn high ROI, but setting up a proxy cache gives a comparable or higher ROI. I chose to use Varnish as my proxy cache.

Once installed, Varnish will keep a cache of all objects requested by internet users (e.g. post-generated PHP pages, CSS, javascripts, images) with the goal of off-loading some work from your web server (remember: we won’t want big Apache to do the work only if it has to). Also Varnish takes full advantage of the OS’s virtual memory and advanced I/O features on FreeBSD 6.x making it the optimal choice for my setup.

There were many confusing instructions on the web about how to configure Varnish. Here are the steps I took to setting up Varnish for a signal machine running both Varnish and the web server: Read on…

Setting up a FreeBSD 6.2 Web Server: Optimizing PHP (Part 6)

Comments Off on Setting up a FreeBSD 6.2 Web Server: Optimizing PHP (Part 6)

This was by far the easiest step in my optimization process. To optimize PHP, I used the software called eAccelerator. Compared to all of the other steps, this one had the best ROI for me.

When a PHP script is executed, the PHP interpreter will spend some time interpreting the script then compile the interpretations into opcodes for execution. eAccelerator will precompile your PHP code into ready executable opcodes and manage that opcode cache for you. If your PHP script does not change, Apache will directly call the precompiled opcodes (saving interpretation and compilation time).

This is what I did to set it up: Read on…

Setting up a FreeBSD 6.2 Web Server: Optimizing MySQL (Part 5)

Similar to Apache, you do not want MySQL to start hogging all the memory in your system. To configure your MySQL settings, open your /etc/my.cnf file for editing. Under the [mysqld] section of the file modify the following variables: Read on…

Setting up a FreeBSD 6.2 Web Server: Optimizing Apache (Part 4)

After my WAMP days were over I declare that I shall no longer fall victim to an inefficient/unoptimized lifestyle. So here is my home brew optimization tutorial (yes, I really did it myself this time!). Read on…