Before installing Tomcat, the server must have jdk installed. The installation steps are as follows:
Download from the Internet
apache-tomcat-8.5.29.tar.gz
decompress
tar zxvf apache-tomcat-8.5.29.tar.gz
move
sudo mv apache-tomcat-8.5.29/ /opt/apache-tomcat-8.5.29
Create link
sudo ln -s /opt/apache-tomcat-8.5.29/ /opt/tomcat8
Since the port of Alibaba Cloud service needs to set security group rules in the background, we will not introduce the security group rules for setting port 8080 here. After setting, perform the following operations:
Enter the bin file under tomcat
cd /usr/tomcat8/bin
Edit the catalina.sh file
sudo vim catalina.sh
Add the following under esac:
JAVA_HOME=/usr/lib/jvm/jdk8
JAVA_OPTS="-server -Xms512m -Xmx1024m
-XX:PermSize=600M
-XX:MaxPermSize=600m
-Dcom.sun.management.jmxremote"
Start the Tomcat service
sudo ./startup.sh
Finally, enter http://ip:8080/ in the browser to access it.