Discussion:
Serving multiple domains on one machine or IP address
Greg Garrison
2017-09-19 05:17:47 UTC
Permalink
Hi,

I am interested if I can serve multiple domains from one machine using
HTTPD and possibly VMM and RELAYD. I would prefer if there was a
solution just with HTTPD is order to KISS. If it is really painful I'll
just role more servers.

I am running OpenBSD on a VPS. I have 3 to 5 web sites (separate
domains) that I want to serve. They are all very small traffic at this
time. I would rather run them on one VPS than each on its own because it
would be cheaper, until traffic increases. My VPS provider can provide
three external IP addresses in the form of one + two aliases for a
single (virtual) machine. Is it possible to configure HTTPD to reply to
queries for site1 on IP1 and site2 on IP2 and site3 on IP3, for example.

Additionally I notice that the default client HTTP error messages (e.g.
404 error) that HTTPD generates reveal that the server is running
OpenBSD. This is not a big deal but if the error messages were
configurable so that they could mask the server OS or could display an
otherwise custom message I would see value in that. Does this capability
exist with without recompiling HTTPD?

Thanks,

Greg
Niels Kobschaetzki
2017-09-19 05:46:58 UTC
Permalink
<snip>
Additionally I notice that the default client HTTP error messages (e.g. 404 error) that HTTPD generates reveal that the server is running OpenBSD. This is not a big deal but if the error messages were configurable so that they could mask the server OS or could display an otherwise custom message I would see value in that. Does this capability exist with without recompiling HTTPD?
Being curious: Why do you want to mask the server-OS in the error message?

Niels
Simen Stavdal
2017-09-19 05:54:04 UTC
Permalink
Hi Greg,

I haven't done this myself, but take a look at the man pages of httpd.conf
under the servers sections.
You can create multiple a-records pointing to the same ip address, and then
pick up the incoming traffic by inspecting the http header in order to find
which virtual server to send the traffic.

Simon.
Post by Niels Kobschaetzki
<snip>
Post by Greg Garrison
Additionally I notice that the default client HTTP error messages (e.g.
404 error) that HTTPD generates reveal that the server is running OpenBSD.
This is not a big deal but if the error messages were configurable so that
they could mask the server OS or could display an otherwise custom message
I would see value in that. Does this capability exist with without
recompiling HTTPD?
Being curious: Why do you want to mask the server-OS in the error message?
Niels
Nick Holland
2017-09-19 11:58:05 UTC
Permalink
Post by Greg Garrison
Hi,
I am interested if I can serve multiple domains from one machine using
HTTPD and possibly VMM and RELAYD. I would prefer if there was a
solution just with HTTPD is order to KISS. If it is really painful I'll
just role more servers.
I am running OpenBSD on a VPS. I have 3 to 5 web sites (separate
domains) that I want to serve. They are all very small traffic at this
time. I would rather run them on one VPS than each on its own because it
would be cheaper, until traffic increases. My VPS provider can provide
three external IP addresses in the form of one + two aliases for a
single (virtual) machine. Is it possible to configure HTTPD to reply to
queries for site1 on IP1 and site2 on IP2 and site3 on IP3, for example.
yep. You can run them all on one IP address. I run eight on mine.
Name based hosting.
"man httpd.conf", look for "server name {...}"
Heck, look at the examples there. Did you look at the man page?

You can use multiple IP addresses, too. man page again provides all the
details.

Not quite so explicit in the man page -- you can even run multiple https
websites on one IP address. It Just Works. Most of my eight have a
Let's Encrypt cert.
Post by Greg Garrison
Additionally I notice that the default client HTTP error messages (e.g.
404 error) that HTTPD generates reveal that the server is running
OpenBSD. This is not a big deal but if the error messages were
configurable so that they could mask the server OS or could display an
otherwise custom message I would see value in that. Does this capability
exist with without recompiling HTTPD?
Not seeing that in the man page.
I see no benefit in hiding the OS name. Kinda like showing up at a
knife fight, and when asked what kind of knife you have, you answer,
"M1A1 Abrams". There's no harm in that. Custom 404 page? sometimes fun.

Nick.

Loading...