| |||||||
This is a discussion on Installing and Tuning XCache within the Server Administration section, part of the Web Design/Development and SEO category; As we all know, XCache is a popular open-source PHP Accelaration system on servers. It optimizes performance greatly, reduces page ...
![]() |
| | LinkBack (1) | Thread Tools | Display Modes |
#1
| ||||
| ||||
|
As we all know, XCache is a popular open-source PHP Accelaration system on servers. It optimizes performance greatly, reduces page generation time and server load. Below is the exact process I follow to setup XCache on my server. Its really easy and hardly takes more than 3-4 minutes. We will be installing XCache from source. 1. First, login as root user and browse to some directory where you'll keep your XCache files. cd /usr/src 2. Download the latest release from the official site. The latest release currently is 1.2.2. You should check out at the site to see if there is a new version available. wget http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz 3. Downloaded, now unpacking the archive. tar -zxf xcache-*.tar.gz 4. Moving to extracted XCache directory. cd xcache-* 5. Generating configure, everytime you upgrade php, or update to a new XCache, you have to run phpize again phpize 6. Run configure and enable XCache ./configure --enable-xcache 7. Much output here. make 8. Switching to root, if not already. su 9. [Important] Note the path where the module is installed. In my case its - /usr/lib/php/modules/ make install 10. [Optional] Run this command if you want to use default XCache settings. This command will automatically append default XCache settings to php.ini cat xcache.ini >> /etc/php.ini 11. In case you want to setup your own settings, simply edit /etc/php.ini and add XCache settings at the end. vi /etc/php.ini (make sure zend_extension = /../../xcache.so is the first before any other zend_extension=***) Here's an optimal xCache settings (Replace the blue part with the actual path where the module is installed, as mentioned in step 9):- Code: [xcache-common] zend_extension = /usr/lib/php/modules/xcache.so ; required for >=php5.1 if you turn XCache on auto_globals_jit = Off [xcache.admin] xcache.admin.enable_auth = On xcache.admin.user = "username" xcache.admin.pass = "md5 of your password" [xcache] xcache.shm_scheme = "mmap" xcache.size = 32M xcache.count = 2 xcache.slots = 8K xcache.ttl = 7200 xcache.gc_interval = 300 xcache.var_size = 3M xcache.var_count = 1 xcache.var_slots = 8K xcache.var_ttl = 7200 xcache.var_maxttl = 14400 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 = On [xcache.coverager] xcache.coverager = Off xcache.coveragedump_directory = "" a) xcache.admin.enable_auth - Switch admin authentication On/Off (Keep it On) b) xcache.admin.user - Provide an admin username here. c) xcache.admin.pass - Provide a password in MD5 format here. The rest of the settings are quite optimal for a descent VPS/dedicated, though you can edit them if necessary (depends on your hardware). Visit the official XCache site for more information.
__________________ Would you like to Link To Us | Support TECH6 by going Premium Know more about me at Vinayaks.com | Follow TECH6 at Twitter |
|
#2
| ||||
| ||||
|
XCache Administration Page (referenced as admin-page) is an important web interface that you can monitor and operate your opcode cache, seeing how well (or bad) it goes. Before you can use admin-page, XCache must be installed as either extension or zend_extension in php. Admin-page is protected by http-auth, it is disabled if you haven't yet set a password. The user/pass of http-auth can be set in php.ini (as described in point 12.) Setting up web interface- The fastest and simplest way to do so is copying your xcache/admin/ (the whole directory) to your web document-root or sub-directory of it. cp -a /usr/src/xcache*/admin /home/username/public_html/xcache-admin Request it from your browser, a http-auth prompt will popup. Enter your user/pass, and done. You might want to reboot to ensure everything is setup fine.
__________________ Would you like to Link To Us | Support TECH6 by going Premium Know more about me at Vinayaks.com | Follow TECH6 at Twitter |
|
#3
| ||||
| ||||
|
Atlast, a check if we have installed XCache successfully. 1. Run the following command. It should display PHP alongwith installed XCache version i.e. 1.2.2 in our case. php -v 2. Also view your PHPInfo and check if all your XCache settings display. You can simply do so by uploading a PHP file with the following code and run it from the browser:- PHP Code:
__________________ Would you like to Link To Us | Support TECH6 by going Premium Know more about me at Vinayaks.com | Follow TECH6 at Twitter |
|
#4
| ||||
| ||||
|
Very cool. I have heard a lot about PHP accelarators/caching system and all. I think XCache is quite popular among others. Will surely give this a try on my VPS. |
|
#5
| ||||
| ||||
|
For any dynamic website, some or the other cache system like APC, XCache, eAccelarator is quite necessary as it significantly reduces server load and optimizes performance. FYI, APC is going to be included in the core of PHP 6. So, I'd recommend now using APC as PHP accelerator on your servers. |
|
#6
| ||||
| ||||
| Thats a wonderful news. Then I guess I should drop XCache and install APC only, so that I get used to it.
|
|
#7
| ||||
| ||||
|
Nice guide WebWizzy, I ran into a few snaps along the way, but like with all great Linux installs comes all great Linux problems I'll try my hand at fixing them at a later time.
|
|
#8
| ||||
| ||||
| FYI, XCache has been my favorite caching systems due to its ease of install and popularity. BUT you might be knowing that APC is going to be included in core of PHP6. So IMHO, it would be wise to make the switch now.
__________________ Would you like to Link To Us | Support TECH6 by going Premium Know more about me at Vinayaks.com | Follow TECH6 at Twitter |
![]() |
| Bookmarks |
| Tags |
| xcache |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://tech6.com/f66/installing-tuning-xcache-t751/ | ||||
| Posted By | For | Type | Date | |
| Yum Repository for RHEL & CentOS with newest versions of LAMP software? - vBulletin Community Forum | This thread | Refback | 14-04-2009 11:24 PM | |