aspose file tools*
The moose likes Tomcat and the fly likes Server root directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Server root directory " Watch "Server root directory " New topic
Author

Server root directory

Bitan Biswas
Greenhorn

Joined: Aug 05, 2011
Posts: 12
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

Joined: Jan 10, 2002
Posts: 61010
    
  65

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?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bitan Biswas
Greenhorn

Joined: Aug 05, 2011
Posts: 12
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

Joined: Jun 25, 2001
Posts: 16014
    
  20

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Server root directory