mod_sslはApacheにSSL通信機能を付加するモジュールです。Apache標準のモジュールではなく、mod_sslプロジェクトでサポートされる独自のモジュールです。
このサイトでは、mod_sslについてApache+SSLのインストールで説明しています。
./configure \ --mandir=/usr/local/man \ --enable-rule=EAPI --enable-rule=SSL_COMPAT \ --enable-rule=SHARED_CORE --enable-rule=SHARED_CHAIN \ --enable-module=so --enable-module=ssl \ --enable-module=info --enable-module=expires --enable-module=unique_id \ --enable-module=vhost_alias --enable-module=rewrite \ --enable-module=log_referer \ --enable-shared=ssl --enable-shared=info --enable-shared=status \ --enable-shared=expires --enable-shared=unique_id \ --enable-shared=auth --enable-shared=actions --enable-shared=cgi \ --enable-shared=env --enable-shared=dir --enable-shared=userdir \ --enable-shared=log_config --enable-shared=log_referer \ --enable-shared=negotiation --enable-shared=setenvif \ --enable-shared=include --enable-shared=unique_id \ --enable-shared=alias --enable-shared=vhost_alias --enable-shared=rewrite
Apacheが動くように設定ファイルを編集します。
LAN内で使うための設定です。外部に公開する場合は、セキュリティホールが出ないように設定を変更する必要があります。
|
ExtendedStatus On
|
<IfDefine SSL>
Listen 443
</IfDefine>
|
ServerAdmin root@agartha
|
ServerName agartha
|
<Directory /home/*/public_html>
AllowOverride All
Options MultiViews Indexes SymLinksIfOwnerMatch ExecCGI
</Directory>
|
<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.php
</IfModule>
|
HostnameLookups On
|
<IfModule mod_alias.c>
ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
</IfModule>
|
<IfModule mod_mime.c>
AddHandler cgi-script .cgi
</IfModule>
|
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from localhost agartha tir-n-org
</Location>
<Location /server-info>
SetHandler server-info
Order deny,allow
Deny from all
Allow from localhost agartha tir-n-org
</Location>
|
<IfDefine SSL>
<VirtualHost _default_:443>
ServerName agartha
ServerAdmin root@agartha
SSLCertificateFile /usr/local/apache/conf/ssl/server.crt
SSLCertificateKeyFile /usr/local/apache/conf/ssl/server.key
</VirtualHost>
</IfDefine>
Linux起動時にApacheが自動的に起動するように設定します。
次の手順で起動・終了スクリプトを設定します。
上記までの設定が終了すればApacheは起動できます。
以下の手順でApacheを起動します。
http://agartha/server-info にアクセスして、Apacheの情報を見ることはできれば
Apacheは正常に動いています。
自前で証明書を作成するを参考にして、証明書を作成します。
作成方法の詳細は、自前で証明書を作成するを見てください。
これで、/usr/local/apache/conf/ssl/下に
server.csr
server.crt
の2つのファイルができていればOkです。
次の手順でApacheを再起動します。これでssl付きでApacheを起動します。
Copyright © 1997 - by A.G.Labo
(webmaster@aglabo.com) $Revision: 2 $