RHEL7 Unable to bind HAProxy Stats to TCP Port 82



  • I'm having some issues binding the stats page of HAProxy to TCP port 82.

    I get the following error when trying to start HAProxy

    Starting proxy stats: cannot bind socket [0.0.0.0:82]
    

    I ran lsof -i and got the following

    COMMAND     PID       USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
    rsyslogd    646       root    3u  IPv4    14472      0t0  UDP localhost:syslog
    sshd       1245       root    3u  IPv4    17539      0t0  TCP *:ssh (LISTEN)
    sshd       1245       root    4u  IPv6    17541      0t0  TCP *:ssh (LISTEN)
    master     1855       root   13u  IPv4    17134      0t0  TCP localhost:smtp (LISTEN)
    master     1855       root   14u  IPv6    17135      0t0  TCP localhost:smtp (LISTEN)
    miniserv.  7685       root    4u  IPv4  7578132      0t0  TCP *:ndmp (LISTEN)
    miniserv.  7685       root    5u  IPv4  7578133      0t0  UDP *:ndmp
    sshd      15479       root    3u  IPv4 11578603      0t0  TCP hostname:ssh->clientname:63141 (ESTABLISHED)
    sshd      15484 delhiadmin    3u  IPv4 11578603      0t0  TCP hostname:ssh->clientname:63141 (ESTABLISHED)
    

    Running nmap -sT -O localhost returns:

    PORT      STATE SERVICE
    22/tcp    open  ssh
    25/tcp    open  smtp
    10000/tcp open  snet-sensor-mgmt
    

    Any ideas what else I can try to see what is using this port?



  • My initial question is, are you forced to use Port 82?

    Take a look here



  • @DustinB3403 said:

    My initial question is, are you forced to use Port 82?

    Yes

    Take a look here

    tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN      7685/perl
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1245/sshd
    tcp        3      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1855/master
    tcp6       0      0 :::22                   :::*                    LISTEN      1245/sshd
    tcp6       0      0 ::1:25                  :::*                    LISTEN      1855/master

  • Service Provider

    Disabke SELinux and see if it works. Then if so, add the port as allowed to SELinux?


  • Service Provider

    Are you running this as root? It will fail on port 82 if you are not root.



  • @scottalanmiller said:

    Are you running this as root? It will fail on port 82 if you are not root.

    It is running as a service, not sure if that is running as root or not?



  • @coliver said:

    I'm having some issues binding the stats page of HAProxy to TCP port 82.

    I get the following error when trying to start HAProxy

    Starting proxy stats: cannot bind socket [0.0.0.0:82]
    

    I ran lsof -i and got the following

    COMMAND     PID       USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
    rsyslogd    646       root    3u  IPv4    14472      0t0  UDP localhost:syslog
    sshd       1245       root    3u  IPv4    17539      0t0  TCP *:ssh (LISTEN)
    sshd       1245       root    4u  IPv6    17541      0t0  TCP *:ssh (LISTEN)
    master     1855       root   13u  IPv4    17134      0t0  TCP localhost:smtp (LISTEN)
    master     1855       root   14u  IPv6    17135      0t0  TCP localhost:smtp (LISTEN)
    miniserv.  7685       root    4u  IPv4  7578132      0t0  TCP *:ndmp (LISTEN)
    miniserv.  7685       root    5u  IPv4  7578133      0t0  UDP *:ndmp
    sshd      15479       root    3u  IPv4 11578603      0t0  TCP hostname:ssh->clientname:63141 (ESTABLISHED)
    sshd      15484 delhiadmin    3u  IPv4 11578603      0t0  TCP hostname:ssh->clientname:63141 (ESTABLISHED)
    

    Running nmap -sT -O localhost returns:

    PORT      STATE SERVICE
    22/tcp    open  ssh
    25/tcp    open  smtp
    10000/tcp open  snet-sensor-mgmt
    

    Any ideas what else I can try to see what is using this port?

    Try

    netstat -anp
    


  • @JaredBusch said:

    Disabke SELinux and see if it works. Then if so, add the port as allowed to SELinux?

    Looks like it was SELinux, setting it to permissive allowed the port to be used. Now to figure out how to allow the port in SELinux.


  • Service Provider

    @coliver said:

    @JaredBusch said:

    Disabke SELinux and see if it works. Then if so, add the port as allowed to SELinux?

    Looks like it was SELinux, setting it to permissive allowed the port to be used. Now to figure out how to allow the port in SELinux.

    semanage port -m -t http_port_t -p tcp 82


  • @JaredBusch said:

    @coliver said:

    @JaredBusch said:

    Disabke SELinux and see if it works. Then if so, add the port as allowed to SELinux?

    Looks like it was SELinux, setting it to permissive allowed the port to be used. Now to figure out how to allow the port in SELinux.

    semanage port -m -t http_port_t -p tcp 82
    

    That did it thanks.



Looks like your connection to MangoLassi was lost, please wait while we try to reconnect.