Topic: service not running after making cluster using HAProxy KeepAlived
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.7.4 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer?downloadable installer
- Linux/BSD distribution name and version: Ubuntu 24.04 LTS 6.8.0-90-generic
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
I have configured the HAproxy as per below configuration. using Iredmail documentation for testing purpose.
global
log 127.0.0.1 local0
log 127.0.0.1 local1 debug
ssl-default-bind-options no-sslv3
tune.ssl.default-dh-param 2048
maxconn 45000 # Total Max Connections.
daemon
defaults
timeout server 86400000
timeout connect 86400000
timeout client 86400000
timeout queue 1000s
listen premierdis-http
bind 192.168.5.10:80
mode http
redirect scheme https if !{ ssl_fc }
listen premierdis
bind 192.168.5.10:443 ssl crt /etc/ssl/iredmail.org/jhelum.co.pem
mode http
stats enable
stats uri /haproxy?stats
stats realm STATS
stats auth user:pass
balance source
option http-server-close
timeout http-keep-alive 3000
http-request del-header ^X-Real-IP:
option forwardfor header X-Real-IP
http-request add-header X-Forwarded-Proto https
server ha-mail1 192.168.5.1:80 check
server ha-mail2 192.168.5.2:80 check
frontend ft_http
bind :80
mode http
default_backend bk_http
frontend ft_https
bind :443 ssl crt /etc/ssl/iredmail.org/jhelum.co.pem
mode tcp
default_backend bk_https
backend bk_http
mode http
balance roundrobin
stick on src table bk_https
default-server inter 1s
server ha-mail1 192.168.5.1:80 check id 1
server ha-mail2 192.168.5.2:80 check id 2
backend bk_https
mode tcp
balance roundrobin
stick-table type ip size 200k expire 30m
stick on src
default-server inter 1s
server ha-mail1 192.168.5.1:443 check id 1
server ha-mail2 192.168.5.2:443 check id 2
# Reporting
listen stats
bind :9000
mode http
# Enable statistics
stats enable
# Hide HAPRoxy version, a necessity for any public-facing site
stats hide-version
# Show text in authentication popup
stats realm Authorization
# URI of the stats page: localhost:9000/haproxy_stats
stats uri /haproxy_stats
# Set a username and password
stats auth user:user password
When we start HAproxy service it shows below error because Nginx is also using same ports.
[ALERT] (122326) : Binding [/etc/haproxy/haproxy.cfg:16] for proxy premierdis-http: cannot bind socket (Address already in use) for [192.168.5.10:80]
[ALERT] (122326) : Binding [/etc/haproxy/haproxy.cfg:35] for frontend ft_http: cannot bind socket (Address already in use) for [0.0.0.0:80]
[ALERT] (122326) : Binding [/etc/haproxy/haproxy.cfg:39] for frontend ft_https: cannot bind socket (Address already in use) for [0.0.0.0:443]
I need assistance on resolving this issue so both HAproxy and Nyngix service start and I can open mail on browser through virtual IP. I am not able to figure out what changes to be done on iredmail.
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.