Deploy War Project on Linux Server
1. Upload the War package to the Linux server
Tools such as FTP or SFTP can be used.
2. Confirm that the Java running environment is installed on the server
- If it is not installed, you can use the following command to install:
sudo apt-get update sudo apt-get install default-jre
3. Confirm that the web server has been installed
For example: Apache Tomcat or Nginx, etc. If it is not installed, you can use the following command to install:
- Install Apache Tomcat:
sudo apt-get update sudo apt-get install tomcat8
- Install Nginx:
sudo apt-get update sudo apt-get install nginx
4. Copy the War package to Tomcat's webapps directory
Or in the web root directory set by Nginx, you can use the following command:
- Copy to Tomcat:
sudo cp /path/to/your/ /var/lib/tomcat8/webapps/
- Copy to Nginx's web root directory:
sudo cp /path/to/your/ /var/www/html/
5. Restart Tomcat or Nginx service
Ensure that War packages are deployed and accessible.
- Restart Tomcat:
sudo systemctl restart tomcat8
- Restart Nginx:
sudo systemctl restart nginx
6. Test whether the deployment is successful
Enter the IP address and port number of the Linux server in your browser (if any)
For example:
http://192.168.1.100:8080/yourproject to access the web application
Summarize
The above is personal experience. I hope you can give you a reference and I hope you can support me more.