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

2018-11-13 10:32
11114
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-12 03:56:51.0
I'm doing a masters in law <a href="https://suabomhutchankhong.com/estradiol-patch-sandoz-vs-mylan-8s3p">oestradiol kopen</a> “Tonight, as the two teams meet for the first time this year at Fenway Park, and as we battle fiercely on the field, we pause now to say thank you to the Yankees and their fans for that heartfelt sentiment.”
2020-10-12 03:56:51.0
Where are you calling from? <a href="https://cleanserve.pl/piit28-20-pdf-download-5lnn">piit28 2.0 pdf download</a> Kathimerini said that Athens wants to roll over 4.4 billioneuros in bonds due next year rather than paying them off to helpcover the gap. Athens issued the bonds in 2009 to provideliquidity support for its banks, which were battered by the debtcrisis.
2020-10-12 03:56:50.0
I'm doing a masters in law <a href="https://xaydung3cong.com/vegan-soft-serve-ice-cream-los-angeles-vq7s">amd rx vega 56 price in pakistan</a> Fair and firm leadership has been and always will be critical to the success of any team. Mistakes are inevitable.  The key is to recognize mistakes, review why they happened and prevent them from happening again. Transform problems into teachable moments for advantageous solutions and future improvement.
2020-10-12 03:56:50.0
How much were you paid in your last job? <a href="https://www.cdpauctioneers.co.za/does-costco-canada-carry-rogaine-qyq5">rogaine hair shedding after 6 months</a> “[I’ve been doing Pilates for] 15 years!” she said. “It’s the basis of what I do for exercise because it’s dance-oriented – and, as you saw at the shoot, I love to dance. It’s my creative outlet.”
2020-10-12 03:56:49.0
I'd like to cancel this standing order <a href="http://ventilandoacervos.museus.gov.br/walmart-diet-coke-12-pack-lwld">walmart diet coke sale</a> On this week's Daily News Fifth Yankees Podcast, Mark Feinsand sits down with Yankees outfielder Vernon Wells to discuss the current state of the team, the Ryan Braun and Alex Rodriguez controversies and much more.
2020-10-12 03:51:52.0
I'm self-employed <a href="http://katkov.dev/is-robaxin-available-over-the-counter-in-canada-4jva">buy robaxin canada</a> “The commissioners asked for revisions because the original design was inappropriate to the character of and history of the bank building,” said Landmarks spokeswoman Elisabeth de Bourbon. “They said the proposed addition was too contemporary (and) incorporated too few historic features. . . ”
2020-10-12 03:51:52.0
Will I get paid for overtime? <a href="http://katkov.dev/amoxicillin-high-dose-side-effects-cdpu">amoxicillin 500mg used for bv</a> Her nomination would come during a political stalemate inWashington that has closed the U.S. government and threatened aU.S. default if lawmakers fail to raise the $16.7 trillion debtceiling by an Oct. 17 deadline.
2020-10-12 03:51:51.0
Lost credit card <a href="http://www.radioriosfm.com.br/index.php/buy-veggie-capsules-fjat">veggie capsules walmart </a> Several lawsuits between Aereo and television providers areplaying out across the country, including in federal courts inNew York, Massachusetts and Utah. The Supreme Court appeal stemsfrom the New York litigation.
2020-10-12 03:51:51.0
In a meeting <a href="http://santafyme.com/pharmacy/index.php/zantac-75-tablets-03gq">zantac chewable tablets</a> What really strikes you here at the scene of the crash is the great height that the bus fell. Standing where it came crashing down through the trees, you have to crane your neck to look up at edge of the road. It stands 30m above you against the blue of the sky.
2020-10-12 03:51:50.0
I've lost my bank card <a href="http://mastergymstore.com/crown-medical-centre-inverness-i4ot">crown medical centre figtree westfield</a> Hopes for a deal on Iran's nuclear ambitions rose when Obamaspoke by telephone last month with Iran's new president, HassanRouhani, a self-described moderate. It was the highest levelcontact between the two countries since the 1979 IslamicRevolution that led to students taking Americans hostage in theU.S. Embassy in Tehran.