2021-02-10- Simple deployment of JavaWeb project operations on Linux (for beginners)

Simple deployment of JavaWeb project operations on Linux

Project packaging

  • First package your project into a war package. There is a difference between the packaging method of maven and no maven, and the packaging method of eclipse and idea is different. Baidu as needed

Connect linux

  • First of all, if the company asks you to deploy the project, it will give you a linux link address and password, you need to use a tool to link to that linux to operate
  • There are many such tools. The Xshell I use is available on Baidu.
  • Also need to learn some basic linux commands, generally 10 to 20 are used, Baidu just learns them

Install JDK

  • After you finish the first step, if the linux that your boss gave you does not have jdk, or does not have the version of jdk you want, you need to install jdk, if any, you can skip this step
  • First of all, use the xftp tool (Baidu, matching with xshell) to transfer the jdk installation package of the linux version to linux, and choose a path.
  • . Go to /etc/profile to edit environment variables
    Insert picture description here
  • Let the newly configured environment variables take effect and execute source /etc/profile

Install tomcat

  • Use xftp to upload the gz package of tomcat to linux, choose any path, and the root directory will do
  • It can be used after decompression, generally free installation version

Deployment project

  • Use xftp to upload the packaged war package to webapps in the tomcat directory
  • Then go to /usr/lib/firewalld/services/ssh.xml and add a port 8080 (see what port is required for the project), otherwise port 8080 will be blocked by the firewall
  • Then enter the bin directory of tomcat and execute ./startup.sh to run tomcat
  • The browser on the computer can be accessed with the ip:8080/project name of the linux system, for example: 173.76.200.107:8080/war package name

Guess you like

Origin blog.csdn.net/qq_41270550/article/details/113772102