1.ps aux | grep -E "(nginx|apache|httpd)" | grep -v grep
2.sudo lsof -i :80
hx@sky:/var/www/html/hxpython$ ps aux | grep -E "(nginx|apache|httpd)" | grep -v grep
root 748 0.0 0.0 55368 2996 ? Ss 8月22 0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 750 0.0 0.1 56332 6572 ? S 8月22 0:00 nginx: worker process
www-data 751 0.0 0.1 56048 5900 ? S 8月22 0:00 nginx: worker process
www-data 753 0.0 0.1 56048 5832 ? S 8月22 0:00 nginx: worker process
www-data 756 0.0 0.1 56048 5832 ? S 8月22 0:00 nginx: worker process
hx@sky:/var/www/html/hxpython$
hx@sky:/var/www/html/hxpython$
hx@sky:/var/www/html/hxpython$
hx@sky:/var/www/html/hxpython$
hx@sky:/var/www/html/hxpython$ sudo lsof -i :80
[sudo] hx 的密码:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 748 root 6u IPv4 5838 0t0 TCP *:http (LISTEN)
nginx 748 root 7u IPv6 5839 0t0 TCP *:http (LISTEN)
nginx 750 www-data 6u IPv4 5838 0t0 TCP *:http (LISTEN)
nginx 750 www-data 7u IPv6 5839 0t0 TCP *:http (LISTEN)
nginx 751 www-data 6u IPv4 5838 0t0 TCP *:http (LISTEN)
nginx 751 www-data 7u IPv6 5839 0t0 TCP *:http (LISTEN)
nginx 753 www-data 6u IPv4 5838 0t0 TCP *:http (LISTEN)
nginx 753 www-data 7u IPv6 5839 0t0 TCP *:http (LISTEN)
nginx 756 www-data 6u IPv4 5838 0t0 TCP *:http (LISTEN)
nginx 756 www-data 7u IPv6 5839 0t0 TCP *:http (LISTEN)
hx@sky:/var/www/html/hxpython$
hx@sky:/var/www/html/hxpython$
hx@sky:/var/www/html/hxpython$
hx@sky:/var/www/html/hxpython$
hx@sky:/var/www/html/hxpython$
hx@sky:/var/www/html/hxpython$
hx@sky:/var/www/html/hxpython$ curl -I http://192.168.1.12 2>/dev/null | grep -i server
Server: nginx/1.18.0 (Ubuntu)
hx@sky:/var/www/html/hxpython$