Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Server root directory

 
Bitan Biswas
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • 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?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64700
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic