5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Centos6.5にロードバランサーのPound2.6を設置

Last updated at Posted at 2014-07-15

centos6.5にpound2.6を設置して動かしたのでそのメモ書きです。

POUND - REVERSE-PROXY AND LOAD-BALANCER
http://www.apsis.ch/pound

opensslを使うのでインストールします。

yum install openssl openssl-devel

Heartbleedがあったのでバージョンを確認しましょう。

Version 1.0.1e-16.el6_5.14

ソースコードを取得して
configureからのmake - make install

cd /usr/local/src
wget http://www.apsis.ch/pound/Pound-2.6.tgz
tar zxvf Pound-2.6.tgz

cd Pound-2.6
./configure --prefix=/usr/local

make
make install

インストールはこれだけです。

あとはpound.cfgのファイルが最初ないので
/usr/local/etc/pound.cfg に作りましょう。

あとserviceに登録されてないとなんだかすっきりしないですよね。
登録しましょう。

vi /etc/init.d/pound

start|stop|configtest|restartを使えるようにします。

# !/bin/sh
#
# pound
#
# chkconfig: 345 85 15
# description: reverse-proxy and load-balancer
#

# Source function library
. /etc/rc.d/init.d/functions

# Get network config
. /etc/sysconfig/network

# Pound Directory
POUND="/usr/local/sbin/pound"
CFG="/usr/local/etc/pound.cfg"

# See how we were called.
case "$1" in
  start)
      # Check if the normal service is already running?
      if [ ! -f /var/lock/subsys/pound ]; then
          echo "Starting pound:"
          $POUND -f $CFG
          RETVAL=$?
          [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pound
          echo ${base}
      else
          #msg_Already_Running pound
          echo "pound already started."
          # exit 1
      fi
      ;;
  stop)
      # Stop daemons.
      if [ -f /var/lock/subsys/pound ]; then
          #msg_stopping pound
          echo "Stopping pound:"
          killall $POUND
          rm -f /var/lock/subsys/pound > /dev/null 2>&1
          echo
      else
          echo "pound is not running."
          exit 1
      fi
      ;;
  restart|reload)
      $0 stop
      $0 start
      ;;
  configtest)
      $POUND -c -v -f $CFG
      ;;
  *)
      echo "usage: pound {start|stop|configtest|restart}"

      exit 1
      ;;
esac

exit $RETVA

実行権限を付けます。

chmod +x /etc/init.d/pound

サービスが自動起動するようにしましょう。

chkconfig pound on

動作するか確認してみましょうか。
設定ファイルがちゃんとある状態なら

service pound configtest

starting...
Config file /usr/local/etc/pound.cfg is OK

こんな感じでOKです。

さっくりSSLProxyやロードバランサーしたい時はpoundを使うのが楽なんですよね。

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?