Deploy JavaWeb project to Aliyun server
-
Preparation
Environment: Java8, IDEA, tomcat8.5,
This web project runs through the local tomcat
-
Pack
After the project is ok, package it, select Artifacts—>click the ➕ sign—>right click and select Extract into /WEB-INF/class (because the output directory specified above is different, there is a slight difference here).
After the packaging is completed, enter the corresponding directory to view the war package, and the packaging is complete.
-
Server environment preparation
This project uses Alibaba Cloud's server (windows), and the environment is consistent with the development environment (install tomcat8.5)
-
deploy
Deployment is very simple, just copy the packaged war package to the webapps folder in the tomcat installation directory!
-
configuration
- Enter the conf directory under the tomcat installation directory, open the server.xml file, and modify two places
The port can be specified by itself, and appBase can paste the directory where the project is stored
-
Start the server tomcat
Enter the bin directory, run startup.bat, and the project is deployed successfully!
-
Enter the browser and enter the IP+port, for example: http://47.118.* . :8070/sheyang
PS: If you need to use a domain name to access this project, there will be a DNS domain name resolution error problem. Mac needs to configure the IP and domain name in /etc/hosts, and windows needs to modify it in C:\Windows\System32\drivers\etc\hosts , Right-click the hosts file when modifying, and configure a write permission for the current User user, otherwise there is no way to save it!