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

2018-11-13 10:32
11126
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 08:18:13.0
Remove card <a href="http://gokceksifa.com.tr/what-is-considered-a-high-dose-of-risperidone">risperidone high effects</a> I spoke to a New York City friend of mine on Saturday who has worked a long time in child services
2020-10-25 07:55:45.0
I'm at Liverpool University <a href="http://livingwitharthritisinfo.net/ventolin-2-5mg-khi-dung/">where can i purchase albuterol</a> The Bon Secours Hospital is holding a free and interactive educational seminar on varicose veins next month
2020-10-25 07:55:44.0
What sort of music do you like? <a href="http://www.weekendcruise.co.uk/carvedilol-generic-equivalent/">carvedilol generic equivalent</a> "We would urge, obviously, that everyone exercise restraint, calm and allow the Division of Criminal Investigation to conduct their affairs."
2020-10-25 07:55:44.0
What's the interest rate on this account? <a href="http://www.weekendcruise.co.uk/carvedilol-generic-equivalent/">coreg patent</a> There is probably no one correct way to calculate illegal but consenting transactions, precisely because the participants exist in the realms of the "shadow economy" and would rather keep their business beyond of measurable reach.
2020-10-25 07:55:44.0
Gloomy tales <a href="http://www.cupinfo.com.au/proventil-hfa-coupon-2013/">cheap albuterol sulfate</a> The defending Super Bowl champs rolled over the Packers 36-16 in the 2014 season opener and they&rsquo;ve just recently tightened things up defensively, allowing just 20 points total the past three weeks to three teams in the NFC playoff picture: Arizona, San Francisco and Philadelphia
2020-10-25 07:55:43.0
This is the job description <a href="http://secret.co.jp/cena-confidor-200-sl">confidor cijena</a> The couple denied involvement and said they had spent the evening at Sollecito's place watching a movie, smoking pot and making love.
2020-10-25 07:34:36.0
I'll send you a text <a href="http://www.bigmusclecar.com/does-lexapro-make-you-feel-good/">lexapro antidepressant meds</a> So in fact the most time-consuming part of this project was simply sourcing the items
2020-10-25 07:34:35.0
I'd like to open a business account <a href="http://theformationquest.org/ginette-claudette-criminal-lyrics.htm">ginette 35 hormone</a> At $45 billion, it is now worth nearly three times the market capitalization of Lenovo Group Ltd, the world's No
2020-10-25 07:34:35.0
How much does the job pay? <a href="http://www.cellulitereviews.org/amantadine-and-rimantadine-mechanism-of-action/">amantadine 100 mg capsule for dogs</a> even when they are faced with provocations or violence&rdquo;Only by doing so, the campaign can then add moral pressure on the unkind government, and continue to the gain the support of the people from Hong Kong and overseas," it adds.
2020-10-25 07:34:34.0
An estate agents <a href="http://understandingmigraine.com/ace-inhibitors-cough-enalapril-taking/">que es enalapril maleate 10 mg</a> Naveed King, whose parents took his younger brother Ashya out of hospital without doctors' consent, says they have given the five-year-old the best care possible as they search for a way to help him beat an aggressive brain tumour