File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Kurt Xu
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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: http://www.coderanch.com/t/502161/Tomcat/Disabling-http-sitename
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17626
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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: http://www.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
Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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.>
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic