码迷,mamicode.com
首页 > 其他好文 > 详细

Redis环境安装

时间:2017-09-02 23:20:23      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:修改   res   允许   安全   image   conf   取消   环境安装   art   

第一步,apt-get 安装,

 技术分享

 安装完毕后Redis会自动启动

 第二步、检查Redis系统进程

 技术分享

通过启动命令检查Redis服务器状态

netstat -nlt|grep 6379

技术分享

 

 

 

第三步、修改配置文件redis.conf(访问密码,缓存策略等)

默认情况下,访问Redis服务器是不需要密码的,为了增加安全性我们需要设置Redis服务器的访问密码。设置访问密码为redisredis。
打开Redis服务器的配置文件redis.conf
sudo vim /etc/redis/redis.conf

  

#取消注释requirepass
requirepass redisredis
登陆Redis服务器,输入密码
redis-cli -a redisredis

第四步
、让Redis服务器被远程访问

默认情况下,Redis服务器不允许远程访问,只允许本机访问,所以我们需要设置打开远程访问的功能。

打开Redis服务器的配置文件redis.conf

sudo vim /etc/redis/redis.conf

  

#注释bind
#bind 127.0.0.1

 

修改后,重启Redis服务器。
sudo service redis-server restart

  

 

Redis环境安装

标签:修改   res   允许   安全   image   conf   取消   环境安装   art   

原文地址:http://www.cnblogs.com/song-wentao/p/7468209.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!