Deploy JavaWeb project to Aliyun server

Deploy JavaWeb project to Aliyun server

  1. Preparation

    Environment: Java8, IDEA, tomcat8.5,

    This web project runs through the local tomcat

  2. 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).
    insert image description here

    After the packaging is completed, enter the corresponding directory to view the war package, and the packaging is complete.

  3. Server environment preparation

    This project uses Alibaba Cloud's server (windows), and the environment is consistent with the development environment (install tomcat8.5)

  4. deploy

    Deployment is very simple, just copy the packaged war package to the webapps folder in the tomcat installation directory!

  5. configuration

    • Enter the conf directory under the tomcat installation directory, open the server.xml file, and modify two places

insert image description here
insert image description here

The port can be specified by itself, and appBase can paste the directory where the project is stored

  1. Start the server tomcat

    Enter the bin directory, run startup.bat, and the project is deployed successfully!

  2. 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!

Guess you like

Origin blog.csdn.net/Xiao_tongtong/article/details/130575102