haproxy:install
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
haproxy:install [2016/03/08 07:40] – clownclown | haproxy:install [2025/02/16 13:53] (現在) – 外部編集 127.0.0.1 | ||
---|---|---|---|
行 1: | 行 1: | ||
====== HAProxy | ====== HAProxy | ||
+ | |||
+ | ===== gcc ===== | ||
+ | |||
+ | [[centos: | ||
+ | gcc他、関連するものを一括でインストール | ||
+ | |||
+ | < | ||
+ | # yum -y groupinstall " | ||
+ | </ | ||
===== pcre-devel | ===== pcre-devel | ||
- | rpmbuildに必要 | + | [[centos: |
< | < | ||
行 11: | 行 20: | ||
===== HAProxyインストール | ===== HAProxyインストール | ||
- | 公式:http:// | + | 公式:http:// |
- | 最新:http:// | + | 最新:http:// |
- | (2013/01/22時点) | + | (2016/05/20時点) |
- | rpmbuildに都合のいい階層で以後の処理を行う | + | [[centos: |
< | < | ||
- | # cd /usr/src/redhat/SOURCES | + | # /root/rpmbuild/SOURCES |
- | # wget http:// | + | # wget http://www.haproxy.org/ |
# tar zxvf haproxy-1.4.22.tar.gz | # tar zxvf haproxy-1.4.22.tar.gz | ||
</ | </ | ||
- | rpmbuild | + | [[centos: |
< | < | ||
- | # rpmbuild -bb ./ | + | # rpmbuild -bb ./ |
- | # cd / | + | |
</ | </ | ||
インストール | インストール | ||
< | < | ||
- | # rpm -ivh haproxy-1.4.22-1.x86_64.rpm | + | # cd / |
+ | # rpm -iv ./haproxy-1.6.5-1.x86_64.rpm | ||
Preparing... | Preparing... | ||
| | ||
行 39: | 行 48: | ||
< | < | ||
# rpm -qs haproxy | # rpm -qs haproxy | ||
- | normal | + | 通常 |
- | normal | + | 通常 |
- | normal | + | 通常 |
- | normal | + | 通常 |
- | normal | + | 通常 |
- | normal | + | 通常 |
- | normal | + | 通常 |
+ | 通常 | ||
+ | 通常 | ||
+ | 通常 | ||
+ | 通常 | ||
+ | 通常 | ||
+ | </ | ||
+ | |||
+ | ユーザー追加 | ||
+ | < | ||
+ | # groupadd -g 188 haproxy | ||
+ | # useradd -d / | ||
</ | </ | ||
行 52: | 行 72: | ||
< | < | ||
# cd / | # cd / | ||
- | # cp haproxy.cfg haproxy.cfg.org | ||
# vi haproxy.cfg | # vi haproxy.cfg | ||
</ | </ | ||
+ | sample | ||
< | < | ||
# this config needs haproxy-1.1.28 or haproxy-1.2.1 | # this config needs haproxy-1.1.28 or haproxy-1.2.1 | ||
行 209: | 行 229: | ||
# / | # / | ||
</ | </ | ||
- | |||
- | ===== マルチドメインの振り分け | ||
- | |||
- | < | ||
- | frontend | ||
- | acl is_adm | ||
- | acl is_app | ||
- | |||
- | use_backend | ||
- | default_backend | ||
- | |||
- | backend virtual_adm | ||
- | balance | ||
- | server | ||
- | |||
- | backend default_www | ||
- | balance | ||
- | server | ||
- | server | ||
- | </ | ||
- | ===== 静的・動的振り分け | ||
- | |||
- | < | ||
- | frontend | ||
- | acl url_static | ||
- | acl url_static | ||
- | | ||
- | use_backend static | ||
- | default_backend | ||
- | |||
- | backend static | ||
- | balance | ||
- | server | ||
- | server | ||
- | |||
- | backend app | ||
- | balance | ||
- | server | ||
- | server | ||
- | </ | ||
- | |||
- | ===== Statistics Report | ||
- | < | ||
- | listen stats :23451 | ||
- | mode http | ||
- | stats enable | ||
- | #stats hide-version | ||
- | | ||
- | # | ||
- | stats realm Haproxy\ Statistics | ||
- | | ||
- | #This is the virtual URL to access the stats page | ||
- | stats uri / | ||
- | | ||
- | #The user/pass you want to use. Change this password! | ||
- | stats auth Username: | ||
- | </ | ||
- | |||
- | ブラウザから、http:// | ||
===== ドキュメント | ===== ドキュメント |
haproxy/install.1457422857.txt.gz · 最終更新: 2025/02/16 13:50 (外部編集)