• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Server root directory

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Need Some Guide here,

I have a java enable domain (suppose www.example.com) and I have uploaded a .war file in this domain ( suppose example.war), So the web application is executing in www.example.com/example link. Now my question is, is it possible to execute the web application in only www.example.com link?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That has to do with how you configure the server, not with how you write your code. What servers are you using? Tomcat? Tomcat with Apache? Other?
 
Bitan Biswas
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I am using tomcat 7.
in localhost the project is running under http://localhost:8084/example link for example.war.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Tomcat, you can do this by replacing the default webapp in the root context with your own webapp. However, unless you also change Tomcat's port assignments, you'd still have to have the ":8084" in your URLs. And if you reassign Tomcat to port 80, most OS's will demand that Tomcat be started as a privileged user, which means that the system will be less secure.

A popular alternative is to front Tomcat with a proxy server such as Apache httpd. The proxy server can listen on port 80/443 safely (usually) as well as translating from a virtual host root to a Tomcat non-root context.
reply
    Bookmark Topic Watch Topic
  • New Topic