Apache Module mod ssl

提供: セキュリティ
移動: 案内検索
スポンサーリンク

Apache module mod_ssl は、SSLApache HTTP Serverのモジュールです。

読み方

mod_ssl
もっどえすえすえる

概要

Webサービスでセキュアな通信が求められるときに、HTTPS でサービスするときに利用します。

インストール

FreeBSD の場合は、Apache 2 をインストールするときに、 make config の画面で mod_ssl にチェックを入れてビルドします。

FreeBSDにインストールする場合

ports コレクションからインストールする場合

cd /usr/ports/www/apache22
sudo make install clean

pkgコマンドでインストールする場合

sudo pkg install apache22

portmasterコマンドでインストールする場合

sudo portmaster -y -d /usr/ports/www/apache22

portinstallコマンドでインストールする場合

sudo portinstall /usr/ports/www/apache22

使い方

apache 2.4

mod_ssl.soとmod_socache_shmcb.soを有効にします。 /usr/local/etc/apache24/httpd.conf

LoadModule socache_shmcb_module libexec/apache24/mod_socache_shmcb.so
LoadModule ssl_module libexec/apache24/mod_ssl.so
 
# Secure (SSL/TLS) connections
Include etc/apache24/extra/httpd-ssl.conf

下で示すMakefileを実行して、オレオレ証明書を作成します。

$ cd /usr/local/etc/apache24
$ sudo make

オレオレ証明書を作成するMakefileです。

all: server.csr
 
rand.txt:
	dd if=/dev/urandom bs=512 count=512 | openssl md5 -out $@
 
server.key: rand.txt
	openssl genrsa -out $@ -rand rand.txt 2048
 
server.csr: server.key
	openssl req -batch -new -key server.key -out server.csr -subj "/C=JP/ST=Tokyo/L=Musashino-shi/O=Foo/OU=Bar/CN=foo.bar.com"
 
server.crt: server.csr server.key
	openssl x509 -in server.csr -out $@ -req -signkey server.key -days 73000 -sha256
 
clean:
	@rm -f ./server.crt server.csr server.key
SSLSessionCache: 'shmcb' session cache not supported (known names: ).
Maybe you need to load the appropriate socache module (mod_socache_shmcb?).

関連項目




スポンサーリンク