安装java17
java -version
sudo apt update
sudo apt install openjdk-17-jre-headless
安装tomcat
- 更新源
sudo apt update
- 在apt中搜索tomcat
sudo apt search tomcat
- 安装tomcat10和tomcat10-admin
sudo apt install tomcat9 tomcat9-admin
- 启动tomcat
sudo systemctl start tomcat10
- 查看tomcat是否启动成功
http://url:8080/
- 设置开机启动
sudo systemctl enable tomcat10
webapps路径:/var/lib/tomcat10/webapps/ROOT/index.html
If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!
This is the default Tomcat home page. It can be found on the local filesystem at: /var/lib/tomcat10/webapps/ROOT/index.html
Tomcat veterans might be pleased to learn that this system instance of Tomcat is installed with CATALINA_HOME in /usr/share/tomcat10 and CATALINA_BASE in /var/lib/tomcat10, following the rules from /usr/share/doc/tomcat10-common/RUNNING.txt.gz.
You might consider installing the following packages, if you haven't already done so:
tomcat10-docs: This package installs a web application that allows to browse the Tomcat 10 documentation locally. Once installed, you can access it by clicking here.
tomcat10-examples: This package installs a web application that allows to access the Tomcat 10 Servlet and JSP examples. Once installed, you can access it by clicking here.
tomcat10-admin: This package installs two web applications that can help managing this Tomcat
安装mysql
修改配置文件允许外部链接