msgbartop
msgbarbottom

01 Sep 12 Build high performance wordpress site using Nginx + Varnish

Highlight: Ubuntu + Nginx + PHP-FPM + Varnish for WordPress site

The current site is hosted on CentOS 6 using Apache in home lab server, so you may experience slowness due to network limitation. When I was using Apache Bench tool to test the site performance, it can only server 10 requests per second. I’ve tried using Memcache and APC, the performance gain is minimum. After use Varnish in front of Apache server, the site can server over 10,000 requests per second. Here, I am going to setup another test server using Nginx + Varnish to compare with current setup. With Nginx only, it can serve 60 requests per second. That’s 6 times faster than Apache without any cache program. Now, let’s see how much performance Nginx can gain by using Varnish compare to Apache.

Varnish in realtime

(more…)

20 Nov 10 Install Mod_Pagespeed on Centos

What is mod_pagespeed ?

mod_pagespeed is an open-source Apache module that automatically optimizes web pages and resources on them. It does this by rewriting the resources using filters that implement web performance best practices. Webmasters and web developers can use mod_pagespeed to improve the performance of their web pages when serving content with the Apache HTTP Server.

mod_pagespeed includes several filter that optimize JavaScript, HTML and CSS stylesheets. It also includes filters for optimizing JPEG and PNG images. The filters are based on a set of best practices known to enhance web page performance. Webmasters who set up mod_pagespeed in addition to configuring proper caching and compression on their Apache distribution should expect to see an improvement in the loading time of the pages on their websites.

How to install mod_pagespeed?

First,  check which Linux distribution you are using by this command:

cloudtech ~: uname -a
Linux cloudtech 2.6.18.8-x86_64-linode10 #1 SMP Tue Nov 10 16:29:17 UTC 2009 x86_64 x86_64 x86_64 GNU/Linux

Second, download the package at this link: mod_pagespeed latest version

Here I am using 64 bits CentOS Linux system, so i ‘ve downloaded mod_pagespeed 64-bit .rpm (CentOS/Fedora)

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_x86_64.rpm

Third,  install the package

rpm -i mod-pagespeed-*.rpm

or follow the instruction in official site. If you cannot install it, try this:

Install and import Google key into RPM, then you can install mod_pagespeed package using yum localinstall command:

wget https://dl-ssl.google.com/linux/linux_signing_key.pub
rpm --import linux_signing_key.pub
yum localinstall mod-pagespeed-*.rpm

Check which files you just installed:

cloudtech ~: rpm -ql mod-pagespeed-beta
/etc/cron.daily/mod-pagespeed
/etc/httpd/conf.d/pagespeed.conf
/usr/lib64/httpd/modules/mod_pagespeed.so
/var/www/mod_pagespeed/cache
/var/www/mod_pagespeed/files

Last, restart Apache to load the new module

cloudtech ~: service httpd restart

How to upgrade mod_pagespeed?

Download the latest version 0.9.15.3-404 and use command yum localinstall mod-pagespeed-*.rpm to install

http://code.google.com/speed/page-speed/download.html

With this release,  you can perform the upgrade to 0.9.15.3-404 with these commands:
  sudo yum update
  sudo /etc/init.d/httpd restart
On Debian or Ubuntu installation you can use:
  sudo apt-get upgrade mod-pagespeed-beta
  sudo /etc/init.d/apache2 restart

How to test mod_pagespeed?

Visit your site without mod_pagespeed

http://www.cloudtech.org/?ModPagespeed=off

Visit your site with mod_pagespeed

http://www.cloudtech.org/?ModPagespeed=on

Without mod_pagespeed, my site score is 73/100.

With mod_pagespeed, my site score is 81/100.

Monitor the results using Firebug + Pagespeed on your Firefox browser

You can also test your site at ModPageSpeed.com

21 Oct 10 Amazon free cloud service

To help new AWS customers get started in the cloud, AWS is introducing a new free usage tier. Beginning November 1, new AWS customers will be able to run a free Amazon EC2 Micro Instance for a year, while also leveraging a new free usage tier for Amazon S3, Amazon Elastic Block Store, Amazon Elastic Load Balancing, and AWS data transfer. AWS’s free usage tier can be used for anything you want to run in the cloud: launch new applications, test existing applications in the cloud, or simply gain hands-on experience with AWS.

http://aws.amazon.com/free/

02 Aug 10 WordPress Permalinks

By default, WordPress uses URL with question mark and its post ID.  After enable Pretty Permalinks, all the posts give 404 error. At first, I thought it’s .htaccess problem, however this file was updated automatically after applied the changes. After searching Wordpress documents, I found that it also requires FollowSymLinks option and AllowOverride FileInfo directives in Apache configuration file. I never knew this since shared hosting server has those options enabled by default. On VPS server, I have to configure by myself.

vi /etc/httpd/conf/httpd.conf

# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
(more…)

31 Jul 10 Install FFmpeg, Mplayer, Mencoder, FFmpeg-PHP on CentOS 5.x automatically

Test environment : cPanel 11.25.0-R46156 – WHM 11.25.0 – X 3.9
CentOS 5.5 i686

1. cd /usr/src/

2. Download ffmpeginstaller 3  series Latest Stable Release at here

wget http://mirror.ffmpeginstaller.com/old/scripts/ffmpeg3/ffmpeginstall.3.2.1.tar.gz

Note:  ffmpeginstaller 3 scripts will install stable versions of all binaries. ffmpeginstaller version 4 will install all latest dependencies of ffmpeg and mplayer, and  also use svn  version of ffmpeg and mplayer. Version 4 and 5 may cause problem on your VPS. I recommend you install Version 3. (more…)

30 Jul 10 Backup MySQL databases automatically on your VPS

A nice bash script from SourceForge to take daily, weekly and monthly backups of your MySQL databases.

Features:

– Backup mutiple databases

- Single backup file or to a seperate file for each DB

- Compress backup files

- Backup remote servers

– E-mail logs to you

- More…

Here are the steps to run this script on your VPS/Dedicated server:

(more…)