200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > 阿里云服务器安装mysql jdk redis tomcat

阿里云服务器安装mysql jdk redis tomcat

时间:2019-07-18 23:26:53

相关推荐

阿里云服务器安装mysql jdk redis tomcat

文章目录

一、前言二、安装redis三、安装mysql四、安装jdk和tomcat

一、前言

本次安装采用的阿里云系统为:Alibaba Cloud Linux 3.2104 64位

二、安装redis

2.1、 参考文档:

/hw159357_/article/details/108256808

2.2、通过XShell或者其他工具连接阿里云ECS

在你的希望的路径下下载Redis安装包,如在/usr/local目录下创建redis文件夹:

移动到目标路径: cd /usr/local/创建redis文件夹:mkdir redis

2.3、下载redis压缩包

Redis 历史版本下载URL:http://download.redis.io/releases/下载方式一:选择需要的版本,下载到本地然后通过Xftp上传到创建好的/usr/local/redis目录下,这里不演示;下载方式二:选择需要下载的版本(这里以3.2.10为例),右键复制链接地址,然后进行如下操作;

进入刚创建好的redis目录:cd ./redis(或cd /usr/local/redis)下载redis压缩包命令:wget http://download.redis.io/releases/redis-3.2.10.tar.gz

等待下载完成之后解压:

解压命令:tar -xzvf redis-3.2.10.tar.gz

2.4、安装和相关配置

等待解压完成后,进入解压目录进行安装;

进入解压目录:cd ./redis-3.2.10进行安装命令:make

1、安装完成之后,进行配置步骤如下:

打开配置文件命令:vim ./redis.conf

2、在配置文件61行左右(行数在右下角),注释掉127.0.0.1(默认redis是只能内网127.0.0.1访问,如果想外网访问需要修改绑定的地址)

3、保护模式,关闭保护模式,否则外部ip无法连接,将protected-mode yes改为protected-mode no

4、设置redis可以一直在后台运行,以守护进程方式运行,即关闭SSH工具程序也在运行。将 daemonize no 改成 daemonize yes(在128行左右)

5、密码设置,将”#requirepass foobared“ 取掉注释改成 requirepass 123456(或者其它你需要的密码)(在480行左右)

注意:去掉注释时将前面的空格一并去掉;

6、保存退出:按esc退出编辑模式,然后输入:wq!保存退出

2.5、服务启动

在redis解压目录下,进入redis的src目录:cd ./src cd /usr/local/redis/redis-3.2.10/src(绝对路径)启动服务:./redis-server ../redis.conf

2.6、查看是否启动成功

ps aux | grep redis

启动成功后的截图

2.7、阿里云配置

服务启动成功后想要通过工具远程连接,还需要进行阿里云的配置;首先登陆阿里云控制台; 控制台–>云服务器ECS–>安全与网络–>安全组–>配置规则

注意:入方向和出方向都要配置

2.8、无法登录

我在登录过程中出现以下错误,参考该博客解决:

登录redis报错

Response received : -DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent.2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.

三、安装mysql

3.1、准备环境

首先需要在ECS实例所使用的安全组入方向添加规则并放行3306端口。具体步骤,请参考添加安全组;

3.2、安装

参考官方文档:手动部署MySQL数据库

四、安装jdk和tomcat

4.1、安装

参考官方文档:手动部署Java Web环境

4.2、安装tomcat说明

对于安装tomcat的第五步:我并没有按照教程重新创建server.xml文件,而是采用了原始的server.xml文件来启动tomcat,在执行启动脚本时没有异常情况,但当我访问8080端口时却没有显示tomcat的主页,于是我就尝试执行关闭脚本,然而出现了下图所示情况,参考以下博客解决:

关闭命令报错

而对于第六步的设置JVM内存参数,由于没有找到配置文件,故没有执行该步骤。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。