0

First off, let me start by saying I am no expert in server talk. I've been teaching myself as I go along, and I really only know entry level basics to server management.

I am trying to consolidate all of my many single instance VPS's and put them into a single VPS with managed containers that hold their own privileged root access (in container).

Each VPS I currently have runs a simple stack for serving WordPress.

  • Ubuntu 18.04 LTS
  • PHP/7.2
  • MySQL
  • Caddy HTTPS/2 server engine

My current VPS is $5 a month and comes with:

  • 01GB RAM
  • 25GB SSD (I only need under 10GB)
  • 01vCore
  • 01TB Bandwidth (I do not touch this, my site pages are small under ~0.8 mb for dense pages and low traffic)

For me, these resources are great. But running close to 10 websites is around 55$ a month (Vultr) . Instead, I would like to try out a service (SSD Nodes) that is offering these specs/price:

  • 16GB RAM
  • 80GB SSD
  • 04 vCores
  • 8.0TB Bandwidth
  • 40GB I/O

The price for this service varies but is usually under $15 a month if you pay up-front, which I wouldn't mind doing.

I would use this single VPS to run Ubuntu 18.04 and then use LXD/LXC to provision containers that can then house each website individually.

Each container can then be limited to whatever resources I would like (within the single VPS limits). This would save me money, allow me room for more websites/projects down the road, and create a more manageable interface for maintenance.

Here's a sample overview of what I'd like to accomplish.

  • Host Machine ----> Ubuntu 18.04

  • [container01] ----> WordPress Site A

  • [container02] ----> WordPress Site B
  • [container03] ----> WordPress Site C
  • [container04] ----> WordPress Site D
  • And a
  • [snapshot of clean stack install for easy resetting/re-deployment]

I have tried this set-up in a local test environment as well as a test live environment (on Vultr) and I cannot seem to find a fix for my issue.

My only issue with trying this set-up is that I cannot get my newly created containers to be passed through the main IP address to be able to access each container publicly. I created each container and changed the default bridge to utilize 'macvlan' which effectively assigns them 'physical' addresses. However, these 'physical' addresses are only useful for internal use as they are '10' based IP addresses and cannot be accessed publicly.

This is where I get lost and I have not been able to find a solution online.

Would anyone here be able to advise me in this particular case? Or do I have to scrap this whole idea since it just would not work?

Also, side note. I do not want to run the servers using Docker, Kuburnetes or Nginx multi website managers. I would favor the containerization so I can test new projects or sites individually as I learn more.

Thank you,

1

You need to dedicate a single LXD container to proxy those HTTP (or even HTTPS) requests to the corresponding containers with the WordPress installations.

First, create a proxy container and get your host to forward connections to port 80 (web) to port 80 of that proxy container. You can do the forwarding with either iptables or, if you use LXD 3.0, with the LXD proxy device.

Second, in this proxy container install a suitable http proxy. Examples are HAProxy (see https://www.digitalocean.com/community/tutorials/how-to-host-multiple-web-sites-with-nginx-and-haproxy-using-lxd-on-ubuntu-16-04), nginx as reverse proxy, or even caddy (see https://gist.github.com/turtlemonvh/1e6dc4621202b2c1a8c4).

Third, each WordPress website needs a database. It would be overkill to install MySQL/Mariadb on in each WordPress container. You might consider creating a db container with the database, and then create different account in the database for each website.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.