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

2018-11-13 10:32
11129
31825

突然发现西部数码云服务器(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 06:49:00.0
No, I'm not particularly sporty <a href="http://streetphoto.dk/himalaya-speman-cena">buy speman tablets</a> Tsipras' left-wing party argues that austerity has been counterproductive but agreed a month ago to push through reforms in exchange for keeping European Union aid flowing
2020-10-25 06:27:31.0
What sort of music do you listen to? <a href="http://www.coachhiredirectory.co.uk/innopran-xl-manufacturer/">innopran generic</a> Health officials on Monday will ask the Controlling Board, a bipartisan legislative spendingoversight group, to OK the use of existing funds to help local officials and health-care providersdeal with any Ebola cases.
2020-10-25 06:27:30.0
Not in at the moment <a href="http://rgod.ir/adalat-interaction-with-toprol/cialis-commande-express">toprol xl generic doesn't work</a> Beating the seventh-place Blue Jackets (18-21-3, 39 points) on Friday night did not come easily, but neither did Staal&rsquo;s contract negotiation, and he handled both gracefully, as he typically does.
2020-10-25 06:27:30.0
On another call <a href="http://hestelav.dk/aldara-krema-cena-u-srbiji/">cena aldara creme</a> In the video, the assistant can be heard saying one horse, Nehro, "doesn't have any foot at all" in an apparent reference to allegations of repeated application of Z-bar horseshoes on already damaged hooves.
2020-10-25 06:27:29.0
This site is crazy :) <a href="http://www.bigmusclecar.com/buy-sildalis-online/">was ist sildalis</a> Through a series of rules for banks' increased capital cushions against losses and other requirements, regulators have put into effect the tougher standards mandated by Congress in a 2010 law responding to the financial crisis.
2020-10-25 06:27:28.0
I'd like to transfer some money to this account <a href="http://www.juko-in.or.jp/precio-nitrofurantoina-colombia">precio nitrofurantoina chile</a> "The job of the party committees is to recruit the best candidates possible, and this cycle we have an outstanding field of women candidates running across the country," says Andrea Bozek, spokeswoman for the National Republican Campaign Committee, which leads Project Grow.
2020-10-25 06:05:50.0
I can't get a dialling tone <a href="http://heleneburrow.co.uk/methotrexate-liver-medscape">methotrexate liver medscape</a> Our report, however, shows a channel through which the recession has significantly affected the mental health and wellbeing of mothers in particular," she noted.
2020-10-25 06:05:50.0
I'm interested in <a href="http://plateroytu.com/cialis-dosage-times">fondazione dottori commercialisti bologna prove esame</a> At this point the bank should hold a binding vote to approvea bylaw change made to give Moynihan the chairmanship, saidofficials in Stringer's office
2020-10-25 06:05:49.0
Do you know each other? <a href="http://studentfinanceadvisor.co.uk/alli-prices-at-walmart">alli results orlistat</a> The same day, another research group, Emerson Analytics,accused Hong Kong-listed sausage casing maker Shenguan HoldingsGroup Ltd of doctoring its books, and said its report was basedon government and SAIC documents, company filings, and ananalysis of the casing industry.
2020-10-25 06:05:48.0
Free medical insurance <a href="http://www.instalacioneshidraulicas.com/what-is-allopurinol-300-mg/">what is allopurinol used for</a> Advocates for domestic violence victims say they hope Ray Rice&rsquo;s successful appeal of his suspension doesn&rsquo;t discourage women from reporting abuse or sideline the national conversation sparked by the video that shows the disgraced NFL star assaulting his wife in an Atlantic City casino elevator.