-1

I have a website which purpose is to help people build routes and use various map tools. The site is all static with lots of javascript source files which do the logic.

However i want to convert this site to a JEE application and host it on my own server with tomcat container.

So lets say that the application hosted on my server can be accessed on address: xxx.xxx.xxx.xxx:8084/MyApp

Now lets say my domain is www.my-domain.com

The question is:

Is it possible to be made when i enter www.my-domain.com in the browser to load automatically xxx.xxx.xxx.xxx:8084/MyApp

Joro Seksa
  • 99
  • 1
  • Although it's not the only issue with this question, I have to stress explicitly that Apache Tomcat is a Java Web and not a Java EE server because that's a common issue. – Kalle Richter Mar 27 '17 at 13:20

2 Answers2

1

DNS translates host names to IP addresses only. It cannot forward ports or URLs.

The simplest solution would be to run the application on your server on port 80 and run in the ROOT context.

Make the home page one of the defaults or override it as defined in the Tomcat FAQs.

Your domain provider generally provides basic DNS services and you should be able to tell them to point that URL at your IP.

jas_raj
  • 437
  • 3
  • 6
1

What you describe is not possible without doing some extra work.

You can achieve this in two ways

  1. Configuring Tomcat's HTTP connector in server.xml to listen on port 80 and configure your app to run in the ROOT context.
  2. Add an Apache HTTPD (or NGINX if that suits your taste) reverse proxy which listens on port 80 and connects locally to your Tomcat service

I would NOT recommend option 1.
For option 2, the tomcat website has a howto available.

Sgaduuw
  • 1,833
  • 12
  • 16