909422229_在windows上安装redis并设置密码,IP绑定【提供安装包】
来源:互联网 发布:高拱 知乎 编辑:程序博客网 时间:2024/06/12 10:47
先说废话。
Redis 是一个开源,先进的存储,并用于构建高性能,可扩展的 Web 应用程序的完美解决方案。
Redis 从它的许多竞争继承来的三个主要特点:
- Redis 数据库完全在内存中,使用磁盘仅用于持久性。
- 相比许多键值数据存储, Redis 拥有一套较为丰富的数据类型。
- Redis 可以将数据复制到任意数量的从服务器。
一、下载及安装Redis
首先下载,下载方式:
- 从 github 下载:https://github.com/MSOpenTech/redis/releases
- 从本站国内 CDN 节点下载:本文下方【附件】下载即可。
github Windows 版本下载
下载后的文件为:Redis-x64-2.8.2400.zip
,然后解压缩后如下图:
二、设置密码
上次我们出现过一次大规模的Redis安全事件,给我们敲响了警钟,因为我们好多项目都是图方便,很少设置密码,而Redis的默认配置又是没有密码,导致基本都是没有设置密码。
Redis设置密码有2个办法。
1.修改配置文件。
在刚刚解压的目录下,我们能够找到文件名为:redis.windows-service.conf
打开后用Ctrl + F
查找:requirepass
################################## SECURITY ###################################
# Require clients to issue AUTH before processing any other
# commands. This might be useful in environments in which you do not trust
# others with access to the host running redis-server.
#
# This should stay commented out for backward compatibility and because most
# people do not need auth (e.g. they run their own servers).
#
# Warning: since Redis is pretty fast an outside user can try up to
# 150k passwords per second against a good box. This means that you should
# use a very strong password otherwise it will be very easy to break.
requirepass <你的密码>
# Command renaming.
#
# It is possible to change the name of dangerous commands in a shared
# environment. For instance the CONFIG command may be renamed into something
# hard to guess so that it will still be available for internal-use tools
# but not available for general clients.
#
# Example:
#
# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52
#
# It is also possible to completely kill a command by renaming it into
# an empty string:
#
# rename-command CONFIG ""
#
# Please note that changing the name of commands that are logged into the
# AOF file or transmitted to slaves may cause problems.
比如我把密码设置为:asdfklfjfasdklfjasdklfjweruoweri。
那么就修改成这样:
requirepass asdfklfjfasdklfjasdklfjweruoweri
然后重启即可。
2.配置临时密码。
也就是启动后在控制台redis-cli.exe
配置,但这种极其不推荐。所以也不说了。
PS:密码尽量设置复杂一点。
3.IP绑定
Ip绑定还是在redis.windows-service.conf
配置文件里。
Ctrl + F
搜索127.0.0.1
能找到如下所示:
# By default Redis listens for connections from all the network interfaces
# available on the server. It is possible to listen to just one or multiple
# interfaces using the "bind" configuration directive, followed by one or
# more IP addresses.
#
# Examples:
#
# bind 192.168.1.100 10.0.0.1
# bind 127.0.0.1
支持这2种 IP 绑定,我们一般就绑定内网,默认是内网外网都可以访问。所以我们从安全的角度考虑,如果是本机使用就绑定 127.0.0.1 ,如果是局域网内使用请绑定本地 IP ,如:192.168.0.8
等。
如果本文对你有帮助,那么请你赞助我,让我更有激情的写下去,帮助更多的人。
阅读全文
1 0
- 909422229_在windows上安装redis并设置密码,IP绑定【提供安装包】
- 在windows上安装redis并设置密码,IP绑定【提供安装包】
- 在windows上安装Redis并设置密码
- Redis安装并设置密码
- Redis在linux上的安装和设置密码
- 在windows上安装redis
- 在Windows上安装Redis
- 在Windows上安装redis
- Redis安装成windows服务-密码设置
- redis 安装启动及设置密码<windows>
- Windows下安装并设置Redis
- Windows下安装并设置Redis(转)
- Windows下安装并设置Redis
- Windows下安装并设置Redis
- Windows下安装并设置Redis
- Windows下安装并设置Redis
- Windows下安装并设置Redis
- Windows下安装并设置Redis
- 关于微信第三方登录 AppId 和AppSecret 忘记修改无法登录问题
- caffe加层问题记录
- WPS国际版添加中文包
- static变量与实例变量 java
- C#中ArrayList.ToArray()用法
- 909422229_在windows上安装redis并设置密码,IP绑定【提供安装包】
- asp.net response.ContentType 下载文件的四种方法
- 使用 Intellij IDEA 与 Gradle 构建Spring项目
- xfire客户端调用服务端报错 XFireRuntimeException: Could not invoke service.. Server returned error code = 4ji
- Apache ActiveMQ实战(1)-基本安装配置与消息类型
- MySQL之删除慢查询日志
- eclipse安装sonarLint插件
- Python3.6 安装Flask 模块
- desktop位置不可用,桌面文件丢失,重启无效