0

I want to install haproxy on my ubuntu server buy the haproxy version from the 10.04 repo is 1.3.x version.

I wanted the latest build 1.4.13, since it has improvements and bugfixes.

What i did: 1. installed the haproxy from the official repo: apt-get install haproxy. 2. Download source file from the website, and compile it. 3. swapped the new haproxy with the old.

so far it works, but i as if i should be aware of something?

Why i did the following? since apt-get creates a init.d startup script, /etc/haproxy.cfg file, and user and group.

Elgreco08
  • 228
  • 3
  • 4
  • 16

1 Answers1

2

That is what I have always done since Ubuntu does have the init.d script. I always put it in /opt and then just edit the init script to point to the new version and never run make install.

A better way might be to use a symlink to the binary instead of editing the init script to point to the new binary, but both work.

You might want to make sure you compile it with some options, particularly you probably want to make sure you use the CPU target to get the right optimizations. Here is what I use for 64 bit:

make TARGET=linux26 CPU=i586 USE_STATIC_PCRE=1

These optimizations can matter at higher work loads, I had a high CPU usage when built it once without them because select() was being used instead of epoll()

Kyle Brandt
  • 83,619
  • 74
  • 305
  • 448
  • since i have 32bit i used: make TARGET=linux26 ARCH=i386 – Elgreco08 Mar 24 '11 at 13:02
  • @Elgreco08: Yup, that looks right to me – Kyle Brandt Mar 24 '11 at 13:03
  • @KyleMBrandt: what part do u change in init.d script? i changed HAPROXY=/opt/haproxy, when restart it errors with can't find /opt/haproxy – mamu Aug 09 '11 at 02:24
  • @Mamu: You need to make it point to the binary ... is that /opt/haproxy, or is /opt/haproxy the directory containing the binary? – Kyle Brandt Aug 09 '11 at 13:13
  • thanks @KyleMBrandt, turn out that x86 compiled files don't work on x64 linux, coming from windows thought if compiled in x86 would be alright in x64 but not. Got confused because of error message of can't find file. – mamu Aug 09 '11 at 14:32