What is a WAR file?
A WAR file is a single package that holds a whole Java web application. WAR stands for Web Application Archive. It is like a zip file that contains your pages, code and settings. To deploy means to place the application on a server so people can use it.
What is Tomcat?
Tomcat is a free program that runs Java web applications. It unpacks your WAR file and serves the pages. Your hosting plan must include Java and Tomcat support. Ask Hostvento support whether yours does.
Before you start
- Have your
.warfile ready. - Know where Tomcat is installed, or have your control panel login.
- Back up any existing application with the same name. Deploying can replace it.
Method 1: Using the Tomcat folder
- Connect to your server with FTP or SSH. FTP moves files to your hosting. SSH lets you type commands on a server.
- Find Tomcat's
webappsfolder. The path is often/opt/tomcat/webapps, but it can differ. - Upload your WAR file, for example
myapp.war, intowebapps. - Wait a short time. Tomcat unpacks the file by itself and creates a folder named
myapp. - Open
http://your-domain:8080/myappin a browser. Port 8080 is the usual Tomcat door, but yours may differ.
Method 2: Using the Manager page
- Open the Tomcat Manager page in your browser. It is often at
http://your-domain:8080/manager/html. - Log in with the manager user name and password.
- Scroll to the section WAR file to deploy.
- Click Choose File and pick your WAR file.
- Click Deploy.
- Your app appears in the list. Click its name to open it.
Restart Tomcat if needed
systemctl restart tomcat
This restarts Tomcat. It needs root access, which is full admin control of a server. The service name may differ.
If it does not work
- Read the log file. It is often in the Tomcat
logsfolder, namedcatalina.out. - Check that the Java version matches what your app needs.
- Check the file name, because it becomes part of the web address.
Still stuck? Open a support ticket.
Quick recap
- A WAR file is a packaged Java web app.
- Tomcat runs it.
- Copy it to
webapps, or use the Manager page. - Open the app by its file name in the address.
- Check logs if there are errors.