aspose file tools*
The moose likes Tomcat and the fly likes DNS and Web Application Resolution Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "DNS and Web Application Resolution" Watch "DNS and Web Application Resolution" New topic
Author

DNS and Web Application Resolution

Ron Ingram
Ranch Hand

Joined: Mar 11, 2011
Posts: 63
Hello,

I've registered a domain and have godaddy hosting setup. The problem is, the dns entry points to the actual static IP address to the server and in order to get to the web app, I have to add :8080/Folder

So I want access to my site by typing www.domainname.com and it point directly to my site. Worse case scenario, I would like the port 8080 requirement in the URL to be omitted.

Please help, thanks
Karthik Shiraly
Ranch Hand

Joined: Apr 04, 2009
Posts: 513
    
    6
Is it a shared server, or is it a virtual/dedicated server?
On a virtual/dedicated server, you can change Tomcat connector port to default HTTP port 80 (edit server.xml), and change your webapp folder name or WAR name to "ROOT".
If it's a shared server, it's best to ask the hosting helpdesk.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

DNS only resolves the hostname. If you don't provide a portname explicitly on a URL, the web browser tries port 80 (http) or 443 (https).

There are 2 ways to simplify user-supplied URLs.

1. Employ a proxy such as Apache httpd web server to forward simple port-80 requests to the Tomcat server, rewriting the URL as needed.

2. Setup Tomcat to serve port 80 and make the webapp be the root webapp (warning: this is a security risk!).


Customer surveys are for companies who didn't pay proper attention to begin with.
Ron Ingram
Ranch Hand

Joined: Mar 11, 2011
Posts: 63
Thank you to both for your time. I will apply it all today.

Karthik Shiraly
Ranch Hand

Joined: Apr 04, 2009
Posts: 513
    
    6
Tim Holloway wrote: (warning: this is a security risk!).

I was not aware that deploying tomcat as a front facing server is a security risk. Can you please elaborate how it is so? Is fronting with httpd the only solution to those risks?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

Karthik Shiraly wrote:
Tim Holloway wrote: (warning: this is a security risk!).

I was not aware that deploying tomcat as a front facing server is a security risk. Can you please elaborate how it is so? Is fronting with httpd the only solution to those risks?


Tomcat itself is quite secure. However, unlike Apache httpd, Tomcat cannot serve up port 80 or 443 without running as root. which means that if someone does exploit Tomcat, they pretty much own your server. Apache httpd starts as root in order to obtain those (protected) ports, but normally then drops down and operates under a more restricted userid.
Karthik Shiraly
Ranch Hand

Joined: Apr 04, 2009
Posts: 513
    
    6
Thank you, Tim.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DNS and Web Application Resolution