- 追加された行はこの色です。
- 削除された行はこの色です。
[[サーバ関連]]
目次~
#contetns
*概要 [#n516bd86]
Webサイトのhttps化が進められており、httpで運用されている内部サイトとの整合を取るため、https proxyを構築する際の手順。~
**環境情報 [#l38ec463]
|OS|CentOS Stream 9|
|httpd|httpd-2.4.51-5.el9.x86_64|
*手順 [#if442ddd]
**基礎環境の構築 [#m8fd9e0b]
OS標準のパッケージを導入する
dnf install httpd mod_ssl
**SSL証明書の作成 [#bd8eee2e]
SSL証明書を作成し、https通信を可能にする。~
-サーバ鍵の作成(秘密鍵)
cd /etc/pki/tls/private/
openssl genrsa -out localhost.key 4096
-CertificateSigningRequestの作成
openssl req -new -days 3650 -key localhost.key -out localhost.csr
-x509自己証明書の作成(公開鍵)
openssl x509 -in server.csr -out localhost.crt -req -signkey localhost.key -days 3650
mv localhost.crt /etc/pki/tls/certs/
**http proxyの設定 [#nf611c0d]
ssl.confに対してproxyの転送先設定を追記する
-/etc/httpd/conf.d/ssl.conf(/hogehoge/へのアクセスを転送)
SSLProxyEngine on
ProxyPass /hogehoge/ http://192.168.1.1/hogehoge/
ProxyPassReverse /hogehoge/ http://192.168.1.1/hogehoge/
**SE Linuxの通信許可 [#gb8fe637]
SELinuxがHTTP通信を許可するように、次のようなコマンドで設定を変更
setsebool -P httpd_can_network_connect 1