「Apache Module mod ssl」の版間の差分

提供: セキュリティ
移動: 案内検索
(ページの作成:「<!-- vim: filetype=mediawiki --> Apache module mod_ssl は、SSLApache HTTP Serverのモジュールです。 読み方 もっ...」)
 
 
(同じ利用者による、間の2版が非表示)
行1: 行1:
<!--
 
vim: filetype=mediawiki
 
-->
 
 
 
Apache module mod_ssl は、[[Transport Layer Security|SSL]] の [[Apache HTTP Server]]のモジュールです。
 
Apache module mod_ssl は、[[Transport Layer Security|SSL]] の [[Apache HTTP Server]]のモジュールです。
  
読み方
+
'''読み方'''
 
+
;mod_ssl:もっどえすえすえる
もっどえすえすえる
+
  
 
__TOC__
 
__TOC__
  
 
== 概要 ==
 
== 概要 ==
 
 
Webサービスでセキュアな通信が求められるときに、[[HTTPS]] でサービスするときに利用します。
 
Webサービスでセキュアな通信が求められるときに、[[HTTPS]] でサービスするときに利用します。
  
 
== インストール ==
 
== インストール ==
 
 
FreeBSD の場合は、Apache 2 をインストールするときに、 make config の画面で mod_ssl にチェックを入れてビルドします。
 
FreeBSD の場合は、Apache 2 をインストールするときに、 make config の画面で mod_ssl にチェックを入れてビルドします。
  
 
{{ports|/usr/ports/www/apache22|apache22}}
 
{{ports|/usr/ports/www/apache22|apache22}}
 
 
== 使い方 ==
 
== 使い方 ==
 +
== apache 2.4 ==
 +
 +
mod_ssl.soとmod_socache_shmcb.soを有効にします。
 +
/usr/local/etc/apache24/httpd.conf
 +
<syntaxhighlight lang="apache">
 +
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
 +
</syntaxhighlight>
 +
 +
下で示すMakefileを実行して、オレオレ証明書を作成します。
 +
<syntaxhighlight lang="bash">
 +
$ cd /usr/local/etc/apache24
 +
$ sudo make
 +
</syntaxhighlight>
 +
 +
オレオレ証明書を作成するMakefileです。
 +
<syntaxhighlight lang="make">
 +
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
 +
</syntaxhighlight>
 +
 +
<syntaxhighlight lang="bash">
 +
SSLSessionCache: 'shmcb' session cache not supported (known names: ).
 +
Maybe you need to load the appropriate socache module (mod_socache_shmcb?).
 +
 +
</syntaxhighlight>
  
 
== 関連項目 ==
 
== 関連項目 ==
 +
{{apache}}
  
* [[Apache HTTP Server]]
+
{{ca}}
 +
<!-- vim: filetype=mediawiki
 +
-->

2014年4月10日 (木) 00:26時点における最新版

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?).

関連項目