blacksun
blacksun

Reputation: 733

Hosting multiple websites in Google Compute Engine

We have 8 websites and 5 of them are small. I would like to host those 5 website in same instance but their ip must be same and static. I couldn't find a way how to allocate a static ip for each of them and how to host them in a single instance. They are PHP. Their db's are hosted in Google SQL.

Upvotes: 2

Views: 3299

Answers (2)

Pratik Khandagale
Pratik Khandagale

Reputation: 1

This can be possible using Protocol Forwarding.

You can have different IP addresses for each website while using single Virtual Machine.

I had successfully hosted my 3 sites using method in past. If you need, I can write up a detail explanation on some blog.

Upvotes: 0

Misha Brukman
Misha Brukman

Reputation: 13424

Per the Google Compute Engine docs on static IP addresses:

An instance can have only one external IP address. If it already has an external IP address, you must first remove that address by deleting the old access configuration, then adding a new access configuration with the new external IP address.

That said, you don't need to have a separate static IP address per website—you can serve an arbitrary number of sites from a single VM by using a feature such as Apache virtual hosts which let you serve a different site depending on the hostname that is requested by the user.

Upvotes: 1

Related Questions