It used to be pretty simple for me to set up a VirtualHost to test a new php webapp, for this http.conf:

NameVirtualHost *:80

<VirtualHost *:80>
        DocumentRoot /opt/webgrind/www
        ServerName webgrind
<VirtualHost *:80>
        DocumentRoot /opt/opencart/www
        ServerName opencart

I just needed to restart the service and access: http://webgrind/ or http://opencart/ (without changing anything in /etc/hosts)

But something changed in the server (CentOS 6) and now the error.log states:

[error] avahi_entry_group_add_service_strlst("opencart") failed: Invalid host name
[error] avahi_entry_group_add_service_strlst("webgrind") failed: Invalid host name

And when accessing http://webgrind/ I get a page ofline error. Any ideas?

Server version: Apache/2.2.15 (Unix) Server built: Dec 8 2011 18:10:49

  • have you try to use fqdn in you server name when you are configuring apache virtualhosts? – c4f4t0r Jan 10 '15 at 8:09

Since this question is the first that shows up when searching for "AH02415: [strict] Invalid host name", I will add an answer to document the time I wasted today because most of the virtual hosts in my development machine stopped working (e.g. shop_one.web).

I had Apache updated to version 2.4.16-18.1 and apparently HttpProtocolOptions now defaults to Strict, thus rejecting my local hostnames that have '_' (underscore) in them (and probably those of the OP).

I know they are not proper hostnames, but for local/personal use never hurt anybody, so I added the line:

HttpProtocolOptions Unsafe

to my default-server.conf and life is back to what it was before. See also:




Configuring a virtualhost in apache does not make the name resolution service on the server know about it, so you would either have to update /etc/hosts, or do something like:

curl -H 'Host: webgrind'

to override the default behavior.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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