Memcached Tutorial | How To Install and Secure Memcached on Ubuntu 18.04

Опубликовано: 17 Февраль 2025
на канале: Explained Easy
814
11

Memcached Tutorial | How To Install and Secure Memcached on Ubuntu 18.04

In this memcached introduction tutorial, we cover how to install and secure Memcached server by configuring it to bind to your local or private network interface and by enabling SASL authentication.

0:00:00 - Intro
0:01:25 - Prerequisites
0:02:03 - Step 1 — Installing Memcached from the Official Repositories
0:03:52 - Step 2 — Securing Memcached Configuration Settings
0:06:56 - Step 3 — Adding Authorized Users
0:15:18 - Step 4 — Allowing Access Over the Private Network (Optional)
0:19:28 - Conclusion


Commands:


sudo apt update
sudo apt install memcached
sudo apt install libmemcached-tools
sudo nano /etc/memcached.conf
. . .
-l 127.0.0.1
. . .
. . .
-U 0
sudo systemctl restart memcached
sudo netstat -plunt
memcstat --servers="127.0.0.1"
sudo nano /etc/memcached.conf
. . .
-S
. . .
-vv
sudo systemctl restart memcached
sudo journalctl -u memcached
memcstat --servers="127.0.0.1"
echo $?
sudo apt install sasl2-bin
sudo mkdir /etc/sasl2
sudo nano /etc/sasl2/memcached.conf
mech_list: plain
log_level: 5
sasldb_path: /etc/sasl2/memcached-sasldb2
sudo saslpasswd2 -a memcached -c -f /etc/sasl2/memcached-sasldb2 sammy
sudo chown memcache:memcache /etc/sasl2/memcached-sasldb2
sudo systemctl restart memcached
sudo ufw allow from client_server_private_IP/32 to any port 11211
sudo nano /etc/memcached.conf
. . .
-l memcached_server_private_IP
. . .
sudo systemctl restart memcached
sudo netstat -plunt

#memcached #ubuntu #linux