Freehosting.host Help
As easy as 1, 2, FREE!
  • Home
  • Self Help
  • FAQ
  • Main website

Memcached access

Table of content

  1. Introduction
  2. Create a cron job to start the memcached
  3. How to use memcached with unix socket?
    1. How can I see my value of “REPLACE-YOUR-USER-HERE”?
  4. Why I cant access memcached at default URL?

Introduction

What is memcached? Learn here!

You can have a dedicated memcached at your hosting account for your websites cache and other special needs.

The memcached will be a private daemon, and accessed through linux socket, so no others users will have access to your data.

You need a paid hosting plan to have access to this resources.

 

Create a cron job to start the memcached

 

Just insert this line at your cronjobs, inside cPanel, to run at every minute:

/usr/local/cpanel/3rdparty/bin/dmcached.sh >/dev/null 2>&1

 

To verify the statistics of your memcached, run this at your shell (ssh):

# /usr/local/cpanel/3rdparty/bin/dmcached.sh stats

 

The default memcached has 32MB of memory, if you need more, just add the memory parameter like this:

/usr/local/cpanel/3rdparty/bin/dmcached.sh 64 >/dev/null 2>&1

 

And stop the actual daemon, so the cron can start the new one with the new memory. At shell:

# /usr/local/cpanel/3rdparty/bin/dmcached.sh stop

 

How to use memcached with unix socket?

It is basicaly the same of network access, with other URL.

The URL will be:

unix:///home/REPLACE-YOUR-USER-HERE/.memcache/memcached.sock:0

At port, use:

0

 

For example, here is how to enable memcached at mediawiki LocalSettings.php:

// MEMCACHED
$wgMainCacheType = CACHE_MEMCACHED;
$wgParserCacheType = CACHE_MEMCACHED; # optional
$wgMessageCacheType = CACHE_MEMCACHED; # optional
$wgMemCachedServers = array("unix:///home/REPLACE-YOUR-USER-HERE/.memcache/memcached.sock:0");

$wgSessionsInObjectCache = true; # optional
$wgSessionCacheType = CACHE_MEMCACHED; # optional

 

How can I see my value of “REPLACE-YOUR-USER-HERE”?

At shell login (ssh) just enter: # pwd , and you will see /home/YOUR-USER-HERE

 

Why I cant access memcached at default URL?

The URL 127.0.0.1:11211 is insecure if used at shared hosting, because all users can read and write at same memcached servers and data.
Here you have a very secure solution: unix socket inside cloudLinux with cageFS.

 CPanel, Hosting    Memcached

Related Knowledge Base Posts -

  • Changing cPanel password
  • Addon Domains
  • cPanel useful links

Login

Register| Forgot Password?

Search Self Help

 

Categories

  •  cPanel (6)
  •  Domains (5)
  •  Emails (9)
  •  General (1)
  •  Hosting (22)
  •  My account (0)

Search All

  • Freehosting
  • Email On Demand
  • Client Area
  • Help Tickets
  • Contact
  • Terms
© FreeHosting 2017
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.Accept Read More
Privacy & Cookies Policy
Necessary Always Enabled