实例信息
公网IP地址
密码
终端登录服务器
- 用户写root
- 下面写 ssh root@刚刚的公网ip
- 输入密码后登录成功
查看服务器32位uname -m
[root@iZ2ze1vuvirj8q7sqbt76xZ ~]# uname -m
x86_64
tomcat下载
java下载
mysql
复制软件
/usr/local/src/下面创建三个文件夹java mysql tomcat
[root@iZ2ze1vuvirj8q7sqbt76xZ ~]# cd /usr/local/src/ [root@iZ2ze1vuvirj8q7sqbt76xZ src]# mkdir java [root@iZ2ze1vuvirj8q7sqbt76xZ src]# mkdir tomcat [root@iZ2ze1vuvirj8q7sqbt76xZ src]# mkdir mysql [root@iZ2ze1vuvirj8q7sqbt76xZ src]# ls java mysql tomcat
使用sftp传输文件
root@39.106.99.237’s password: Connected to 39.106.99.237. sftp> put /Users/wangchun/Downloads/jdk-8u261-linux-x64.tar /usr/local/src/java Uploading /Users/wangchun/Downloads/jdk-8u261-linux-x64.tar to /usr/local/src/java/jdk-8u261-linux-x64.tar /Users/wangchun/Downloads/jdk-8u261-linux-x64 100% 337MB 940.9KB/s 06:06
shell命令解压
[root@iZ2ze1vuvirj8q7sqbt76xZ ~]# cd /usr/local/src/java/ [root@iZ2ze1vuvirj8q7sqbt76xZ java]# ls jdk-8u261-linux-x64.tar
[root@iZ2ze1vuvirj8q7sqbt76xZ java]# tar -xvf jdk-8u261-linux-x64.tar ….
[root@iZ2ze1vuvirj8q7sqbt76xZ java]# ls
jdk1.8.0_261 jdk-8u261-linux-x64.tar
- 配置java环境变量
[root@iZ2ze1vuvirj8q7sqbt76xZ ~]# cd ~
[root@iZ2ze1vuvirj8q7sqbt76xZ ~]# vi /etc/profile
[root@iZ2ze1vuvirj8q7sqbt76xZ ~]# source /etc/profile
[root@iZ2ze1vuvirj8q7sqbt76xZ ~]# java -version
java version “1.8.0_261”
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)
export JAVA_HOME=/usr/local/src/java/jdk1.8.0_261
export JRE_HOME=/usr/local/src/java/jdk1.8.0_261/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$JAVA_HOME:$PATH
tomcat
[root@iZ2ze1vuvirj8q7sqbt76xZ ~]# cd /usr/local/src
[root@iZ2ze1vuvirj8q7sqbt76xZ src]# ls
java mysql tomcat
[root@iZ2ze1vuvirj8q7sqbt76xZ src]#
[root@iZ2ze1vuvirj8q7sqbt76xZ src]#
[root@iZ2ze1vuvirj8q7sqbt76xZ src]#
[root@iZ2ze1vuvirj8q7sqbt76xZ src]# cd tomcat/
[root@iZ2ze1vuvirj8q7sqbt76xZ tomcat]# ls
apache-tomcat-9.0.38.tar.gz
[root@iZ2ze1vuvirj8q7sqbt76xZ tomcat]# tar -zxvf apache-tomcat-9.0.38.tar.gz
- 启动tomcat
[root@iZ2ze1vuvirj8q7sqbt76xZ tomcat]# mv apache-tomcat-9.0.38 tomcat9
[root@iZ2ze1vuvirj8q7sqbt76xZ tomcat]# ls
apache-tomcat-9.0.38.tar.gz tomcat9
[root@iZ2ze1vuvirj8q7sqbt76xZ tomcat]# cd tomcat9/bin/
[root@iZ2ze1vuvirj8q7sqbt76xZ bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/src/tomcat/tomcat9
Using CATALINA_HOME: /usr/local/src/tomcat/tomcat9
Using CATALINA_TMPDIR: /usr/local/src/tomcat/tomcat9/temp
Using JRE_HOME: /usr/local/src/java/jdk1.8.0_261/jre
Using CLASSPATH: /usr/local/src/tomcat/tomcat9/bin/bootstrap.jar:/usr/local/src/tomcat/tomcat9/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Tomcat started.
[root@iZ2ze1vuvirj8q7sqbt76xZ bin]#
配置安全规则
- 成功之后http://39.106.99.237:8080就可以访问了