HOW-TO GUIDE Install/Tweak XCache on FastCGI/Spawn-FCGI: VPS BIBLE




new password?
login
X
xcache caching image

This tutorial shows the process to install & configure the PHP accelerator (caching) XCache set up to start on reboot for Ubuntu/Debian servers running FastCGI & Spawn-FCGI.

XCache speeds up sites and blogs by improving php performance. Some prefer Memcache but that’s caches in a different way and is better suited for multi-server installations. XCache is more akin to APC or eAccelerator.

This XCache installation method is fully tested and works, including after a system reboot.

Setup Unmanaged VPS: The Ubuntu-Nginx Guide

Take your virtual private server from zero to hero

  .. from blank box to cute-as server ..  

with this easy-to-follow copy/paste guide.

22+ parts with video, here’s the index.

Assume Super-User Permissions

To gain root access and save a few keystrokes:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Install XCache to PHP Spawn-FCGI/FastCGI

Whether you have installed PHP with fastcgi or spawn-fcgi (tutorial publishing this week), this is a three stage process: install XCache, hook it up to PHP and test it.

Firstly, install the PHP XCache module:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Let’s open PHP’s configuration file, php.ini.


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Scroll to the bottom of the file, appending it with these XCache parameters:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Full details for configuring XCache settings are here but, unless you’re a tweakaholic and for most of us, just consider the following points, applied to your server’s hardware:-

If, like me, you’re running a Linode with 360MB of RAM – the Linode 360 plan, you can use the above configuration unchanged.

Otherwise, you may wish to change four values:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

The first two will be identical to each other, so that helps. The default is actually 60M, not 64M as shown above – call me fussy if you like – which I have amended to work with a Linode running 360MB of RAM (the Linode 360 plan). If you’ve got more RAM, you can probably increase the value but I would recommend asking at your VPS forums.


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

The second two values will also be the same, relating to the number of processors running on your server.

To find out the value paste this at the command line:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

.. changing the value. My Linode, for example, has four:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Suitably tweaked, save and close the php.ini file.

Initiating XCache Automatically on System Reboot

Because we’ve incorporated the XCache configuration into PHP’s settings file, provided you have set up PHP to initiate on system boot (which you have if you’ve been following the vpsBible), XCache will start automatically too.

PHP will need a restart to initially recognise XCache though …

If you have installed Spawn-FCGI:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Alternatively, for FastCGI installs:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

And to check it’s working properly, create a webpage.php and paste within this code:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

.. now surf to that page and F3 search the page for your XCache variables.

Rescind Super-User Permissions

Abandon root access:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Thassit.

Setup Unmanaged VPS: The Ubuntu-Nginx Guide

Take your virtual private server from zero to hero

with this easy-to-follow copy/paste guide.

“My local PC runs Windows” Show me for Linux/Mac

22+ parts with video, here’s the index ..

Manage Unmanaged VPS: Ubuntu-Nginx Administration

Already set it up? We’d best maintain it then.

Toggle to the ..  Ubuntu-Nginx Admin Index

Manage Unmanaged VPS: Ubuntu-Nginx Administration

Maintain your virtual private server with ..

.. cheatsheets, tutorials, tips & guides.

Head back to the ..  Ubuntu-Nginx Installation Index

Nginx Admin: In the Works ..

This lot’s marked for addition already:-

  • Setup or Edit DNS using Bind
  • Network Tools Troubleshooting Guide
  • The Comprehensive Permissions Guide
  • Configuring Nginx Rewrites
  • Custom Website Error Page
  • Setting up Cron Jobs
  • Rsync for Incremental Remote-to-Local Backup
  • Cron & Rsync for Automatic Backup
  • Cron & mysqldump for Auto DB Backup
  • Safeguard Bandwidth with Hotlink Protection
  • Block Access with Nginx’ IP Deny



Got a Question? Want to Comment?

This site has no comments system. We've got a better system!

Please use the link at the top of the post and goto this topic's forum thread:-

  • to help build community
  • for a superior knowledge base
  • to keep info in one place, not diluted between forum & comments.

For those posts ported from Guvnr.com (pre-Feb/2010), archive comments remain.

Handy info from these comments is in the process of being ported to the forum and attributed to the original author.

If you think this idea sucks, let me know.

Thank you.