×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

configuring domain name to point to tomcat server

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

RE: configuring domain name to point to tomcat server

Andy,

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

(OP)
Great Thank You.

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

Andy,

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

(OP)
I am sorry but I do not understand what you mean by "setting the context". Could you explain?

Thanks

Andy

RE: configuring domain name to point to tomcat server

Remembering that Tomcat can serve multiple applications from a single server, it can only service a request if it understands the "context" of the request.
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

(OP)
I understand what you mean. However I am afraid that I did not set any context when I deployed my application. In fact I may not actually have deployed my application. All I have done is create an application under the following address

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close