体验地址:https://developer.aliyun.com/adc/scenario/bbad6f5e0cba4c0ba5c904f6cf06a8d0
1、连接ECS服务器
ssh root@123.123.123.123
2、安装JDK
# 查看yum源中JDK版本 yum list java-1.8.0* # 安装JDK1.8 yum -y install java-1.8.0-openjdk.x86_64 # 查看版本 java -version
3、安装MySQL数据库
# 下载并安装MySQL wget http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm && \ yum -y install mysql57-community-release-el7-10.noarch.rpm && \ yum -y install mysql-community-server # 启动 MySQL 数据库 systemctl start mysqld.service # 查看MySQL初始密码 grep "password" /var/log/mysqld.log # 登录数据库 mysql -uroot -p #修改密码安全策略为低(只校验密码长度,至少8位) >set global validate_password_policy=0; # 修改MySQL默认密码 ALTER USER 'root'@'localhost' IDENTIFIED BY '12345678'; # 授予root用户远程管理权限 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '12345678'; # 退出数据库 exit
4、安装Tomcat
# 下载Tomcat压缩包 wget https://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.57/bin/apache-tomcat-8.5.57.tar.gz # 解压刚刚下载Tomcat包 tar -zxvf apache-tomcat-8.5.57.tar.gz # 重命名 mv apache-tomcat-8.5.57 /usr/local/Tomcat8.5 # 为Tomcat授权 chmod +x /usr/local/Tomcat8.5/bin/*.sh # 修改Tomcat默认端口号为80 sed -i 's/Connector port="8080"/Connector port="80"/' /usr/local/Tomcat8.5/conf/server.xml # 启动Tomcat /usr/local/Tomcat8.5/bin/./startup.sh
访问Tomcat: http://<ECS公网地址>