Report this

What is the reason for this report?

Ubuntu Tomcat help

Posted on November 23, 2020

I had a Java application deployed (setup by someone else) and I’ve been going through the process of improving it myself (read. breaking it). I need some help please

I appear to have HTTPS working ok and have now got Tomcat working, except it only shows a blank page when you go to the URL. When you inspect the page it shows a raft of 404 errors where it doesn’t seem to be able to find the .jps files. This makes me think a path is incorrectly set somewhere or a permissions issue?

TBH the whole file structure in this directory is confusing to me, there seems to be multiple versions of the same files all over the place.

File structure:

Root. 1. bin

  1. DATA
  2. Projects
  3. Tomcat
  4. admin (admin console - used to be accessed using URL/site-admin 1.apache-tomcat-8.5.29
  5. bin
  6. conf
  7. lib
  8. logs
  9. webapps 1. ROOT
  10. SITE
  11. SITE-WEB*
  12. SITE-Admin*
  13. back-end (this has the .WAR file in it)
  14. frount-end (presume spelling mistake) - (this seems to mimic the content of both the webapps/site-web directory and webapps/ROOT) 2. etc = apache2
  15. var
  16. usr

The tomcat log seems to be clear and running ok.

Help would be greatly appreciated and can post additional info if required.

thanks

Colonel Yeehaw



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

without more information on such issues, I would assume the problem lies in the configuration files. Having said that here are some tips what to troubleshoot when in such situations

  • Check if the application is deployed properly: Ensure that your application is deployed correctly under the webapps folder in Tomcat. Typically, the application should be in the form of a .war file or an extracted folder. In your case, the application should be inside webapps/SITE or webapps/ROOT.
  • Ensure that the context path is set correctly: If your application is not under the ROOT folder, you need to access it using the context path (e.g., https://yourdomain.com/SITE). If your application is under the ROOT folder, it should be accessible directly from the base URL (e.g., https://yourdomain.com/)
  • Check the Tomcat logs: Inspect the Tomcat logs in the logs folder (e.g., catalina.out, localhost.*.log) for any errors or warnings related to your application. These logs can provide useful information about issues with the deployment, configuration, or the application itself.
  • Check the application logs: Your application might also have its own log files. Look for any application-specific log files in the webapps/SITE/WEB-INF/logs folder or any other folder where your application stores logs. These logs can provide more information about issues within the application.
  • Check file permissions: Ensure that the Tomcat user has read and execute permissions on your application files and folders. You can update the permissions using the following command (replace /path/to/tomcat/webapps with the actual path to your webapps folder):
  1. sudo chown -R tomcat:tomcat /path/to/tomcat/webapps
  2. sudo chmod -R 755 /path/to/tomcat/webapps
  • Check the server.xml configuration: Verify that the server.xml file in the conf folder is correctly configured. Ensure that there is a <Host> element with the correct appBase pointing to the webapps folder. For example:
  1. <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.