I have installed xcache with easyapache and want to access the xcache admin end. <snip> Locating the admin directory gives this result:
/home/cpeasyapache/src/xcache/xcache-2.0.1/admin/ - is that correct?
We do not install the Xcache administrative components by default. This is to limit potential exposure of sensitive information, and because the vast majority of our customers never use that interface. Customers typically setup Xcache once and then move on to other items. However, we do leave the source files in /home/cpeasyapache/ as you've noted, in case you would like to install the admin interface yourself.
2. Where exactly should I move it to?
You may move it to any location you prefer. I would not use /admin/
as the folder name, as that's typically scanned by many exploit kits because it's used for so many products. Instead, put the files in a uniquely-named folder.
When choosing a password for the interface, be creative, and use something unique here as well (don't re-use passwords).
Any information of how to do it would be further appreciated
No problem. All of this information is fully covered in detail, within the Xcache Documentation
, but here's a quick rundown.
For the purpose of this example, say:
- your cPanel account username will be whatever
- your domain is whatever.com
- the Xcache management user will be bananas
- the Xcache management pass will be FluffyClouds618
Then the following is an example of how to set that up:
1. Create the necessary folders, copy the files in place, and set proper permissions
2. Get the md5 of the password you want to use.
cp /home/cpeasyapache/src/xcache/xcache-*/admin/* /home/whatever/public_html/xcache-view/
chown -R whatever.whatever /home/whatever/public_html/xcache-view
3. Update php.ini with your chosen user/password for the Xcache page
Xcache comes with a page to do just that, or you could use the php md5() function, or any other md5 utility here. But, assuming we put the Xcache administrative utilities under our example domain, we would simply visit:
Or if we called PHP directly:
php -r 'print "xcache.admin.pass=" . md5(FluffyClouds618
) . "\n";'
So in our example, the resulting hash is: 3ca6c8bfa71fd980fc874386d722e7ce
4. Test your page
# back up your ini before making changes
cp /usr/local/lib/php.ini /usr/local/lib/php.ini.`date`
# update the following settings in /usr/local/lib/php.ini:
3. Xcache doesn't show up when doing php -v. But in phpinfo it's there. Is that a problem?
No, this is by design. To address any other concerns:
Xcache authentication will not work with CGI or FastCGI. This is not an issue unique to Xcache; it is a limitation of PHP in CGI mode, as the PHP_AUTH variables are not available. In that case, one solution would be to:
Alternatively, if you have a specific need to do so, you may override default Xcache behavior, and implement your own authentication mechanism
Finally, we do not modify the default settings for Xcache, and this is intentional. This is because each server is unique, and what works very well for customer A would not work for customer B. Each site/server has different needs depending on a wide variety of factors. Some examples:
How many domains are on the server?
Lots of domains may mean lots of files, and a potential need to increase xcache.slots and xcache.size. However, you may have a large number of domains but relatively few PHP files overall, which would mean increasing those values would effectively waste memory.
How much memory does the server have (and how much do you want to use for Xcache?)
Do you want to allocate a (relatively) large amount of memory to Xcache so you can cache "everything", or do you just want to cache the most active PHP pages and save the remaining memory for other services you consider more critical, like MySQL or Exim?
How often do pages change in the cache?
Does your server consist of just a few "heavy", high-traffic websites and a lot of little websites with relatively no traffic? If so, you may just need a small amount of memory for xcache with a large xcache.ttl and xcache.gc_interval. Are your site traffic patterns extremely random? Maybe reducing the TTL or increasing the cache size would help, at the cost of more memory (or a higher swap-out of pages).
All of these decisions depend on traffic patterns, the hardware of your system, and your personal goals for Xcache use. cPanel runs on a wide range of hardware (from almost no memory to a very large amount, from 1 CPU to 8-core and higher) and your client needs can vary widely, so -- similar to mysql tuning -- rather than guessing your needs, it's best if tuning the config is done by a well-informed administrator after careful observation of system use. While we are happy to help you with technical issues via the support system(s) here at cPanel, I recommend reading the Xcache php.ini directives page
for an overview of each setting, and then using the Xcache users
mailing list as another resource. Thanks!