Pages

Friday, July 13, 2012

XCache 2.0.0 Install on Bluehost Web hosting Service

XCache 2.0.0 Install on Bluehost Web hosting Service - Stuck in a Server Closet

I help run the technical side of an online community for car enthusiasts and ran through an install of XCache yesterday to help with database access errors. Bluehost has a strict limitation of 15 queries per SQL User account and we were reaching that quite often with some 3rd party plugins installed. XCache helps reduce the user connections by cache queries until they can be run, below is a how to for installing version 2.0.0.

First off I want to make sure credit is given where it is due, I used an older how to from http://rk.md/2009/xcache-bluehost/ to help me through the process for my host but have some modifications for version 2.0.0 as well as the latest PHP 5.2 configuration script.

As we start the walkthrough much of the commands are the same, but replacing the version number.

To connect via SSH (on a Mac OSX Lion platform):
  1. Open Terminal
  2. Type : ssh AccountHostname -l Username
  3. Enter in your password
Now to install XCache 2.0.0
  1. cd ~
  2. mkdir modules xcache
  3. cd xcache
  4. wget http://xcache.lighttpd.net/pub/Releases/2.0.0/xcache-2.0.0.tar.gz
  5. tar -zxf xcache-2.0.0.tar.gz
  6. cd xcache-2.0.0
  7. phpize
  8. ./configure --enable-xcache
  9. make
  10. cd modules
  11. mv xcache.so /home/BLUEHOST-USERNAME/modules
Now go to your public_html directory and find php.ini, this configuration file needs to be modified to enable/run XCache on the server. Open php.ini in your preferred coding utility (Notepad++ for example) and find "Dynamic Extensions", this is a change from the previous setup of the file as Windows Extensions is no longer a valid heading. Inset the following code after the omitted part of this section.

zend_extension = /home/BLUEHOST_USERNAME/modules/xcache.so
zend_extension_ts = /home/BLUEHOST_USERNAME/modules/xcache.so
xcache.shm_scheme = "mmap"
xcache.size = 32M
xcache.count = 8
xcache.slots = 8K
xcache.ttl = 0
xcache.gc_interval = 0
xcache.var_size = 16M
xcache.var_count = 1
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.test = Off
xcache.readonly_protection = Off
xcache.mmap_path = "/dev/zero"
xcache.coredump_directory = ""
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off
xcache.coverager = Off
xcache.coveragedump_directory = ""

Thats it! You have installed XCache. To check the status of XCache (if it has been loaded yet or not) setup a phpinfo.ini file and navigate to it. In the webpage search for XCACHE (the modules are in alphabetical order).

No comments:

Post a Comment