Apache Tomcat Web Sevice Setup on Ali ECS

Background

  • url:https://help.aliyun.com/document_detail/172784.html
  • Date: 2021-09-21
  • Subject: Deploy Tomcat Web Service on Alibaba Cloud Linux 2 ECS
  • Instance: ecs.s6-c1m2.small, 1 core 2 GiB
  • OS: Alibaba Cloud Linux 3.2104 64bit
  • JDK Version: JDK 1.8.0_302
  • Apache Tomcat: 8.5.71

Step 1 Prepare

Config ECS Security Group Inbound Rules about port 1022(ssh) and 8080(http)

  1. ssh ECS (vim /etc/ssh/sshd_config, Port 1022, systemclt ssh restart)
  2. turn off firewalld
$ systemctl status firewalld #check status is inactive or active
$ systemctl stop firewalld #turn off firewalld temperately
$ systemctl disable firewalld #turn off firewalld for good
  1. turn off SELinux
$ getenforce #check SELinux status is Disabled or Enforcing
$ setenforce 0 #turn off temperately
$ vim /etc/selinux/config
#SELINUX=enforcing -> SELINUX=disabled
#restart to take effect
  1. creat normal user www to run Tomcat。
useradd www
mkdir -p /data/wwwroot/default #-p: create directoty even if no parent directory
chown -R www.www /data/wwwroot #-R: recursive

Step2 Install JDK1.8

yum -y list java* #check java package version
yum -y install java-1.8.0-openjdk-1.8.0.302.b08-0.1.al8.x86_64
java -version

openjdk version "1.8.0_302"
OpenJDK Runtime Environment (build 1.8.0_302-b08)
OpenJDK 64-Bit Server VM (build 25.302-b08, mixed mode)
vim /etc/profile

JAVA_HOME=/usr/lib/jvm/java-1.8.0.302.b08
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME CLASSPATH PATH #export: ensure the environment variables passed to child proces
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值