File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Help needed in tomcat deployment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Help needed in tomcat deployment" Watch "Help needed in tomcat deployment" New topic
Author

Help needed in tomcat deployment

Vivek Bhatt
Greenhorn

Joined: Mar 19, 2010
Posts: 2
Hi All,

I have just joined the forum and I am not sure what I am gonna ask, had already been discussed (may be many times).

I need help on to deploy an application on tomcat. I have hosted a website on internet using one hosting provider and I am currently accessing it using
ip address and port... something like http://123.456.789.012:<port>/abcd/xyz.html

server is tomcat 6.0.24 & application is on java+struts2+mysql.

I have also registered a domain name for this would be site (say www.mywouldbesite.com)

I am not able to setup this domain name on my tomcat server so that I can access the website using www.mywouldbesite.com and not
using IP address and port, http://123.456.789.012:<port>/abcd/xyz.html

I have never been part of any deployment on internet.

Can anyone help me on this on how to make it work?


Thanks,
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

Welcome to the JavaRanch!

To permit your website to be findable by name, you have to get an entry in the "Internet phone book", which is Domain Name Services. That means that you have to purchase rights to the domain name "mywouldbesite.com" from one of the domain name registrars such as Verisign or GoDaddy. You can also buy the name though your ISP in many cases. That will give you the rights for "mywouldbesite.com" for a specified number of years, after which you'd have to renew the name, since it's really only rented, rather than purchased. And, of course, you have to have a domain name that no one else holds the registration on.

Once you've done that, you have to get the actual host IP address bound to a host name in that domain. Typically, that hostname would be "www" for the web host, but it doesn't have to be. This binding is done in the nameserver(s) that are registered with your domain name. Often your ISP will provide that service, although there may be a small fee.

Next, to get the port number off the URL, you'll have to do some work yourself. When a user enters a URL that doesn't have an explicit port number on it, and the protocol part of that URL is "http:", the client will assume port 80. So you'll need to make your webapp respond on port 80. You can do that by either changing the ports used by Tomcat (from 8080 to 80) or by proxying through another server, such as apache httpd.

Finally, to get the web application context name out of the URL, you'll either need to install it under the root context ("/") or, if you're using a proxying system, use the proxy rules to direct from the raw URL to the tomcat context.

I prefer the proxying approach, since Tomcat can only have one root context, but Apache can easily make multiple webapps each look they're at a root level. Plus it allows me to add non-J2EE resources to the overall webserver picture if I like.


Customer surveys are for companies who didn't pay proper attention to begin with.
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3019
    
  35

"Exam Flux", please check your private messages regarding an important administrative matter.


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
Vivek Bhatt
Greenhorn

Joined: Mar 19, 2010
Posts: 2
Hi,

Thanks for your inputs.

I have got the domain registered and made the payments. I can use it.

I am using port 7001 to access this application and it works well if I use it using IP address.

I am struck after this as I don't know what configuration shall I keep in server.xml. Can someone help me with deployment example which will
map www.<mywouldbesite>.com to that ip address and its port.

If any other info is required, please let me know.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help needed in tomcat deployment
 
Similar Threads
Displaying IP Address instead of domain name on url
Deploying WAR file Weblogic 8.1
How to change application url?
Tomcat 6 + jdbc + Oracle
Setup website at home