使用命令netstat -apn查看nginx端口使用情况,再使用ps -aux | grep 7017看哪个进程pid被哪个应用程序所使用。
[root@iz94j7ahvuvz sbin]# netstat -apnactive internet connections (servers and established)proto recv-q send-q local address foreign address state pid/program name tcp 0 0 0.0.0.0:80 0.0.0.0:* listen 7017/nginx tcp 0 0 0.0.0.0:22 0.0.0.0:* listen 870/sshd tcp 0 0 0.0.0.0:3306 0.0.0.0:* listen 991/mysqld tcp 0 0 120.25.153.204:51072 110.75.102.62:80 established 1149/aliyundun tcp 0 52 120.25.153.204:22 49.73.142.235:49769 established 2231/sshd udp 0 0 120.25.153.204:123 0.0.0.0:* 878/ntpd udp 0 0 10.116.151.96:123 0.0.0.0:* 878/ntpd udp 0 0 127.0.0.1:123 0.0.0.0:* 878/ntpd udp 0 0 0.0.0.0:123 0.0.0.0:* 878/ntpd
看哪个进程pid被哪个应用程序所使用
[root@iz94j7ahvuvz sbin]# ps -aux | grep 7017warning: bad syntax, perhaps a bogus '-'? see /usr/share/doc/procps-3.2.8/faqroot 7017 0.0 0.0 24276 788 ? ss 11:07 0:00 nginx: master process ./nginxroot 7044 0.0 0.0 103264 856 pts/0 s+ 11:22 0:00 grep 7017
更多nginx相关技术文章,请访问nginx教程栏目进行学习!
以上就是怎么查看nginx端口的详细内容。