• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Help needed in tomcat deployment

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Saloon Keeper
Posts: 28430
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 7388
1412
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Exam Flux", please check your private messages regarding an important administrative matter.
 
Vivek Bhatt
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Don't mess with me you fool! I'm cooking with gas! Here, read this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic