File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can we do this

 
Arpit Gadle
Ranch Hand
Posts: 69
Linux MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...
I hope this is the right place to post this question.

I have small applications running locally on my system

1. http://localhost:8080/firstapp
2. http://localhost:8080/secondapp
3. http://localhost:8080/thirdapp

What I want is

instead of using http://localhost:8080/somewebapp to run a webapplication

can i run it as

something.firstapp.com
something.secondapp.com
something.thirdapp.com

locally


Regards,
Arpit


 
Lalit Mehra
Ranch Hand
Posts: 384
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please post servlet related posts only in servlet forum
 
Rob Spoor
Sheriff
Pie
Posts: 20381
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agreed. I'll move it there.

Note that something.firstapp.com, something.secondapp.com and something.thirdapp.com require three domains. Perhaps you can better switch it around: firstapp.something.com, secondapp.something.com and thirdapp.something.com. You only need to register something.com and turn the others into sub domains.

After that perhaps Apache's HTTPD server with mod_proxy or URL rewriting can help you out. I don't know the exact details, but you can find more information on Tomcat's website. In short, you put an Apache HTTPD server on port 80 in front of Tomcat. The requests go to this HTTPD server which forwards the requests (completely transparently) to Tomcat, which handles them and sends the responses through HTTPD back to the user.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the easy way to do this locally is to map the domains to the loopback IP in your hosts file

127.0.0.1 yourapp.something.com

Then all requests to yourapp.something.com will result in the request being sent to your local machine.
Next step is to configure the Tomcat container so that requests to the yourapp.something.com host get sent to the correct web app, which you do by adding a virtual host to tomcat

Yes, Rob's is the better solution for live systems. My answer above is what I do when i want to simulate multiple domains locally
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic