LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-23-2015, 06:25 AM   #1
satimis
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
VirtualBox
On router - port 80 forwarded to VM

This is a new installation.

$ sudo service haproxy restart
* Restarting haproxy haproxy
Code:
[ALERT] 142/180117 (1118) : Starting frontend http-frontend: cannot bind socket [static_IP:80]
   ...fail!
$ netstat -nat | grep 80 | grep LISTEN
Code:
tcp6       0      0 :::80                   :::*                    LISTEN
cat /etc/haproxy/haproxy.cfg
Code:
global
        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
        daemon

        # 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:
        #  https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
        ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
        ssl-default-bind-options no-sslv3

defaults
        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 192.168.0.xxx:80 check
        server 2-www 192.168.0.xxx:80 check
        server 2-www 192.168.0.xxx:80 check
Please help. Thanks

Regards
satimis
 
Old 06-02-2015, 05:07 PM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,574

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

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

Thanks for your advice.

Connection (all websites are on name-base)

Code:
                          | 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.

Regards
satimis

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


Reply


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 12:26 PM
service ldap start on CentOS fail to start Frezier Linux - Newbie 1 08-15-2011 10:53 AM
opensuse fail to start brouilly Linux - Newbie 2 01-07-2011 05:18 AM
rcapache2 start -fail Fredrix Linux - Server 18 03-13-2009 03:18 PM
Fail to start X satimis Ubuntu 2 07-25-2007 12:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:37 AM.

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