Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

in our office, we have a web application running. When we access the application by the domain name, http://server.domain.com/application/name it will display the current version of application.

However, when we go by the IP address, http://192.168.1.111/application/name it will display the old version of that application. One thing is that we can access that application either by http://server.domain.com/ (it will be redirected to the long URL automatically) or http://server.domain.com/application/name when we are using domain name.

But only accessible via the exact URL when we use IP address. Why is it showing the old version and how can it be corrected? It is running JRun4, Apache on Red hat. I've checked in httpd.conf a bit but could not find any. Please advice what should be done to display the same (updated version) when we access using domain name or IP address. Thank you.

share|improve this question
    
what ip is reported by the command host server.domain.com? –  Serge Oct 12 '12 at 2:48
    
I am only using windows. if host command is similar to nslookup, the IP I get is 192.168.1.111. –  h82 Oct 12 '12 at 6:18

1 Answer 1

It most likely has to do with your name-based virtual host (vhost) configuration. When accessing your web server using your domain name, the web server finds the vhost configured with that domain name. Accessing it by IP address, the web server uses the default (_default_ in Apache) vhost.

Search your Apache configuration for <VirtualHost ...> blocks.

share|improve this answer
    
In my httpd.conf, 3 VirtualHost are associated to that IP address. The first VirtualHost entry is another.domain.com. When I tried http://another.domain.com/application/name, it displayed the same page like the http://192.168.1.111/application/name. Is there a way to change in httpd.conf so that domain and IP access display the same content? –  h82 Oct 12 '12 at 6:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.