LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 01-23-2008, 09:28 PM   #1
spice_prash
LQ Newbie
 
Registered: Nov 2006
Posts: 14

Rep: Reputation: 0
Apache giving 400 Error !!


Hey Fellas,

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.

Can anyone help me out ??
 
Old 01-23-2008, 10:38 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
A 400 error is a syntax error in the request. If you're not using the FQDN, what are you using to access the server when the error occurs?

Can you also post your httpd.conf file as well as any relevant info from the access and error logs?
 
Old 01-24-2008, 08:47 AM   #3
cconstantine
Member
 
Registered: Dec 2005
Distribution: RedHat, Ubuntu
Posts: 101

Rep: Reputation: 15
that's just how it works...

Quote:
Originally Posted by spice_prash View Post
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.

-c
 
Old 01-25-2008, 12:00 AM   #4
spice_prash
LQ Newbie
 
Registered: Nov 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Thankx man ...

That really helps...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache giving the error :Could not determine the server's fully qualified domain name bcf2 Linux - Server 46 10-15-2013 03:45 AM
I'm getting an error 400 (Bad Request) jim.thornton Linux - Server 1 01-19-2008 11:42 PM
Apache, IP based VirtualHosts and 400 error ipslave Linux - Server 2 06-06-2007 06:28 AM
why is apache giving me a 404 error linuxmandrake Linux - Software 4 06-17-2005 09:16 AM
Apache 1.3.20 close connection on HTTP 1.1 400 500 errors dafri Linux - Software 4 01-14-2003 08:50 AM


All times are GMT -5. The time now is 08:49 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration