LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 05:25 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
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, 04:07 PM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
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
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
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 10:24 AM.
 
  


Reply



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

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

All times are GMT -5. The time now is 07:25 PM.

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
Open Source Consulting | Domain Registration