Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 05-23-2015, 05:25 AM   #1
Senior Member
Registered: Apr 2003
Posts: 3,673

Rep: Reputation: 55
Fail to start Haproxy

Hi all,

Guest VM - Ubuntu 14.04 Haproxy
Host - Ubuntu 14.04
On router - port 80 forwarded to VM

This is a new installation.

$ sudo service haproxy restart
* Restarting haproxy haproxy
[ALERT] 142/180117 (1118) : Starting frontend http-frontend: cannot bind socket [static_IP:80]!
$ netstat -nat | grep 80 | grep LISTEN
tcp6       0      0 :::80                   :::*                    LISTEN
cat /etc/haproxy/haproxy.cfg
        log /dev/log    local0
        log /dev/log    local1 notice
        chroot /var/lib/haproxy
        stats socket /run/haproxy/admin.sock mode 660 level admin
        stats timeout 30s
        user haproxy
        group haproxy

        # Default SSL material locations
        ca-base /etc/ssl/certs
        crt-base /etc/ssl/private

        # Default ciphers to use on SSL-enabled listening sockets.
        # For more information, see ciphers(1SSL). This list is from:
        ssl-default-bind-options no-sslv3

        log     global
        mode    http
        option forwardfor
        option http-server-close
        option  httplog
        option  dontlognull
        timeout connect 5000
        timeout client  50000
        timeout server  50000
        errorfile 400 /etc/haproxy/errors/400.http
        errorfile 403 /etc/haproxy/errors/403.http
        errorfile 408 /etc/haproxy/errors/408.http
        errorfile 500 /etc/haproxy/errors/500.http
        errorfile 502 /etc/haproxy/errors/502.http
        errorfile 503 /etc/haproxy/errors/503.http
        errorfile 504 /etc/haproxy/errors/504.http

        frontend http-frontend
        bind static_IP:80
        reqadd X-Forwarded-Proto:\ http

        backend wwwbackend
        server 1-www check
        server 2-www check
        server 2-www check
Please help. Thanks

Old 06-02-2015, 04:07 PM   #2
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,710

Rep: Reputation: 1035Reputation: 1035Reputation: 1035Reputation: 1035Reputation: 1035Reputation: 1035Reputation: 1035Reputation: 1035
You probably have an apache instance listening on port 80 or you're not starting haproxy as root.
Old 06-03-2015, 01:43 AM   #3
Senior Member
Registered: Apr 2003
Posts: 3,673

Original Poster
Rep: Reputation: 55
Originally Posted by TenTenths View Post
You probably have an apache instance listening on port 80 or you're not starting haproxy as root.

Thanks for your advice.

Connection (all websites are on name-base)

                          | Webserver1 (VM2)
Internet -> Haproxy (VM1) | Webserver2 (VM3)
                          | Webserver3 (VM4)
Port80 forwarded to VM1

It works without problem if ONLY one webserver running. But this connection fails to work if all webservers running simultaneously. It is because Port80 is only allowed to be forward to one webserver. The same has been confirmed by the moderator of Oracle Virtualbox forum.

Up to now I have no solution.


Last edited by satimis; 06-03-2015 at 10:24 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Fail to start X satimis Ubuntu 12 05-10-2012 11:26 AM
service ldap start on CentOS fail to start Frezier Linux - Newbie 1 08-15-2011 09:53 AM
opensuse fail to start brouilly Linux - Newbie 2 01-07-2011 04:18 AM
rcapache2 start -fail Fredrix Linux - Server 18 03-13-2009 02:18 PM
Fail to start X satimis Ubuntu 2 07-24-2007 11:35 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:19 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration