Search code examples
apache2tomcat8

Project inside webapp tomcat8 does not run in webpage


I am trying to run my application using tomcat8 inside the Apache2 virtual machine, using MacOS. The IP address is: http://143.167.11.2:8080 and this the view when I run the link on the browser:

webpage apache2 VM

I have installed tomcat8 inside this apache2 VM using: apt-get install tomcat8 by following this instruction: https://www.linode.com/docs/development/frameworks/apache-tomcat-on-ubuntu-16-04/

When I run this address http://143.167.11.2:8080 the result is the same, it just shows this same picture webpage apache2 VM. It does not show the tomcat home page.

I have tried to run this: ./startup.sh and inside the terminal and it started. output ./startup.sh

But when I run the linked address http://143.167.11.2:8080 the result is same, it shows apache home page.

I tried to put my project inside /var/lib/tomcat8/webapps and then tried to run: http://143.167.11.2:8080/visualisation-dataproject. But the result like below: result when running the link

Any idea how can I run my project (that I put on the webapps folder) on the web browser?


Solution

  • Apache2 is usually use for PHP project. Tomcat is usually for java project. There are some possibility why you can not run tomcat on the web browser. One of the reason is you have not install tomcat8 properly. Even you have install it, you should check it really work or not. If it work on the VM, maybe the problem when you set the port for tomcat in server.xml.

    To check server.xml, try : sudo nano /etc/tomcat8/server.xml, and find <Connector port="8080" protocol="HTTP/1.1 ... line.

    And try to change the port 8080 to another port e.g: 8081. Why? to prevent tomcat8 server running with same port with another server such as apache2.

    After that try the step on this link: https://askubuntu.com/a/434085/856656 it should work.