2

Situation and problem

I have an Ubuntu Server 14.04 VPS, and want to host multiple sites on it, all with distinct domains:

  • A wordpress installation (PHP + MySQL)
  • A simple PHP site, no database
  • A Discourse installation. Discourse is based on Ruby on Rails

Each site has a distinct domain name. When I search for multisite setups, I mostly find guides to specific servers, for instance how to setup multiple Discourse forums on a single server. I have a feeling this is really a common problem, I'm just asking the wrong question.

My current understanding of the problem is that

  • A domain points to a single IP address
  • A server can listen on a single port
  • A server can retrieve the domain name from the request header

Solution?

This leads me to the impression that a solution could be

  1. A thin server listening on :80 and :8080 looks up domain name and delegates the request
  2. Each site runs on the server listening on other ports, and delivers the required site

Intuitively this seems like a basic problem

Questions

  • Am I on the right track?
  • Are there lighter alternatives to Apache for the delegation?
Teodor
  • 123
  • 2
  • A solution that allows hosting other web servers in addition to the Discourse installation is using a [layered NGINX setup](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247). – Teodor Jun 02 '16 at 20:29

1 Answers1

0

From the current description I do not see why a standard virtual host setup in Apache (or indeed whatever your favourite HTTP server is) would not work.

Start by reading about name based virtual hosts here: http://httpd.apache.org/docs/current/vhosts/name-based.html which should give you the "three hosts with distinct domains" part.

The execution of PHP and ruby can be configured on a virtual host basis, but the exact configuration will be installation and application dependant.

Unbeliever
  • 2,286
  • 1
  • 9
  • 17