- Create a compute instance in one of your favorite cloud provider. I am going with gcloud example here
gcloud compute zones list
gcloud config set compute/zone <zone>
-
Using
gcloud shell
Use whatever shell/terminal instance the cloud provider provides to interact with the compute instance or download cloudproviders SDK and execute commands from your local terminal to interact with it. -
Create a Ubuntu VM instance
gcloud compute instances create ubuntu \
--image-project ubuntu-os-cloud \
--image ubuntu-1604-xenial-v20160420c
- Cloud shell - log into the VM instance
gcloud compute ssh ubuntu
sudo apt-get update
- Install nginx and verify that it's running
sudo apt-get install nginx
nginx -v
sudo systemctl start nginx
sudo systemctl status nginx
- Run curl to verify
curl http://127.0.0.1
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>
-
It is really difficult to manager 2 different version of Nginx in a VM.
-
Most OSs allows us to run only one version at a time
-
We have to deal with this conf file
etc/init/nginx.conf
and we have consider that both versions are running on different ports. -
All in all it is a cumbersome process
-
That's when container technology such as Docker comes in handy