kimchi-project / kimchi

An HTML5 management interface for KVM guests
https://github.com/kimchi-project/kimchi/releases/latest
Other
3.08k stars 366 forks source link

Nginx steals port 80 #1229

Closed Dykarbremsen closed 5 years ago

Dykarbremsen commented 6 years ago

After installing kimchi i get the problem that Nginx steals port 80 even tho i edited config to change it to 8000 and 8001

I want port 80 for my apache service and not nginx since i only use it for kimchi. Doing systemctl status nginx yields belov info

    ● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2018-05-05 01:33:40 CEST; 5s ago
  Process: 6110 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
  Process: 6118 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 6113 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 6120 (nginx)
    Tasks: 17
   Memory: 8.9M
      CPU: 46ms
   CGroup: /system.slice/nginx.service
           ├─6120 nginx: master process /usr/sbin/nginx -g daemon on; master_process on
           ├─6121 nginx: worker process
           ├─6122 nginx: worker process
           ├─6123 nginx: worker process
           ├─6124 nginx: worker process
           ├─6125 nginx: worker process
           ├─6126 nginx: worker process
           ├─6127 nginx: worker process
           ├─6128 nginx: worker process
           ├─6129 nginx: worker process
           ├─6130 nginx: worker process
           ├─6131 nginx: worker process
           ├─6132 nginx: worker process
           ├─6133 nginx: worker process
           ├─6134 nginx: worker process
           ├─6135 nginx: worker process
           └─6136 nginx: worker process

May 05 01:33:40 Headsrv systemd[1]: Starting A high performance web server and a reverse proxy server...
May 05 01:33:40 Headsrv systemd[1]: Started A high performance web server and a reverse proxy server.

Doing a grep 80 /etc/nginx/nginx.conf yields no hits neither grep 80 /etc/nginx/conf.d/wok.conf

Doing netstat -tulpn gives below

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      1204/named
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      3906/apache2
tcp        0      0 127.0.0.1:64667         0.0.0.0:*               LISTEN      1466/python2
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN      3800/nginx -g daemo
tcp        0      0 0.0.0.0:8001            0.0.0.0:*               LISTEN      3800/nginx -g daemo
tcp        0      0 127.0.0.1:8010          0.0.0.0:*               LISTEN      1431/python2
tcp        0      0 127.0.0.1:5900          0.0.0.0:*               LISTEN      2409/qemu-system-x8
tcp        0      0 127.0.0.1:5901          0.0.0.0:*               LISTEN      5728/qemu-system-x8
tcp        0      0 127.0.0.1:80            0.0.0.0:*               LISTEN      3800/nginx -g daemo
tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN      1441/perl
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      1204/named
tcp        0      0 185.99.36.25:53         0.0.0.0:*               LISTEN      1204/named
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      1204/named
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1207/sshd
tcp6       0      0 ::1:953                 :::*                    LISTEN      1204/named
tcp6       0      0 :::8000                 :::*                    LISTEN      3800/nginx -g daemo
tcp6       0      0 :::53                   :::*                    LISTEN      1204/named
tcp6       0      0 :::22                   :::*                    LISTEN      1207/sshd
udp        0      0 0.0.0.0:58589           0.0.0.0:*                           8101/dhcpd
udp        0      0 192.168.122.1:53        0.0.0.0:*                           1631/dnsmasq
udp        0      0 192.168.122.1:53        0.0.0.0:*                           1204/named
udp        0      0 185.99.36.25:53         0.0.0.0:*                           1204/named
udp        0      0 127.0.0.1:53            0.0.0.0:*                           1204/named
udp        0      0 0.0.0.0:67              0.0.0.0:*                           8101/dhcpd
udp        0      0 0.0.0.0:67              0.0.0.0:*                           1631/dnsmasq
udp6       0      0 :::22974                :::*                                8101/dhcpd
udp6       0      0 :::53                   :::*                                1204/named

Anyone know how i can stop nginx from stealing port 80? All help with the problem and troubleshooting is appreciated

Also, love how the kimchi work and its uses!

FastFelix771 commented 6 years ago

Thats the default page of nginx that uses that port. Delete /etc/nginx/sites-enabled/default and restart both nginx and wokd.

Then verify again with netstat. Worked for me.

Dykarbremsen commented 6 years ago

Hello!

Sorry for late reply, this did indeed fix the problem. Never would have thought the sym link was the problem. Not since i edited that file that all 80 data should be 8000

But this fixed it and the https link still works so thank you!

schnuffle commented 5 years ago

You can totally drop nginx and let apache do the reverse proxy. Of course that need a translation of the nginx conf to apache. Shouldn't be hard to do

Regards

Schnuffle

alinefm commented 5 years ago

Closing this issue as there is nothing else to do on it.