Help! 400 Bad Request for my virtualhost...

They have: 5,633 posts

Joined: Jan 1970

I've been trying to setup two virtualhosts. After some other trials and travails, I now, I get the following error when I try to connect to one of my virtual hosts in a browser:

>> 400 Bad Request
>> Your browser sent a request that this server could not understand.
>> Reason: You're speaking plain HTTP to an SSL-enabled server port.
>> Instead use the HTTPS scheme to access this URL, please.

My VirtualHosts configuration is now:

NameVirtualHost *

ServerName domain1.com
DocumentRoot /var/www/html/ch
ServerSignature email
Loglevel warn
HostNameLookups off

DirectoryIndex index.php index.html index.htm
Options +Indexes Multiviews FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Deny from none

I have tried setting the ../ch directory and contents to be owned by root.root, apache.apache, nobody.apache, nobody.nobody and it makes no difference. The dir and files are all chmodded to 777. Is this some default security in RedHat 9 that I need to turn off or something? Help!

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

What I would do is just make it a process of elimination. Start off by removing the directive, make it pretty simple with just a Servername and a DocumentRoot, then see if that works. If it does, try adding the directory directive back one piece at a time to see when you get the error.

I would also look in your error logs to see if there is anything in there. It isn't a permission error so chmod'ing to 777 is not going to change things.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

They have: 20 posts

Joined: Oct 2003

Can you access it when you use https instead of http?

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.