How to Install Memcached on cPanel/WHM server

In cPanel 11.88 Memcached is now available in the EasyApache4 yum repo.

This tutorial installs Memcache as a service on port 11211. This works for a single site, but Memcached has no auth service on this set up so it is not appropriate for multiple separate users. Instead use a Memcached socket, which is not covered here.

To install, run the following command:

yum -y install ea-php*-php-memcached

Enable the service:

systemctl enable memcached.service

Edit the config file:

/etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS=""

Change options to listen locally

OPTIONS="-l 127.0.0.1"

Start Memcached:

systemctl start memcached.service

You can now verify with lsof:

lsof -i :11211
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
memcached 17880 memcached 26u IPv4 2040097288 0t0 TCP localhost:memcache (LISTEN)
memcached 17880 memcached 27u IPv4 2040097289 0t0 UDP localhost:memcache

Memcached is now installed and started.

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

Domain names are not showing in WHM

We were unable to see any domains listed under WHM -> List Accounts. However, we can see the...

How to Start/Stop or Restart Apache server

Apache is the HTTP server that is freely available over the internet. It is a kind of software or...

How to install Attracta SEO Tools plugin

RequirementscPanel/WHM needs to be installed on your server. Step 1: SSH into your server and go...

How to Install CpCleaner in cPanel through SSH?

Installation Run the following shell commands as root via SSH: wget -O cpc-1.0.3.tar...

How to Secure a cPanel/WHM Web Server

Here are a few basic steps that you should keep in mind for keeping a server secure. 1) Strong...