I have an web application server running tomcat and i need to publish my APIs to internet users. However I don't have a domain name for this server and I can only put the ip address of this server (e.g. 145.XXX.XXX.XXX) to point out where my API xml files are located.

I have another web server running with a domain name "http://www.webserver.com" registered on the internet and I want to make use of its domain name to server my web application server API xml files location. How can I do that? using "www.webserver.com/api" or using "api.webserver.com"? which is better?

Also I wonder if I want to publish a "rstp://145.XXX.XXX.XXX" web link for video streaming purpose, can I use "rstp://www.webserver.com/api" to replace it and how to do it? I always thought the url contain domain sub-directory name cannot point to another IP address, it only can point to another folder location on the webserver itself.

1 Answer 1


I don't think you can do this with a subdirectory, since you'd only be able to do a redirect and that is not what you require. As you mention, a sub directory cannot point to another IP address.

However, you could perhaps use a subdomain, of the form http://api.webserver.com and set up a DNS "A" record for this subdomain in the webserver.com DNS zone that points to the alternative IP address. For example:

api.webserver.com. 14400 IN A 145.XXX.XXX.XXX
  • Actually I thought the same way but I just need a bit confirmation on this. Looks like I have to convince my IT network team to give me a subdomain address then.
    – Xianlin
    Apr 15, 2012 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.