Originally Posted by spice_prash
I am getting error 400 while accessing my website from its ip address. If I am using its fqdn name then it opens, otherwise giving me 400 error.
If you're configured to use name-based virtual hosting, what you are seeing is the server choosing the wrong (in your opinion) document root.
Apache is listening on one IP address. Your web browser connects (and this is how HTTP/1.1 works -- so this is most every web access for every web server everywhere) and specifies the 'hostname' as one of the headers. This is how apache can figure out which of N web site configs to use to service requests arriving one IP.
So when you go to http://a.b.c.d
your browser puts a.b.c.d in the hostname header. And apache is not using the vhost configuration you want it to. It's hairy to get it just right... If you only have *one* web configuration (just one web site) then just pull your document root config command out of the virtual host container. done.
If you have multiple web sites; you cannot fix the problem. What we do is make a tiny little web site with white nothingness and put that document root in the main config. Then we go on to virtualhost config all the web sites that are name based vhosting on the box. HTTP/1.1 request that specify a hostname get served from the right doc root. HTTP/1.1 requests with just the IP in the hostname header get the dummy/blank docroot's content. c'est la vie.