Centos webserver to not show ip address

I have a tomcat 5 instance running on Centos 5.4. The web app works fine.  Centos is on a static IP address in DMZ. Registered the host name with a hosting company as
  When you go to the IE and type www.mywebserver.com  it goes to the webapp and first pages comes up fine. The problem is when I click on any link on the web page that is within the site, It address bar changes itself to the IP address of the server which I dont want it to do. I do not want to use domain masking from the registering company either because it hides the url string which causes certain pages to fail.  Need Help.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I think your tomcat is where the problem is at, not the OS. Configure tomcat to use hostname instead of ip address, sorry i can't remember how to do it. It's a start though.

Good luck
I think it's the webapp itself. What app is this? Many of them have a config parameter to enter the hostname to use (for links and whatnot) and if you leave it blank or fill it in wrong the links go screwy. I've seen it with a bunch of java webapps.
Set the context path correctly in your web.xml file present in WEB-INF folder
What were the top attacks of Q1 2018?

The Threat Lab team analyzes data from WatchGuard’s Firebox Feed, internal and partner threat intelligence, and a research honeynet, to provide insightful analysis about the top threats on the Internet. Check out our Q1 2018 report for smart, practical security advice today!

DigitaleyeAuthor Commented:
Hi Shaunak:
   Do you have any example or weblink.  Thanks for checking into it.
DigitaleyeAuthor Commented:
I have checked the web.inf file and it is setup correctly. The webapp works great. What do you think of this article.

I have not done the steps above. I just went to Go daddy and forwarded the domain name to my IP address. Do you think I need that setup for my web server as well?
Nope. That is Not required.
When you have a apache-tomcat setup, normally apache handles all types of files except for jsp. Whenever there is jsp request apache internally forwards the request to tomcat thru 8009 port with the help of Coyote/JK2 AJP 1.3 Connector

So I think in your server.xml file in $TOMCAT_HOME/conf there must be something like
<Alias>IP</Alias> in the <Host name="domain.com" schema. Just check with that and try altering that server.xml file.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DigitaleyeAuthor Commented:
Thanks everyone for looking into it. The problem was actually on the go daddy side. They were resolving the name to IP address. It is all good now.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.