我在虚拟服务器上安装了带有rtmp模块的新ngnix服务器。在我的服务器上是安装了plesk 17.8的debian 8。 Apache在80端口上运行。这就是为什么我将ngnix端口更改为81。
Ngnix配置:
server {
listen 81;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
端口81已打开,但是当我使用“ sudo / usr / local / sbin / ngnix”启动ngnix时。我收到错误消息:
root@localhost:~# sudo /usr/local/nginx/sbin/nginx
nginx: [emerg] bind() to 0.0.0.0:81 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:81 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:81 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:81 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:81 failed (98: Address already in use)
nginx: [emerg] still could not bind()
在我的服务器上:81我收到错误消息“连接已超时”。因此,我检查了服务器上的所有端口。
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:8880 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:81 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 1926 root 6u IPv4 0t0 TCP *:81 (LISTEN)
nginx 1927 nobody 6u IPv4 0t0 TCP *:81 (LISTEN)
如何在其他端口上运行Ngnix Server?