410 error... on some user agents

OK, so I'm hosting a site for a client. It's setup in as a vhost in apache2, same as my personal site. Both load fine in any modern browser… but a customer of my client called and said she was seeing a 410 error. I checked on several browsers and… nope, loads fine. So I installed lynx… and can provoke the error.

In looking at error.log and access.log Firefox, Chrome, etc all get a 200 return code and load things fine. However, lynx and the google webmasters bot do NOT. They get a 410 error.

The vhost setup isn't complex - here's the file for my personal site (things anonymized slightly):

ServerAdmin someone@somewhere.com

ServerName www.mysite.org

ServerAlias mysite.org

Indexes + Directory Root.

DocumentRoot /var/www/mysite/

DirectoryIndex index.html

Logfiles

ErrorLog /var/www/mysite/error.log

CustomLog /var/www/mysite/access.log combined

I can't see anything in Googling around that would explain this. Note that the main domain is fine - it does NOT suffer from this issue at all.

THought?

7 Replies

Bit weird…I'm thinking you have some sort of security software (mod_security perhaps?) that is blocking text based browsers i.e. lynx.

What's in your apache error logs?

Oddly there are no entries indicating an error in /var/log/apache2/error.log (well there's a lot of favicon errors and some hacking attempts but nothing resulting from loading the index.html file in Lynx). Nothing in the site error.log either (/var/www/mysite).

The access.log entries look like this:

[24/Sep/2010:12:00:39 -0700] "GET /index.html HTTP/1.0" 410 457 "-" "Lynx/2.8.7pre.6 libwww-FM/2.14 SSL-MM/1.4.1"

[24/Sep/2010:14:35:45 -0700] "GET /index.html HTTP/1.1" 200 378 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 1064; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.53 Safari/534.3"

I'm wondering if the 410 is due to the useragent using http 1.0? Very odd.

Can't see why http 1.0 would bring up a 410.

410 means "Gone" as in the page has been removed and links should be removed.

Do you have any security software installed that maybe interfering?

Try dropping apache's error logging down to DEBUG and access it, see if it splurts out more information.

I was googling around and saw some information about http 1.0 clients having issues with virtual hosts on Apache… and the 410 errors in the logs are all from 1.0 clients, none from 1.1. Example, http://httpd.apache.org/docs/2.0/vhosts/examples.html

"We have a server with two name-based vhosts. In order to match the correct virtual host a client must send the correct Host: header. Old HTTP/1.0 clients do not send such a header and Apache has no clue what vhost the client tried to reach (and serves the request from the primary vhost)."

I'll drop the error level to DEBUG though, that's a good idea. Thanks for the reply.

Interesting, I don't encounter that issue on my test ubuntu box

Here's an access log snippet:

192.168.56.1 - - [24/Sep/2010:18:15:43 -0700] "GET / HTTP/1.0" 200 23660 "-" "Lynx/2.8.7rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.7l"

Could you post the conf file for that virtual host (from /sites-enabled)?

Note that I don't get this on the main (default) domain, only on other vhosts. So the site that's listed as 000-default in /etc/apache2/sites-enabled is fine. It's other name based vhosts that are giving me an issue.

ServerName test.co.uk.local

Action php52-cgi /php52-cgi/php-cgi

AddHandler php52-cgi php5 php4 php php3 php2 phtml

ScriptAlias /php52-cgi /custom/php/bin

DocumentRoot /host/test/public_html

DirectoryIndex index.php

That's it and I'd thought I'd dump my apache modules too maybe there's something with one of those

Loaded Modules:

core_module (static)

mpmpreforkmodule (static)

http_module (static)

so_module (static)

rewrite_module (shared)

authzhostmodule (shared)

actions_module (shared)

mime_module (shared)

alias_module (shared)

dir_module (shared)

cgi_module (shared)

php5_module (shared)

logconfigmodule (shared)

Syntax OK

Note this isn't a standard ubuntu apache installation, I compiled it myself.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct