Interests: programming, video games, anime, music composition

I used to be on kbin as e0qdk@kbin.social before it broke down.

  • 0 Posts
  • 1 Comment
Joined 11 months ago
cake
Cake day: November 27th, 2023

help-circle
  • You can do this by configuring an HTTP server (e.g. Apache) to listen on port 80 and/or 443 (HTTP and HTTPS standard ports, respectively) and select which site to serve based on the name of the site requested. Apache documentation for this feature is here: https://httpd.apache.org/docs/2.4/vhosts/name-based.html

    Note the sample config snippet showing how to set up a simple static site serving both www.example.com and other.example.com using ServerName in a VirtualHost to select between them.

    You can also have Apache match a pattern in the URL and reverse proxy to another HTTP server – that can just be another program on the same computer listening on a different port, or could be on another computer entirely. See the simple reverse proxy config example on this page for a starting point: https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html (Note also that you probably don’t need anything further down that page – e.g. the load balancer and failover stuff is not likely to be useful to you for a small personal project.)

    Other popular HTTP servers can do this too; I just happen to have done it with Apache before.