-1

I have created n1-standard-1 (1 vCPU, 3.75 GB memory) VM and installed LAMP on it with a static IP address. When I am trying to hit the static IP address in browser, it says This site can’t be reached However I have checked firewall rules and port 80 is opened.

Below is the output of gcloud compute firewall-rules list command -

enter image description here

And the output of telnet is as -

enter image description here

Is there anything else I need to do to open port 80 and 443? Please help, thank you!!

Sachin Vairagi
  • 3,493
  • 3
  • 24
  • 47
  • At first, have a loot at the community guide [Setting Up LAMP on Compute Engine](https://cloud.google.com/community/tutorials/setting-up-lamp). Which operating system do you use? Please connect to your VM instance, run `sudo netstat -nlpt` and update your question with output. – Serhii Rohoza Oct 27 '20 at 12:38

1 Answers1

0

This could be the VM's configuration. You'll want to check that the machine is actually listening on that port. You may have installed LAMP but are the services started, for instance? Best way to do that is SSH into the system and curl localhost. If the curl fails, you know the services are not listening on that port.

After that check that you can access the system from the VPC if you can, for example via another system in the same VPC, run curl <machine>. If that doesn't work, you may find the system is only listening on 127.0.0.1 or has other settings blocking connections from other machines.

If those steps succeed then your firewall rules are indeed to blame - check that your system is in the correct VPC (default you listed above).

Finally, you haven't specified how you assigned the static IP address but make sure that the address is created and assigned to that instance.

Jonny
  • 772
  • 4
  • 14
  • Thank you for your response Jonny, the static IP address assigned to the VM, can you please let me know if there anything specific I need to check? I have attached screenshot of Telnet command as well for more details. – Sachin Vairagi Oct 27 '20 at 11:55
  • Step through each of the things I've posted above in order to find the problem. (If you're not sure you understand what I'm talking about there, then you'll need a more technical colleague to step through them with you to work out where the issue lies.) The other thing you may want to check is that the static address, if it's not global, is assigned to the same region as your instance. – Jonny Oct 27 '20 at 12:00