Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install Memcached on CentOS 8 - DesignLinux

Jul 29 2020
designlinux 0 Comments
How to Install Memcached on CentOS 8

Memcached is an open-source, free and high-performance in-memory caching system. Generally, it’s used to speed up web applications by caching large volumes of data in memory from page load requests or API calls. This article explains how to install and configure Memcached on CentOS 8.

Install Memcached on CentOS#

The standard CentOS 8 repositories includes the Memcached package. Installation is straightforward, just follow the below steps to install and configure Memcached on your CentOS 8 machine.

Step 1 – Installing Memcached#

Run the following command as root or user with sudo privileges:

sudo dnf install memcached libmemcached

Once the installation is complete, enable and start the Memcached service by typing:

sudo systemctl enable memcached --now

Step 2 – Verify Installation#

After the completion of installation and enable the Memcached service, you can check the status for the service by typing:

sudo systemctl status memcached

It should show output something like this:

● memcached.service - memcached daemon
   Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2020-07-19 10:12:52 UTC; 29s ago

Step 3 – Configure Memcached#

By default, Memcached is set to listen only on localhost. Edit the /etc/sysconfig/memcached.conf file to configure the Memcached options. Generally, the default configuration settings are sufficient for most users.

Step 4 – Remote Access#

It is always recommended, do not allow remote access. It’s always risk of a distributed denial-of-service (DDoS) attack if the Memcached is configured improper. To allow remote access to the Memcached server, you need to configure the firewall and open the Memcached UDP port 11211 only from trusted clients.

For example, if you want to connect to the Memcached server over a private network, and the Memcached server IP is 192.168.93.125, and the client’s IP address is 192.168.123.32.

At first, you should edit the /etc/sysconfig/memcached.conf file and set the service to listen on the server’s private networking interface:

sudo nano /etc/sysconfig/memcached.conf

Find the line which starts with -l 127.0.0.1 and replace 127.0.0.1 with the server IP address 192.168.93.125.

OPTIONS="-l 192.168.93.125"

Restart the Memcached service for the changes to take effect:

sudo systemctl restart memcached

Now, open the Memcached port in the firewall:

sudo firewall-cmd --new-zone=memcached --permanent
sudo firewall-cmd --zone=memcached --add-port=11211/udp --permanent
sudo firewall-cmd --zone=memcached --add-port=11211/tcp --permanent
sudo firewall-cmd --zone=memcached --add-source=192.168.123.32/32 --permanent
sudo firewall-cmd --reload

Conclusion#

We hope you learned successfully how to install Memcached on CentOS 8. Visit Memcached Wiki to know more about Memcached.

If you have any questions or feedback, please leave a comment below.

Related

Tags: centos, memcached

How to Install TensorFlow on Debian 10

Prev Post

Bash: Append to File

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 259
  • 614,631

DesignLinux.com © All rights reserved

Go to mobile version