[GTALUG] Problem new virtual host

D. Hugh Redelmeier hugh at mimosa.com
Fri May 1 11:33:53 EDT 2020


I'm a bit confused.  But I'm probably not the only one.
Note: I've never set up a virtual host so I could be way off-base.

As I understand it, the way virtual hosting works is that
each client request includes a URL, and Apache extracts from the
domain portion which host is being addressed.  If the URL uses an IP
address instead of a domain name, this mechanism cannot work.

| From: Stephen via talk <talk at gtalug.org>

| On 2020-04-30 4:46 p.m., James Knott via talk wrote:
| > What happens if you use the host command?  You can also use the host command
| > with the IP address, to see what host name shows up.  What happens if you
| > use the IP address with a browser?

Using "host 1.2.3.4" will do a lookup of the IP address in the reverse
domain.  That's useful to know but it doesn't *seem* relevant with a
virtual host problem (where multiple forward domains can map onto the
same IP).

Using the IP address of a virtual host isn't likely to work out well
since multiple virtual hosts have the same IP address.

The problem is more likely to be in the forward domain.

| The host command without an argument gives me a help listing.

Not useful unless you need help.  That's not what James asked you to
do.

| The host command with my server's local IP address gives me a list of all
| virtual hosts listed in my hosts file.

By "hosts", I assume you mean /etc/hosts and not some Apache file.

On what machine did you run this?  On the server?  On the computer on
which your browser is running?  Related question: have you added this
entry to /etc/hosts on both your client(s) and your server?

For the problem you've reported, I would think that the result on the
client machine is all that is interesting.

By default, I've heard that Firefox has switched to using DNS over
HTTPS.  If your browsers have done so, they might well be ignoring
/etc/hosts.

Try the links browser: that surely uses the vanila resolver

| Entering my local IP in a browser gets me to Gerbera's control panel.

Now we know that you're running Gerbera on your server.

I don't know how Apache picked Gerbera as the default.  But you
probably don't care anyway.  Or maybe you should change the server's
setup so it defaults into something innocuous.


More information about the talk mailing list