try another color scheme:


Go Back   TECH6.0 > Web Design/Development and SEO > Server Administration


Installing and Tuning XCache

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 ...

Reply
 
LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1  
Old 10-04-2009, 12:06 PM
webwizzy's Avatar

Administrator
 
Name: Vinayak
Join Date: Feb 2008
Location: India
Phone: Samsung Wave
Posts: 1,116
webwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nice
Send a message via Yahoo to webwizzy
Icon12 Installing and Tuning XCache

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   = ""
12. Some settings to configure if you like:-

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.
__________________
Always TAG and SHARE your threads
Submit your site to TECH6 Directory
TECH6 on Facebook - Like Us

Would you like to Link To Us | Support TECH6 by going Premium
Know more about me at Vinayaks.com | Follow TECH6 at Twitter


Reply With Quote
  #2  
Old 10-04-2009, 12:11 PM
webwizzy's Avatar

Administrator
 
Name: Vinayak
Join Date: Feb 2008
Location: India
Phone: Samsung Wave
Posts: 1,116
webwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nice
Send a message via Yahoo to webwizzy
Default XCache Administration

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.
__________________
Always TAG and SHARE your threads
Submit your site to TECH6 Directory
TECH6 on Facebook - Like Us

Would you like to Link To Us | Support TECH6 by going Premium
Know more about me at Vinayaks.com | Follow TECH6 at Twitter


Reply With Quote
  #3  
Old 10-04-2009, 12:19 PM
webwizzy's Avatar

Administrator
 
Name: Vinayak
Join Date: Feb 2008
Location: India
Phone: Samsung Wave
Posts: 1,116
webwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nice
Send a message via Yahoo to webwizzy
Default Verify if XCache is installed successfully

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:
<?php
phpinfo
();
?>
__________________
Always TAG and SHARE your threads
Submit your site to TECH6 Directory
TECH6 on Facebook - Like Us

Would you like to Link To Us | Support TECH6 by going Premium
Know more about me at Vinayaks.com | Follow TECH6 at Twitter


Reply With Quote
  #4  
Old 13-05-2009, 07:38 PM
Bryan's Avatar

I love to Rock 'n' Roll
 
Name: Bryan
Join Date: May 2009
Location: Spain
Phone: Nokia N97
Posts: 119
Bryan is on a distinguished road
Default

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.
Reply With Quote
  #5  
Old 17-09-2009, 09:03 AM
Shocker's Avatar

Techie
 
Join Date: Sep 2009
Posts: 48
Shocker is on a distinguished road
Default

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.
Reply With Quote
  #6  
Old 05-10-2009, 10:40 AM
Bryan's Avatar

I love to Rock 'n' Roll
 
Name: Bryan
Join Date: May 2009
Location: Spain
Phone: Nokia N97
Posts: 119
Bryan is on a distinguished road
Default

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.
As Said by Shocker View Post
Thats a wonderful news. Then I guess I should drop XCache and install APC only, so that I get used to it.
Reply With Quote
  #7  
Old 18-10-2009, 02:41 AM
eL3's Avatar
eL3 eL3 is offline

Learner
 
Join Date: Oct 2009
Posts: 29
eL3 is on a distinguished road
Default

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.
Reply With Quote
  #8  
Old 18-10-2009, 02:55 PM
webwizzy's Avatar

Administrator
 
Name: Vinayak
Join Date: Feb 2008
Location: India
Phone: Samsung Wave
Posts: 1,116
webwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nice
Send a message via Yahoo to webwizzy
Default

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.
As Said by eL3 View Post
Glad you like it man. And btw do not forget to change the source path in step 2. The latest build is 1.3.0 which is compatible with PHP 5.3.0.

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.
__________________
Always TAG and SHARE your threads
Submit your site to TECH6 Directory
TECH6 on Facebook - Like Us

Would you like to Link To Us | Support TECH6 by going Premium
Know more about me at Vinayaks.com | Follow TECH6 at Twitter


Reply With Quote
  #9  
Old 09-09-2010, 03:37 PM
No Avatar

Learner
 
Join Date: Sep 2010
Posts: 9
thomas james is on a distinguished road
Default

That's awesome post, i am actually search this stuff for the last three months but finally i got it .i really thankful to the admin ,forum and all respectful members of this platform who were really adorable.thanks
Reply With Quote
  #10  
Old 09-11-2010, 04:23 AM
No Avatar

Learner
 
Join Date: Nov 2010
Posts: 9
v123shine is on a distinguished road
Default

Dear Webwizzy

I get this error:

Code:
Failed loading /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so:  /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so: cannot open shared object file: No such file or directory
Failed loading /usr/lib64/php/modules/xcache.so:  /usr/lib64/php/modules/xcache.so: cannot open shared object file: No such file or directory
PHP 5.1.6 (cli) (built: Mar 31 2010 02:39:17)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
    with the ionCube PHP Loader v3.1.28, Copyright (c) 2002-2007, by ionCube Ltd.
Can you tell to me how to remove xcache in centos 5.5 ??

Last edited by v123shine; 09-11-2010 at 04:32 AM.
Reply With Quote
Reply

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 10:24 PM



All times are GMT +5.5. The time now is 02:01 AM.

Contact Us - Tech6.com - Link to Us - Advertise - Submit Site - Privacy Statement - TOS - Top