Install redis service and configuration on ubuntu

1. Installation
– online installation, after the installation is complete, the service will be started by default

sudo apt-get install redis-server

insert image description here– Installation package download and installation

#下载安装包,版本自选
wget http://download.redis.io/releases/redis-5.0.5.tar.gz

#解压安装包
tar xzf redis-5.0.5.tar.gz
#进入文件目录

sudo make MALLOC=libc
sudo make test

2. Configuration

#以下为默认安装位置,手动安装时修改前置路径
vim /etc/redis/redis.conf

# 设置密码
#requirepass foobared 行下新增,设置新密码 (510行左右)
requirepass mypassword

# 允许远程连接
#找到  bind 127.0.0.1 ::1  注释 (70行左右)

# 修改端口 
#默认端口 #port 6379 (90行左右)

#修改完成后,重启服务
service redis restart

Guess you like

Origin blog.csdn.net/qq_42049516/article/details/122574904