• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Can we do this

 
Ranch Hand
Posts: 69
MySQL Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Ranch Hand
Posts: 384
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please post servlet related posts only in servlet forum
 
Marshal
Posts: 22453
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic