1
votes

It seems that I don't understand how Tomcat works. I'm trying to copy an application from the webapps folder of another server of ours to this new server running Tomcat and it is returning a 404 error even after restarting the service. -- I even went into a working app ('examples') and copied index.html to index2.html, restarted the service, and index2.html doesn't load but index.html does.

Is there something more I must do to get Tomcat working?

Thanks!

2
If tomcat threw any exceptions while deploying the application, they'll be in the logs under (tomcat_home)/logs. Check in there. - NickJ

2 Answers

0
votes

Copying is not the way to deploy web application to Tomcat or other web server. The proper way is to build war file and copy it to the webapps. Or use tomcat manager to do it for you if you have rights to use tomcat manager.

0
votes

As nikpon said, copying files it is not the way to start an application in tomcat. In tomcat there are several folders:

  • bin where you have the startup and shutdown script to run or stop the tomcat.
  • conf where you have several configurations files, the most important and probably one you forgot to edit is the server.xml. In this file you have to specify the port number where it is running your application, the name of the project and the context path.
  • logs for the tomcat logs, here you can check the catalina.out to see in more details what it is happening in your application
  • webapps where all the web applications are deployed. In this it is where you can copy the files from the previous project, but the idea is to use the war file and deploy it here.

So you should check the logs and the server.xml.

Hope this helps!