File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Server root directory

Bitan Biswas

Joined: Aug 05, 2011
Posts: 12
Need Some Guide here,

I have a java enable domain (suppose and I have uploaded a .war file in this domain ( suppose example.war), So the web application is executing in link. Now my question is, is it possible to execute the web application in only link?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

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] [About Bear] [Books by Bear]
Bitan Biswas

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: 17410

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Server root directory
It's not a secret anymore!