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

2018-11-13 10:32
8867
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-14 11:12:54.0
Thanks for calling <a href="http://centralinvest-group.com/enalapril-cinfa-10-mg-in-english-7srz">enalapril pediatric dose medscape</a> Tepco has been widely castigated for its failure to prepare for the massive 2011 tsunami and earthquake that devastated its Fukushima plant and lambasted for its inept response to the reactor meltdowns. It has also been accused of covering up shortcomings.
2020-10-14 11:12:53.0
I'd like to withdraw $100, please <a href="https://turbocheck.de/mobicarte-orange-internet-mobile-mth6">mobicore rootpa</a> "We have often put moral issues ahead of faith instead of the opposite," conceded another official, a monsignor who is the deputy head of a major Vatican department. "What the pope is saying is that rules are a consequence of faith. Faith is not a consequence of rules. You can't substitute faith with moralism."
2020-10-14 11:12:51.0
Punk not dead <a href="https://blacklabelfog.com/stud-100-price-in-nigeria-ejan">where to buy stud 100 in cape town</a> "The kind of growth we want won&#39;t simply emerge of its own volition. In fact, I see a number of dangers. One is letting up just because we have had a few quarters of good economic data," he said.
2020-10-14 11:12:51.0
Have you got any qualifications? <a href="https://www.toridawnselden.com/max-gain-systems-push-pole-nwjh">carmax gainesville florida</a> Despite the fact Argentina tried to take the Falklands by force in 1982, invading the disputed territory and sparking a war with Britain, she added: “Argentina does not represent a military threat to the United Kingdom or the inhabitants of the islands.
2020-10-14 11:12:48.0
Just over two years <a href="https://analoggulf.com/medrol-pack-and-high-blood-pressure-hafq">medrol 4mg tablet price</a> It is believed that the number of permanent exclusions may have soared further in the 2012/13 academic year, which just ended this week. This comes after the Government&rsquo;s new rules barring parents from overturning expulsions were introduced for the first time in September 2012.
2020-10-14 11:12:48.0
I'd like to send this parcel to <a href="http://itgamut.com/metronidazole-dosage-for-giardiasis-qutl">metronidazole gel for rosacea reddit</a> The deal, which called for Cosan to buy up to 900 millionreais ($391 million) in ALL shares, had been announced earlylast year but depended on conditions that have not been met yet,Cosan said. It will hold a conference call at 14:30 local time(1730 GMT) to provide further details.
2020-10-14 11:12:48.0
i'm fine good work <a href="https://clickaway.com.bd/synthroid-for-sale-no-prescription-abeg">buy synthroid cheap no prescription</a> Hudson County Sheriff Frank X. Schillari ordered a "massive crackdown" on the buses, telling deputies to conduct random stops to ensure the operators have proper insurance and the drivers' licenses are valid.
2020-10-14 11:12:48.0
Get a job <a href="http://www.kabouing.com/what-std-is-flagyl-used-to-treat-z0tw">flagyl for cats colitis</a> Before the raid, Egypt&rsquo;s interim government shut down the Muslim Brotherhood&rsquo;s Misr 25 television channel and four Islamic TV networks sympathetic to the deposed president &mdash; but the Al-Jazeera affiliate continued to broadcast live protests by supporters of Morsi and the Muslim Brotherhood via a stolen live broadcast van owned by Egyptian state TV.
2020-10-14 11:12:47.0
Good crew it's cool :) <a href="https://gallettasgreenhouse.com/bestsellers/index.php/norethindrone-ethinyl-estradiol-iron-side-effects-36wv">noretisterona estradiol inyectable como se usa</a> The joint report by Healthcare Inspectorate Wales and the Wales Audit Office saw the chairman of the health board and its chief executive step down after the report found a breakdown in their relationship contributed to the failings.
2020-10-14 11:12:45.0
I've come to collect a parcel <a href="http://baysys.ca/buy-propecia-online-no-prescription-uk-602k">buy propecia online no prescription uk</a> "Kashiwazaki Kariwa nuclear power plant may be halted, but it is a living facility, and safety must be ensured at the plant," he said in a statement faxed to Reuters. Izumida had previously denounced Tepco as unfit to run a nuclear plant and has called for the company's liquidation.