If you are using shared hosting, you probably know just how difficult it is to take full advantage of the resources your host is offering you. Long before you hit the storage and bandwidth limits, you over use system resources. Unfortunately, hosts never share with you what exactly those limits are. There are a myriad of WordPress plugins that help you cache your site and lower the cpu cycles that you are using. For those of use who use a VPS or dedicated server, we have a better solution.
There are PHP caching addons that we can install in our VPS or dedicated server to reduce the amount of cpu cycles a particular WordPress blog is using and pile even more sites onto our server. There are several to choose from including eaccelerator and APC. I have personal experience with both of these and my personal favorite is APC. In fact, Alternative PHP Cache (APC) is going to have native support in PHP 6. It works well with all versions of PHP and once installed, it just works.
I have put together a couple of tutorials on installing APC on a couple of different platforms. Of course my preferred platform is Ubuntu, but I have also included a tutorial for installing it on Centos 5.2.
Have fun:
Installing APC on Ubuntu 8.04 Hardy Heron
Installing APC on Centos 5.2
Posted in Blog Servers | 1 Comment »
Tags: APC, cache, Centos 5.2, eaccelerator, Hardy Heron, Ubuntu
If you’ve got your own VPS or dedicated server and are looking for a way to cache your PHP code and make your blog run faster, then you need the Alternative PHP Cache (APC). It’s not difficult to install APC on Centos 5.2 and have a working cache solution.
First, you need want to make sure you have the most update to date PHP so go ahead and update your PHP using yum.
yum update php
If you are using Plesk, you may want to use these commands instead.
wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh
yum update php
Next, you need to install some dev files. Go ahead and install these one line at a time.
yum install php-devel
yum install php-pear
yum install httpd-devel
Once you are done with those, now it is time to install APC itself. Once again from your SSH shell, run this command:
pecl install apc
You’ll be given an installation option, just hit enter to continue.
Next, you need to tell your PHP file just where your APC extension is. For this, you’ll need to copy and paste some code and stick it into your php.ini file.
So, copy this code:
extension = apc.so
apc.enabled = 1
apc.shm_size = 48
apc.include_once_override = 1
apc.mmap_file_mask = /tmp/apc.XXXXXX
Next open your php.ini file:
vi /etc/php.ini
At the top of the file just paste the code. All that is left to do is to enable it. Just restart apache with this command:
service httpd restart
If you are interested in having a graphical look at what your cache is doing, you can copy the file below to a web accessible directory. Just remember to move it out of web accessible directory to keep prying eyes away;
/var/cache/php-pear/APC-3.0.19/apc.php
You now have a working PHP cache. You will reduce your server load and serve up your pages even faster.
Posted in Blog Servers | No Comments »
Tags: APC, cache, Centos 5.2, php cache
If you’ve got your own VPS or dedicated server and are looking for a way to cache your PHP code and make your blog run faster, then look no further than Alternative PHP Cache (APC). It’s a breeze to install APC on Ubuntu 8.04 Hardy Heron. It takes just a few simple commands and you are set.
First off, you need to update your apt-get files so run the command:
sudo apt-get update
Next, you need to install the dev files that will prepare your server to install APC.
sudo apt-get install php5-dev php-pear apache2-threaded-dev
Once you are done with those, now it is time to install APC itself. Once again from your SSH shell, run this command:
pecl install apc
You’ll be given an installation option, just hit enter to continue.
Next, you need to tell your PHP file just where your APC extension is. For this, you’ll need to copy and paste some code and stick it into your php.ini file.
So, copy this code:
extension = apc.so
apc.enabled = 1
apc.shm_size = 48
apc.include_once_override = 1
apc.mmap_file_mask = /tmp/apc.XXXXXX
Next open your php.ini file:
nano /etc/php5/apache2/php.ini
At the top of the file just paste the code. All that is left to do is to enable it. Just restart apache with this command:
/etc/init.d/apache2 restart
You now have a working PHP cache. You will reduce your server load and serve up your pages even faster.
Posted in Blog Servers | No Comments »
Tags: APC, Hardy Heron, php cache, Ubuntu