-1

Looking for some advice. This is my first time having to manage my own server and I'm having to connect a lot of dots.

I currently have around 10 websites on an inmotion shared hosting account. For a number of reasons, I've decided to time to migrate them into a cloud account on either AWS or GCP.

Here's what I'm trying to achieve: - I want to have one server where I can launch multiple websites from. - Some of the websites need to have different IPs from the other sites. (I'm looking to have a combination of IP-based virtual hosts and name based virtual hosts on the same server. Is this possible?) - I want to be able to scale the instance on the fly if traffic for one of the sites picks up.

My initial attempt at this was to try to set it up on GCP, however this isn't going great. I'm finding that there are less tutorials and documentation online for GCP than for AWS and I'm frequently getting stuck.

I'm currently unable to get root access with the default SSH account which is making it impossible to create the virtual servers. I guess my questions are the following:

  1. Is there a more "out of the box" solution with AWS or GCP? Like a preconfigured instance that will allow me to do this?
  2. What OS should I be running on these servers? The default for GCP was Linux but this is proving to just put another barrier between me and what I'm trying to achieve.
  3. Any ideas on why the default SSH account on GCP doesn't have root access?

Thanks in advance for your help!

Tim
  • 31,888
  • 7
  • 52
  • 78
alexforyou
  • 91
  • 1
  • 2
  • 9
  • 2
    Why do you need different IPs? If your concern is SSL, it's a mostly outdated concern only applicable in rare cases like weird user bases with lots of Windows XP users. – ceejayoz May 24 '17 at 21:05
  • 2
    Re: root access, you should be able to run commands as root via `sudo`. You shouldn't be SSHing in as the root user on AWS, GCP, or anywhere else for that matter. – ceejayoz May 24 '17 at 21:06

1 Answers1

2

Do you really need multiple IPs? That's not particularly common. However it's not particularly difficult, but I've read can be a little fiddly or tricky to get working properly.

  1. No, this isn't a common scenario, so there's unlikely to be anything that will do it out of the box.

  2. Ubuntu is the best documented and has the most help available.

  3. Probably for security.

I know AWS, not Google, so I can't say which is better for you. I have a few thoughts for you:

  • On AWS you can attach multiple elastic IP addresses to an instance. From what I've read it can be fiddly to get the return traffic back to the correct interface.
  • I assume you want to "host" multiple websites, not "launch" them.
  • On AWS you can scale vertically (a larger machine), but you need to take the server down for a short time to do this. A better approach is to scale horizontally. This requires a load balancer, which costs around $20/month from memory. You also need to have your server saved as an AMI (machine template) or scripted to be built with Puppet/Chef. You can start out with a single machine (suggest you look at t2 instances), scale vertically to start with, and then add a load balancer and scale horizontally later if you need to.
Tim
  • 31,888
  • 7
  • 52
  • 78
  • My main reason for wanting multiple IPs is that I can run multiple sites on the server without worrying about other users discovering that both sites are owned by the same person. There's a number of tools out there that let you see all websites associated with an IP. That's what I'm trying to avoid. – alexforyou May 24 '17 at 22:24
  • That sounds like a good reason. You can do that in AWS with multiple elastic IPs on the same server, you just need to configure it properly. – Tim May 24 '17 at 23:30
  • An alternative solution would be putting multiple ELBs in front of the same server(s). It'll cost $15/month, but the resulting ELB IPs will be a) ever-changing and b) not shared across sites. – ceejayoz May 25 '17 at 01:36
  • I don't know if it's true to say the ELB IP won't be shared across sites. I think many different sites share the same ELB IPs - a many to many mapping. For example an ELB in front of a very small website probably has the capacity to serve many similar websites on the same server, which presumably would use the same IP. I guess it could be one IP per site, but I don't think it's likely with such a limited resource as IP4 addresses. – Tim May 25 '17 at 01:39
  • 1
    Use one server with one ip and put everything behind cloudflare. You get free TLS, some security (masking your real world ip), and DDoS protection. With millions of sites using cloudflare, you would just blend right in. – Linuxx May 25 '17 at 02:07
  • @Tim My understanding is ELBs are a specific set of instances (minimum two) just for the customer spooling it up, hence the $15/month charge for them. As evidence, I cite AWS Support's ability to restart them or pre-warm them for a large expected traffic spike. – ceejayoz May 26 '17 at 17:59
  • @ceejayoz I think that's essentially correct, but the hardware may be shared. What I wondered was if the IPs are dedicated (which would be required for SSL without SNI), or if one IP could serve multiple sites. The more I think about it the more I think the IPs are more likely to be dedicated, but they could probably change without warning - say when an ELB server goes down. – Tim May 26 '17 at 20:08
  • @Tim I hadn't thought of the SNI side of things, which is further evidence. ELB had SSL support well before "screw XP users" was acceptable practice, so the IPs are almost certainly not shared. AWS has plenty of IP space to use - if they can give 'em out for a t2.nano they can give 'em out for an ELB. The IPs *definitely* do change without warning - if you point your domain at the ELB IP addresses instead of using an ALIAS it breaks pretty frequently. – ceejayoz May 26 '17 at 21:04