• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to configure tomcat to map fxbird.com to localhost:8080/myweb on tomcat 5.5 server?

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is a web app called /myweb which can run on the server, I want do some configuration so that fxbird.com can mapped to the web app. Port can't be set in C:\WINDOWS\system32\drivers\etc\hosts, but IP.
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First step is to have fxbird.com pointing at your server by setting it up at your domain admin (DNS setup)

Next you may need to add a new Host in Tomcat, like in my post in this thread: https://coderanch.com/t/502161/Tomcat/Disabling-http-sitename
 
Saloon Keeper
Posts: 27752
196
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
Actually, if the target is literally "localhost", DNS isn't a good choice. Add a line to the "hosts" file that maps "fxbird.com" to 127.0.0.1

You'll have to search around for the location of the hosts file. Windows sort of hacked it over from the LMHOSTS file and it's somewhere under one of the Windows system directories.
 
Kurt Xu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rene Larsen wrote:First step is to have fxbird.com pointing at your server by setting it up at your domain admin (DNS setup)

Next you may need to add a new Host in Tomcat, like in my post in this thread: https://coderanch.com/t/502161/Tomcat/Disabling-http-sitename



Hello guy:
I do as you said.
1)add map to C:\WINDOWS\system32\drivers\etc\hosts from 127.0.0.1 to fxbird.com, at the moment, http://fxbird.com:8080 can be accessed.
2) configure the server.xml, add relevant host stuff, add my web app called 'myweb' , but 404 error is thrown. www directory is in tomcat root directory , myweb stuffs is in www. It just doesn't work when the appBase is set to either www or www/myweb.
server.xml:


More neededly , I wanna port 8080 or any other port isn't around in the url, is there a way to do?
Thanks a lot.
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you put a ROOT folder into the www, or did you just put a myweb folder direct under www ???

Try rename the myweb folder to ROOT (if you just had put it direct into www) - and in ROOT your webapp should have a valid structure.

The new www folder is just a new additional webapps location, and will work like this (as I also wrote in the link I posted):

Call without a context path: sitename.com:8080 = www/ROOT
Call with a context path: sitename.com:8080/myweb = www/myweb

To change port 8080 to 80 - you just need to change it in this line <Connector port="8080" protocol="HTTP/1.1"

You also need to add www.fxbird.com to your hosts file if you want to be able to call you web site with this host name.>
 
reply
    Bookmark Topic Watch Topic
  • New Topic