본문 바로가기
서버/Haproxy

Haproxy 설치

by WYYOON 2019. 9. 18.
728x90
반응형
SMALL

OS : CeontOS7

Haproxy version : 1.8.13

 

# 필수 라이브러리 설치
yum -y install gcc openssl-devel

#압축 해제
tar xvfz haproxy-1.8.13.tar.gz

cd haproxy-1.8.13
make TARGET=linux2628 USE_OPENSSL=1

# 여기서 TARGET 옵션은 리눅스 종류에 맞춰 지정합니다.
- linux22 for Linux 2.2
- linux24 for Linux 2.4 and above (default)  
- linux24efor Linux 2.4 with support for a working epoll (> 0.21)  
- linux26 for Linux 2.6 and above  
- linux2628   for Linux 2.6.28, 3.x, and above (enables splice and tproxy)  
- solaris for Solaris 8 or 10 (others untested)  
- freebsd for FreeBSD 5 to 10 (others untested)  
- netbsd  for NetBSD   - osx for Mac OS/X  
- openbsd for OpenBSD 3.1 and above  
- aix51   for AIX 5.1  
- aix52   for AIX 5.2  
- cygwin  for Cygwin  
- generic for any other OS or version.  
- custom  to manually adjust every setting

make install

mkdir -p /etc/haproxy
mkdir -p /var/lib/haproxy
touch /var/lib/haproxy/stats

cp examples/option-http_proxy.cfg /etc/haproxy/haproxy.cfg

ln -s /usr/local/sbin/haproxy /usr/sbin/haproxy

#haproxy 사용자 계정 생성
useradd -r haproxy

#재부팅시 자동 실행 등록
cp examples/haproxy.init /etc/init.d/haproxy
chmod 755 /etc/init.d/haproxy 

728x90
반응형
SMALL

'서버 > Haproxy' 카테고리의 다른 글

haproxy log 설정  (0) 2019.09.23