Windows安装Redis、配置密码、远程访问和自启动

2018-11-13 10:32
8826
31824

突然发现西部数码云服务器(Windows server 2008)停机了,说是安全问题,并且无法启动。提交工单后反馈才知道是redis没有设置密码,并且“protected-mode”,存在严重的安全隐患,所以给停机了。

下面主要说下redis安装配置的步骤:

1.安装环境

      安装环境为Windows10和Windows server 2008;

2.下载redis

      redis官方没有Windows版本的redis,需要到GitHub去下载,下载地址为: 快速传送

3.解压安装包

       解压后文件目录如下:

4.修改配置文件

        redis 3.2具有保护模式(protected-mode),为了服务器安全,不建议关闭保护模式(protected-mode = no);

        如果只是本机访问,那么把bind设置为127.0.0.1就可以;如果需要远程访问,则需要设置密码,requirepass  password(你的密码);

        本人需要远程访问,所以配置文件“redis.windows-service.conf”(注意不要选错哟)修改如下:

5.注册服务

        为了不每次启动redis都要开启个黑框口,误关后redis就停止了,要注册redis服务,让redis后台运行。

a.使用管理员命令进入redis解压目录:

b.使用命令“redis-server --service-install redis.windows-service.conf --loglevel verbose”注册服务:

c.使用“redis-server --service-start”启动服务 :

d.redis的其他命令:

卸载服务:redis-server --service-uninstall

停止服务:redis-server --service-stop

6.配置环境变量

        为了不每次启动redis都需要进到redis的安装目录才能执行命令,我们需要配置redis的环境变量,步骤如下:

       右键桌面“我的电脑”——>“属性”——>“高级系统设置”——>“环境变量”:添加变量“REDIS_HOME=D:\Redis-x64-3.2.100”,然后再path变量后加上“;%REDIS_HOME%”就好,这样使用管理员进入命令窗口就可以执行redis命令了,如下图:

7.设置开机启动

        需要设置开机启动的童鞋可以看这里,win+r快捷键,输入services.msc回车打开服务窗口:

       找到redis服务,双击将启动类型改为自动,如下:

至此,Windows安装redis 3.2已经完成!

全部评论

2020-10-25 10:53:25.0
Recorded Delivery <a href="http://urbanmission.co.uk/ginseng-aj-cena">ginseng kg fiyat</a> Gas as a transport fuel is sometimes portrayed as a cottageindustry, but the truth is rather different
2020-10-25 10:53:25.0
Who would I report to? <a href="http://www.onedirection.co.uk/promethazine-dm-medscape">promethazine marijuana</a> The description states: "This listing is for a complete, excellent /near mint, sealed copy of the game and one of few to ever be sent to the Video Game Authority in Roswell, Georgia for official grading, verification and authentication.
2020-10-25 10:53:24.0
Until August <a href="http://userinterfaceicons.com/valtrex-price-ireland">(zovirax) famciclovir (famvir) and valacyclovir (valtrex)</a> Beijing has struggled to incentivize local governments and Chinese companies to step up their pollution-fighting efforts
2020-10-25 10:53:24.0
Where do you come from? <a href="http://stressmanagementarticles.com/visual-field-testing-for-plaquenil-toxicity.html">plaquenil pregnancy side effects</a> Even the Episcopal church has been paying for protestor lodging, food and drink in Ferguson; they declared the police to be guilty and punishable weeks ago
2020-10-25 10:53:23.0
Could you ask him to call me? <a href="http://drandrewbrown.co.uk/tricor-malaysia-lowyat.html">withdrawal from tricor</a> The idea of playing in New York appeals greatly to the 6-4, 305-pound Suh, the report says
2020-10-25 10:31:15.0
What university do you go to? <a href="http://www.motorhomescotland.co.uk/hydrochlorothiazide-cvs-recall.html">lisinopril hctz dosage 20 25</a> Other officers occasionally pushed back the protesters, many of whom raised their arms to show their peaceful intent
2020-10-25 10:31:14.0
I'll send you a text <a href="http://alternativemedicinesreview.com/cataflam-for-sale.html">cataflam diclofenac potassium</a> Musical highlights this year include urban vocalist Kele le Roc, Hispanic-influenced DJ and producer Quantic and talented young songwriter Chaz Thorogood.
2020-10-25 10:31:14.0
I've just started at <a href="http://homelinesport.co.il/product.php?prod=curvimax-information">online vimax</a> "Activity trends are being underpinned by substantial increases in new business flows, with companies attributing the latest expansion to general improvements in the construction market and stronger economic confidence," commented Ulster Bank&#39;s chief economist Simon Barry.
2020-10-25 10:31:13.0
What's the current interest rate for personal loans? <a href="http://zhidan.org/imipramine-half-life">tofranil 50 mg preã§o</a> Analysts had expected the revision for productivity would be weaker than the first estimate, reflecting the fact that the government last week revised its estimate for economic growth, as measured by the gross domestic product.
2020-10-25 10:31:13.0
I'd like to transfer some money to this account <a href="http://kbtlund.se/cheapest-family-vacations-in-california">family cruises deals 2018</a> The department also released a report Wednesday that charged Ferguson's police department with routine racial discrimination.