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

Server root directory

Bitan Biswas
Greenhorn

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

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?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bitan Biswas
Greenhorn

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

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://zeroturnaround.com/jrebel
 
subject: Server root directory
 
Similar Threads
Difference between URLs: /? and /login?
Session gets null when mapping the url
sendRedirect(...) to a page inside a .war file
Session gets null on mapping the application
Url gets changed on mapping