简体   繁体   中英

Create Azure Virtual Machine

I followed the tutorial Create Linux Virtual Machine and everything seems correct, what do I know since this is my first attempt. I can't see whats wrong, I can ssh to it and run things, etc.

The issue I have is that I can't ping the public ip address. The prompt just hangs. At the end of the tutorial it asks to view a website on the page, and the browser just times out?

Is there something I should look at?

The tutorial creates a website with nginx and I have never used this, but it expects port 80 to be open. I added port 80 open for the Network Security Group.

I eventually will use Tomcat at port 8080 so I installed and opened port 8080 in the Network security group.

If I try to connect over port 80: ipAddress:80 ERR_CONNECTION_TIMED_OUT if I ssh to the vm and use ps aux | grep nginx i get a response like

root      7809  0.0  0.0 116528  1400 ?        Ss   20:56   0:00 
    nginx: master process /usr/sbin/nginx -g daemon on; master_process on;

www-data  7810  0.0  0.0 116880  2576 ?        S    20:56   0:00 nginx: worker process

The server is running.

if I try ipAddress:8080 I get the tomcat default web page. I can't figure out why nginx doesn't work.

ping wont work. you need to open up website port on the NSG and on your linux box. you can use this guide: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/nsg-quickstart-portal

ping is disabled in Azure for public facing IPs

regarding the ports you need to consider two things, first as you mention the NSG has to enable the traffic for the ports of interest, its important to consider that you can have NSGs at the NIC and Vnet levels, please review which one do you have, secondly once the NSG has been opened there has to be a listening service on the VM, you mention that the tutorial tells you to use port 80 but then looks like tomcat uses 8080 instead, I recommend running the following command to verify the listening ports at the OS level

sudo netstat -plnt

please let me know if this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM