MDP
MDP

Reputation: 4277

How to deploy a java webapp on tomcat by uploadind a .war file

I'm changing the host company of my website. With the previous host I had no problem, since I could use 'cpanel'.

The new host gave me the url to reach the tomcat manager page. I added a user with full permissions (I hope) to tomcat-users.xml and I reach the page you can see in the pic.enter image description here

Now, supposing my site is called 'mySite', where should I upload the .war file? Inside which folder?

I suppose I should create a folder called 'mysite', but I don't know how to do it.

Thank you

Upvotes: 2

Views: 3389

Answers (4)

Frans
Frans

Reputation: 4022

The general procedure is:

  • find the TOMCAT_HOME directory. Since you've found tomcat-users.xml, I'm guessing yo've found it

  • under TOMCAT_HOME there will be a directory called webapps. This is where you put your WAR file.

  • a few seconds after placing your WAR file, Tomcat will unpack and deploy it. You'll se a directory appear with the same name as your WAR file but without the .war extension. At this point the application should also appear in the Tomcat manager

  • You can take a look at the TOMCAT_HOME/logs/catalina.out file if the WAR file isn't deployed a you expected.

  • Caveat: if your conf/Catalina/localhost directory isn't empty (contains an .xml file for your web app) Tomcat might not unpack and deploy your .WAR file. I've had problems with this in the past.

Upvotes: 2

caseTest
caseTest

Reputation: 11

Just add your war into the webapps folder of your tomcat server.

pathtoyourtomcat/webapps/

Upvotes: 1

triadiktyo
triadiktyo

Reputation: 489

Did you try uploading the War from the WAR file to deploy section? Or do you really need to deploy by dropping the file? As for where to drop the war file on the server it depends on the server configuration

Upvotes: 0

chenchuk
chenchuk

Reputation: 5742

You can use this interface to deploy a new *.war from your pc to the server by pressing on 'choose file' then press 'deploy'. the xxx.war file will be uploaded to tomcat/web-apps/xxx .

After successfull deployment you will see your webapp here : enter image description here

Upvotes: 2

Related Questions