| Author |
How to configure tomcat to map fxbird.com to localhost:8080/myweb on tomcat 5.5 server?
|
Kurt Xu
Ranch Hand
Joined: Sep 29, 2009
Posts: 32
|
|
|
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
Joined: Oct 12, 2001
Posts: 1177
|
|
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
|
Regards, Rene Larsen
Dropbox Invite
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 11740
|
|
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.
|
A lot the of modern-day software development platforms are designed to permit parcelling out work to those with the best aptitude for it. A lot of modern-day business is predicated on making one person do all the work, regardless of aptitude.
|
 |
Kurt Xu
Ranch Hand
Joined: Sep 29, 2009
Posts: 32
|
|
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
Joined: Oct 12, 2001
Posts: 1177
|
|
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.>
|
 |
 |
|
|
subject: How to configure tomcat to map fxbird.com to localhost:8080/myweb on tomcat 5.5 server?
|
|
|