msgbartop
msgbarbottom

12 Feb 11 Use APC(Alternative PHP Cache) for WordPress on VPS

W3 Total Cache support many page cache methods. For VPS or Dedicated server, it’s better to use Opcode than disk.  The Alternative PHP Cache will be built into PHP6, so it’s a good to try it now.

“APC is a free, open, and robust framework for caching and optimizing PHP intermediate code.”

On CentOS, you can install it though:

# pecl install apc

Or manually install it

# wget http://pecl.php.net/get/APC-3.1.6.tgz
# tar -xvzf APC-*.tgz
# cd APC-*
# phpize
# ./configure
# make
# make install

I’ve see the following error when to install APC through pecl. To solve the problem, just install pcre-devel package first

# yum install pcre-devel
//Error message
/root/tmp/pear/APC/apc.c:369: error: expected specifier-qualifier-list before 'pcre' /root/tmp/pear/APC/apc.c: In function 'apc_regex_compile_array': /root/tmp/pear/APC/apc.c:430: error: 'apc_regex' has no member named 'preg' /root/tmp/pear/APC/apc.c:430: error: 'apc_regex' has no member named 'preg' /root/tmp/pear/APC/apc.c:431: error: 'apc_regex' has no member named 'nreg' /root/tmp/pear/APC/apc.c:431: error: 'apc_regex' has no member named 'nreg' /root/tmp/pear/APC/apc.c: In function 'apc_regex_match_array':

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

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…)

25 Jul 10 Install Imagemagick & Imagick for PHP on CentOS

OS: CentOS 5.5 64bits
PHP: 5.1.6

Install the compiler packages:
# yum -y install gcc automake autoconf libtool make

Install ImageMagick from source:

#cd
# wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.6.3-0.tar.gz
# tar -xzvf ImageMagick-6.6.3-0.tar.gz
# cd ImageMagick-6.6.3-0.tar.gz
# ./configure
# make
# make install (more…)

31 Jul 09 Connect Guest System with SSH

http://www.linuxjournal.com/content/tech-tip-port-forwarding-virtualbox-vboxmanage

Environment:

Host System: Window 7
Guest System:Centos5.3 server

* Before proceed,make sure add the virtualbox path to your Host System. Eg: C:\Program Files\Sun\xVM VirtualBox

1. In Host System, open CMD and type the following command:

// The Guest System name here is “centos”

VBoxManage setextradata centos "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP

// Set the SSH port in Host.

VBoxManage setextradata centos "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort"  2222

// SSH port in Guest.

VBoxManage setextradata centos "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22

2. Restart Guest

3. Connect to SSH in Host using: 127.0.0.1:2222

——————————————-
VBoxManage setextradata centos “VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/Protocol” TCP
VBoxManage setextradata centos “VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/GuestPort” 80
VBoxManage setextradata centos “VBoxInternal/Devices/pcnet/0/LUN#0/Config/http/HostPort” 80

VBoxManage setextradata centos “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssl/Protocol” TCP
VBoxManage setextradata centos “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssl/GuestPort” 443
VBoxManage setextradata centos “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssl/HostPort” 443

VBoxManage setextradata centos “VBoxInternal/Devices/pcnet/0/LUN#0/Config/mysql/Protocol” TCP
VBoxManage setextradata centos “VBoxInternal/Devices/pcnet/0/LUN#0/Config/mysql/GuestPort” 3306
VBoxManage setextradata centos “VBoxInternal/Devices/pcnet/0/LUN#0/Config/mysql/HostPort” 3306

VBoxManage setextradata centos “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol” TCP
VBoxManage setextradata centos “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort” 22
VBoxManage setextradata centos “VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort” 2222