[Semibug] OpenBSD Shared Hosting
BCLUG
admin at bclug.ca
Wed Aug 2 06:34:56 EDT 2023
Josh Grosse wrote on 2023-07-30 16:57:
> On Sun, Jul 30, 2023 at 08:57:19AM -0600, Jonathan Drews wrote:
>> ...Now by shared hosting I mean one bare metal OpenBSD with one IP
>> address but two separate websites....
>
> Most web server software can serve multiple websites that happen to
> share the same IP address. Often called "virtual servers,"
In Apache land, they're called vhosts and in Debian-derived distros,
look in, for example, /etc/apache2/sites-available/your.domain.com.conf
for a vhost definition.
The directive `ServerName` can point to `yourdomain.com` with a
`ServerAlias` to `www.yourdomain.com` - a single extra config line to
catch both (`www` is really obsolete these days though).
Each vhost has a DocumentRoot pointing to the folder which would be the
"root" of the web site, and DirectoryIndex would indicate a list of
files to serve when that folder is traversed (i.e. whether an index.html
or index.php file would served).
It's handy to name your DocumentRoot folders the same name as the domain
they represent, i.e. /var/www/mydomain.com and /var/www/another.com.
nginx has different terminology and much easier configuration options;
if it's available, I'd recommend nginx.
> 2. Use your web server's software to configure each server. For
> httpd(8), there is an example of this in the httpd.conf(5) man page
> where two server configurations, for www.a.example.com
> and www.b.example.com, both listen to port 80 on 203.0.113.1.
You'll almost certainly want LetsEncrypt too, for easy & free https /
TLS encryption.
What do you plan to use to generate the actual web pages?
Do you plan on serving static HTML?
Are you familiar with "responsive design"? i.e. 3 column layout for
desktop monitors, 2 columns on small laptop screens, and single column
layouts for phones.
This can be achieved with a remarkably small amount of CSS and is highly
(*highly*) recommended.
Most major browsers have incredible web dev tools built in and allow one
to tweak & preview CSS settings; to see previews under various mobile
environments; to throttle networking to test performance; to analyze
request timing, wait timing, download timing, render timing, etc.
More information about the Semibug
mailing list