HAProxy
From KevinWiki
(Difference between revisions)
Line 64: | Line 64: | ||
bind :443 ssl crt /etc/ssl/certs/server_domain.pem | bind :443 ssl crt /etc/ssl/certs/server_domain.pem | ||
</pre> | </pre> | ||
+ | |||
+ | = Configuration = | ||
+ | == haproxy.cfg == | ||
+ | * Example of <code>/etc/haproxy/haproxy.cfg</code> |
Revision as of 12:19, 22 July 2013
Contents |
Installation
$ apt-get install make
- for gcc
$ apt-get install build-essential
- If the following error occurs,
# Install libpcre3-dev if you get "include/common/regex.h:28:18: fatal error: pcre.h: No such file or directory"
- install
$ apt-get install libpcre3-dev
- If the following error occurs,
# libssl-dev if you get "include/types/server.h:29:25: fatal error: openssl/ssl.h: No such file or directory"
- install
$ apt-get install libssl-dev
- HAProxy website:
http://haproxy.1wt.eu/
HAProxy Installation
- Download HAProxy,
e.g.)
$ wget http://haproxy.1wt.eu/download/1.5/src/devel/haproxy-1.5-dev19.tar.gz
- Install
$ tar -zxvf haproxy-1.5-dev19.tar.gz $ cd haproxy-1.5-dev19 $ make TARGET=linux2628 USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 $ make install
- Clean all for recompilation
$ make TARGET=linux2628 USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 clean all
- Add haproxy user
$ useradd -m haproxy -s /bin/false
- For SSL support
$ cat server_domain-crt-bundle.crt server_domain.key > server_domain.pem
- Modify the
/etc/haproxy/haproxy.cfg
file
bind :443 ssl crt /etc/ssl/certs/server_domain.pem
Configuration
haproxy.cfg
- Example of
/etc/haproxy/haproxy.cfg