How to setup VPS with muiltiple Ips - one ip per site + SSL

Hi!

I’m setting up a new VPS and I need to be able to use multitple IP’s. 1 IP per domain with a SSL cert per domain.

Is this possible to somehow to set up?

John

The first thing to check is whether your VPS provider will give you multiple IPs for one VPS. I suspect not.

Yes they do provide multiple IP’s per VPS.

Huh, I learn something new every day!

I would try setting up your WordPress sites as normal in trellis/group_vars/staging/wordpress_sites.yml so you get something like

wordpress_sites:
  siteone.com:
    site_hosts:
    - canonical: stage.siteone.com
      redirects:
      - www.stage.siteone.com
    local_path: ../siteone
    // and all the rest of it 
  sitetwo.com
    site_hosts:
    - canonical: stage.sitetwo.com
      redirects:
      - www.stage.sitetwo.com
    local_path: ../sitetwo
    // and all the rest of it

Then in trellis/hosts/staging try using the fqdn for the vps not an IP address

# Add each host to the [staging] group and to a "type" group such as [web] or [db].
# List each machine only once per [group], even if it will host multiple sites.

[staging]
server1.agency.com

[web]
server1.agency.com

And then see how you get on.

AFAIK to use different IPs w/ different domains you would just do that at the DNS level: An A record that points IP 1 at domain 1, another A record that points IP 2 and domain 2, etc.

At the server level you shouldn’t need to do anything w/r/t IPs. The Let’s Encrypt SSL process in Trellis authenticates itself via the domain, so as far as I know you shouldn’t need to do anything special.

1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.