I created a Ubuntu 14.04 droplet, and installed tomcat. My droplet’s ip address(from the mail i recieved) is say for example : IP_address.
After that i installed a web application using this tutorial :https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-7-on-ubuntu-14-04-via-apt-get.
I am able to access my application using http://IP_address:8080/myapplication.
Also, I have have connected the IP_address to my domain name using this tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-host-name-with-digitalocean.
i.e i have mydomainname.com pointing to IP_address.
Ping from my local system to the domain name gives me a reply mentioning the IP_address.
But when i try to access http://IP_address, my browser just says “This webpage is not available”.
Any help on this would be useful. Thanks in advance.
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.
Browsing to
http://IP_address
doesn’t work because there is nothing listening on port 80 (tomcat is listening on 8080). I would recommend installing nginx and configuring it a reverse proxy so that it forwards requests from port 80 to port 8080.Run the following command:
Then, edit
/etc/nginx/sites-enabled/default
and replace its contents with the following:Finally, restart nginx: