in reply to Get data via HTTP on IP and specify virtual host

$ lwp-request -t1 -USEd -H "Host: Server1" http://127.0.0.1/ GET http://127.0.0.1/ Host: Server1 User-Agent: lwp-request/6.03 libwww-perl/6.03 500 Can't connect to 127.0.0.1:80 (timeout) Content-Type: text/plain Client-Date: Tue, 28 Feb 2012 18:56:44 GMT Client-Warning: Internal response

Replies are listed 'Best First'.
Re^2: Get data via HTTP on IP and specify virtual host
by locked_user sundialsvc4 (Abbot) on Feb 28, 2012 at 20:16 UTC

    That is quite interesting, Anonymous.   Would you, or someone else, please elaborate on this?

      Look in RFC 2616, for the Host: header. It's what makes multiple websites live on the same IP address/port combination.

        But the server side still needs to have some sort of config (e.g. the httpd.conf file) to process the "host" name in the header and point it to the right vhost. It doesn't need to be in the /etc/hosts, but there has to be some sort of incoming route handling.