![]()
カスタム検索
|
data-lang="ja">Tweet |
|
![]() |
Poundの小技
Modified: 18 November 2005
SSLラッパの(HTTPS対応にする)方法 (18 November 2005)
確認メッセージを出して起動する方法 (18 November 2005)
ログを制御する方法 (18 November 2005)
実行ユーザを指定する方法 (18 November 2005)
SSLラッパを利用すると、WEBサーバーがSSLに対応していなくてもSSL通信ができます。
しかしながら、ブラウザに、鍵マークがつかないので、用途は限られるようです。まずは、秘密鍵を作成します。
# cd /usr/local/etc # openssl genrsa -des3 -out server-key.pem 1024 Generating RSA private key, 1024 bit long modulus .................++++++ .......................................................++++++ e is 65537 (0x10001) Enter pass phrase for server-key.pem: ******** Verifying - Enter pass phrase for server-key.pem: ******** #
パスフレーズを書き込みます。
# openssl rsa -in server-key.pem -out server-key.pem Enter pass phrase for server-key.pem: ******** writing RSA key #証明書を作成します。
# openssl req -new -key server-key.pem -x509 -out pound.pem You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [GB]:JP State or Province Name (full name) [Berkshire]:Nara Locality Name (eg, city) [Newbury]:Nara Organization Name (eg, company) [My Company Ltd]:TOMO INC Organizational Unit Name (eg, section) []:tomo Common Name (eg, your name or your server's hostname) []:server Email Address []:tomo@xxxxxx.com #証明書に秘密鍵を追加します。
# cat server-key.pem >> pound.pem #
設定して起動する
"pound.cfg" を設定(先頭行)します。
ListenHTTPS 192.168.0.2,443 /usr/local/etc/pound.pem UrlGroup ".*" BackEnd 192.168.0.11,80,1 BackEnd 192.168.0.12,80,1 EndGroup
以下のコマンドで起動します。
# /usr/local/sbin/pound
なぜか、"-vc"オプションを付加すると起動できません。
"-vc"を付加すれば確認できます。
# /usr/local/sbin/pound -vc
Config file /usr/local/etc/pound.cfg is OK
#
"pound.cfg"に、以下を追加すればOKです。
ログは、syslogで、"/var/log/messages"レベルは、"0" から "4" までの5種類が選べます。
LogLevel 3
"pound.cfg"に、以下を追加すればOKです。
User apache Group apache