How to install redis on linux?
linux installation steps:
Recommended: "Linux Video Tutorial"
1. Obtain redis resources
wget http://download.redis.io/releases/redis-4.0.8.tar.gz
2. Unzip
tar xzvf redis-4.0.8.tar.gz
3. Install
cd redis-4.0.8 make cd src make install PREFIX=/usr/local/redis
4. Move the configuration file to the installation directory
cd ../ mkdir /usr/local/redis/etc mv redis.conf /usr/local/redis/etc
5. Configure redis to start in the background
vi /usr/local/redis/etc/redis.conf //将daemonize no 改成daemonize yes
6. Add redis to boot
vi /etc/rc.local //Add content in it: /usr/local/redis/ bin/redis-server /usr/local/redis/etc/redis.conf (meaning to call this command to start redis at boot)
7. Turn on redis
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
Commonly used commands
redis-server /usr/local/redis/etc/redis.conf //启动redis pkill redis //停止redis
Uninstall redis:
rm -rf /usr/local/redis //删除安装目录 rm -rf /usr/bin/redis-* //删除所有redis相关命令脚本 rm -rf /root/download/redis-4.0.4 //删除redis解压文件夹
For more redis-related knowledge, please visit the redis usage tutorial column!
The above is the detailed content of How to install redis on linux. For more information, please follow other related articles on the PHP Chinese website!