Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to configure Haproxy for outgoing mail load balancing. my configuration file /etc/haproxy.cfg is.

global
        maxconn     4096 # Total Max Connections. This is dependent on ulimit
        daemon
        nbproc      4 # Number of processing cores. Dual Dual-core Opteron is 4 cores for example.

defaults
        mode       tcp

listen smtp_proxy 199.83.95.71:25
        mode tcp
        option tcplog
        balance roundrobin # Load Balancing algorithm
        ## Define your servers to balance
        server r23.lbsmtp.org 74.117.x.x:25  weight 1 maxconn 512 check
        server r15.lbsmtp.org 199.71.x.x:25  weight 1 maxconn 512 check

And when i start service haproxy i get this error.

Starting HAproxy: [ALERT] 244/172148 (7354) : cannot bind socket for proxy smtp_proxy. Aborting.

Please tell me where i am doing mistake.help will appreciated.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

If you are getting bind errors, you need to check whether another process is already listening on the same port 25. You can use:

$ sudo netstat -lnp | grep 25

Another possibility is that you are running the process with insufficient privileges. Binding on ports under 1024 requires root privilege.

share|improve this answer
    
thank u khaled now my haproxy is running but now i want to know how i authenticate haproxy to relay mails from it's node and how i submit mails to haproxy either via php application or another postfix. –  user128296 Sep 4 '12 at 7:36
    
@user128296: If you have something else to ask about, you can post a new question on this site if it is on-topic. –  Khaled Sep 4 '12 at 7:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.