New Site!


My new site is more or less up, and I’ve migrated all my post over to it.
From now on, I’ll be blogging from Brainfart.SG and this blog will be mothballed.

See ya at the other side!


WordPress Upload Problem

I’ve finished setting up the LNMP stack on my VPS, and got WordPress running on it.

I will be sharing the steps I’ve done to setup the LNMP stack on a later date, but first, I’d like share an issue I’ve encountered after getting WordPress up and running.

After running the install.php script and doing up the settings of my WordPress site, I tried to upload a free theme pack from WooThemes. (Typebased, if you are wondering which one)

The first problem I hit was the server giving me a “Connection Reset” everytime I tried to upload the theme. In the Nginx error log, this was recorded:

2011/09/24 07:34:58 [error] 30097#0: *70 client intended to send too large body: 2617076 bytes, client:, server: www.brainfart.sg, request: "POST /wp-admin/update.php?action=upload-theme HTTP/1.1", host: "www.brainfart.sg", referrer: "http://www.brainfart.sg/wp-admin/theme-install.php?tab=upload"

The “client intended to send too large body” tells us that Nginx was rejecting the theme zip file as it was too big (it’s 2.49MB in size). A check on the Nginx Wiki shows that the default maximum size accepted by Nginx is 1MB, and Nginx resets the connection whenever a browser tries to send or request a file greater than 1MB. So we’ll have to update the nginx.conf file with the “client_max_body_size” directive to get Nginx to send and receive a bigger file. I’ve changed mine to a value of 3MB and you may adjust yours accordingly. Note that the directive is placed in the “http” section.

http {
client_max_body_size 3M;

I tried to upload the theme file again, and this time the file was accepted by Nginx without a problem. However, WordPress threw an error, “The uploaded file could not be move to …/wp-content/uploads.” Not a very intuitive error, seems like it is a permission issue with WordPress trying to write to the uploads directory… The logs weren’t showing any error and a Google search resulted in quite a few people having the same problem.

Most of the resolution are to do with setting the correct permission for the uploads directory. A check with my uploads directory shows that the permissions are correct  and I even tried to give full 777 permission to the directory! But error still persist… It took me quite a while, trying to figure out what’s wrong and then it suddenly hit me! It could be related to the Nginx size error, but at the PHP layer. A quick Google shows that PHP has a “upload_max_filesize” and “post_max_size” directive, so I updated my php.ini to include the two directives:

upload_max_filesize = 3M
post_max_size = 3M

Bingo!  The theme file went through and was installed in WordPress.

VPS – Setting up

I've logged in to my VPS and started setting it up.

Basically, the VPS has the following specs:

  • BuyVM-256MB
  • 256MB RAM (Burstable to 512MB)
  • 2 Core CPU
  • 30GB of HDD
  • 1000GB of data transfer
  • 1 US based IP

The VPS was first setup with BuyVM’s Centos 6 template (selected during the VPS ordering page). However, the memory usage  seems to be a little bit on the high side, roughly 30mb idling after I cleaned up the unnecessary services and unused packages. No good… Still too much memory for running nothing…

So the next thing I tried was to reinstall to their “centos-5-i386-minimal”. After reinstalling, I can’t even ssh or console into the VPS… Resintalled again, still the same… Seems like that template is broken… No go.

Reinstalled to “CentOS 5 32bit”, the idling memory shows ~14mb.
Sweet! We are good to go! Continue Reading »

Virtual Private Server

Finally got my VPS!
Some stock from BuyVM.net  opened up today (yesterday for you American folks) and as usual, the ultra-lowend plan ($15/yr) was snapped up way before I knew about it…
Instead, I signed up for the $3.50/mth plan and it just got provisioned a few hours ago.

Now I gonna start cleaning up my VPS and setup the LNMP stack and Postfix mail server I have in mind.
Will update my progress here. :)

A new beginning(?)

My last post was almost 2 years ago…

I’ve let this blog sitting here that long? So much things have changed in the WordPress Dashboard, I’m almost lost there… Hah!

Anyway, I hope to start afresh on this blog. Just bought a .sg domain from Instra and now I’m looking for a VPS to host the blog and maybe an email server.
Looking at BuyVM or SpotVPS, that is, if I can get a coveted slot on BuyVM, if not, most likely I’ll go SpotVPS. Or does anyone have any recommendation?

Class95 Swags

The story I submit for Class95 “Back to the Old School” got selected and Jean Danker read it live on-air!

Collected the Gift Pack today.

It consist of:

  • Class95 FM T-Shirt
  • Class95 FM Jacket with “The Flying Dutchman” embossed on the chest
  • Class95 FM Pen (A gel pen!)
  • Class95 FM Fridge Magnet
  • Class95 FM Lanyard


TreeTop Walk


Been a while since I posted something eh. Well, in my defense, I’ve been kinda busy with work, it’s been 5 months since I’ve join this company, and boy, have I been learning lots of new stuff!

Anyway, this post is not about work.

Last Saturday, me and the fine folks at Mensa went for a little trek at MacRitchie Reservoir up to the HSBC TreeTop Walk suspension bridge. It was wonderful! Except for the heavy downpour in the morning at the beginning of the trek… But that didn’t hinder us, we carried on after the rain has subsided.

The view at the suspension bridge was great!



More photos can be found on my flickr photostream

I should do this more often! ^^