configuring domain name to point to tomcat server
configuring domain name to point to tomcat server
(OP)
I have a tomcat server running on my home pc, which is running on a static IP and so is visible on the internet.
I have a domain name which I would like to configure to point to a particular application running on tomcat.
I am able to point configure my domain name to point to the IP address of my home computer.
What I would like to know now is what I need to do to make the domain name point to a particular application within tomcat.
Thanks
Andy
I have a domain name which I would like to configure to point to a particular application running on tomcat.
I am able to point configure my domain name to point to the IP address of my home computer.
What I would like to know now is what I need to do to make the domain name point to a particular application within tomcat.
Thanks
Andy
RE: configuring domain name to point to tomcat server
It should be similar to the url you would use to access the application from home i.e. http://server:port/context .
So if you access the app at home using:
http://HOMEPC:8080/myapp
you would access it externally using:
http://123.123.123.123:8080/myapp
Assuming you have a firewall, you will have to open port 8080 - is that the problem perhaps?
Nick.
RE: configuring domain name to point to tomcat server
Is there anyway that I can make the domain point directly to
http://123.123.123.123:8080/myapp
Thanks again
Andy
RE: configuring domain name to point to tomcat server
If you set the context to /myapp you need to append this to the domain to get to it. If you set the context for myapp to the "root context" of / ipaddress:8080 will go straight there. You obviously can't have two applications both at / (assume you have only one).
If it's the 8080 you want to get rid of, you can run Tomcat on the default port of 80. You can only do this if nothing else is running on 80. If you enter just the ipaddress into your browser, and get a page not found error, port 80 is probably free.
In Tomcat's conf/server.xml file, change the port for the basic connector from the standard 8080 to 80 and restart Tomcat.
If you do both of the above, http://mydomain should take you straight to myapp.
Nick.
RE: configuring domain name to point to tomcat server
Thanks
Andy
RE: configuring domain name to point to tomcat server
For example, if it is serving two applications, and you ask it to give you the home page index.jsp, it can only do that if it understands which of the two applications you mean. You have to set the context of your request i.e. do you mean /myapp/index.jsp or /anotherapp/index.jsp ?
The context in your address is therefore the /myapp bit after the server:port bit. It's what tells tomcat which application to serve.
The context usually mirrors the location of the application, but it doen't have to. All of the following are valid possibilities (although not at the same time):
- context /myapp associated with application at %CATALINA_HOME%\webapps\myapp
- context /myapp associated with application at %CATALINA_HOME%\webapps\anotherapp
- context /xyz associated with application at %CATALINA_HOME%\webapps\myapp
- context / associated with application at %CATALINA_HOME%\webapps\myapp
If you set the context of myapp to / as in the last example, http://server:8080 will take you to your application, which is what I think you want(?).
You set the context when you deploy your application, and can change it afterwards. How you set and change it depends on how you deployed it, and you presumably know that.
RE: configuring domain name to point to tomcat server
http://localhost/test
Would you mind telling me how I deploy the applciation and set the context or point me in the direction of further information. Thank you.
Andy