WWW を検索 NOGNOG.COM を検索

WWW.NOGNOG.COM

Last modified: Sun, 17 Feb 2008 17:25:08 +0900
Home   うにっくすさんの覚え書き   プリングルズ   MIDI   ユーザー車検   「小沢昭一の小沢昭一的こころ」のススメ   Blog  

Apache2(Win32) - SSL/TLS(mod_ssl)

 Win32版Apache2をSSL/TLSサーバ(httpd)として構築します。

用意するもの


  • apache_2.2.6-win32-x86-openssl-0.9.8e.msi

  • 公式ページ

  • ダウンロードページ

    展開&インストール


    ダウンロードした「apache_2.2.6-win32-x86-no_ssl.msi」ファイルをダブルクリックます。
      apache2_win32_modssl_01.png

    インストールウィザードが開始されます。
      apache2_win32_modssl_02.png

    インストールウィザード画面が表示されますので、「Next」をクリック進みます。
      apache2_win32_modssl_03.png

    ライセンスを読み、許諾出来るのであれば、「I accept the terms in the license agreement」をチェックして進みます。
      apache2_win32_modssl_04.png

    「Next」を押して進みます。
      apache2_win32_modssl_05.png

    インストールするサーバの情報(ドメイン、FQDN、Webマスターのメールアドレス)を入力します。
      apache2_win32_modssl_06.png

    インストールタイプを選択します。ここでは「Typical」のまま進みます。
      apache2_win32_modssl_07.png

    インストールするディレクトリを確認します。
    今回はデフォルトディレクトリのままとするため、そのまま「Next」をクリック進みます。
      apache2_win32_modssl_08.png

    インストールの初期設定が整いました。
    「Install」をクリックしてインストールを開始します。
      apache2_win32_modssl_09.png

    インストールが開始されます。
      apache2_win32_modssl_10.png

    サービスの登録も自動で行われます。
      apache2_win32_modssl_11.png

    インストールが完了しました。
    「Finish」をクリックしてインストールウィザードを終了します。
      apache2_win32_modssl_12.png

    コンフィグレーション


    • C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf

      下記の修正を適用します。

      --- httpd.conf.orig     2007-12-30 12:36:14.244677000 +0900
      +++ httpd.conf  2007-12-30 12:36:13.607501000 +0900
      @@ -111,7 +111,7 @@
       LoadModule userdir_module modules/mod_userdir.so
       #LoadModule usertrack_module modules/mod_usertrack.so
       #LoadModule vhost_alias_module modules/mod_vhost_alias.so
      -#LoadModule ssl_module modules/mod_ssl.so
      +LoadModule ssl_module modules/mod_ssl.so
      
       # 'Main' server configuration
       #
      @@ -472,7 +470,7 @@
       #Include conf/extra/httpd-default.conf
      
       # Secure (SSL/TLS) connections
      -#Include conf/extra/httpd-ssl.conf
      +Include conf/extra/httpd-ssl.conf
       #
       # Note: The following must must be present to support
       #       starting without SSL on platforms with no /dev/random equivalent

    • C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd-ssl.conf

      下記の修正を適用します。

      --- httpd-ssl.conf.orig 2007-12-30 12:36:13.128352000 +0900
      +++ httpd-ssl.conf      2007-12-30 12:36:12.684968000 +0900
      @@ -65,7 +65,7 @@
       #   Semaphore:
       #   Configure the path to the mutual exclusion semaphore the
       #   SSL engine uses internally for inter-process synchronization.
      -SSLMutex  "file:C:/Program Files/Apache Software Foundation/Apache2.2/logs/ssl_mutex"
      +SSLMutex  default
      
       ##
       ## SSL Virtual Host Context
      @@ -96,16 +98,14 @@
       #   in mind that if you have both an RSA and a DSA certificate you
       #   can configure both in parallel (to also allow the use of DSA
       #   ciphers, etc.)
      -SSLCertificateFile "C:/Program Files/Apache Software Foundation/Apache2.2/conf/server.crt"
      -#SSLCertificateFile "C:/Program Files/Apache Software Foundation/Apache2.2/conf/server-dsa.crt"
      +SSLCertificateFile "C:/www.example.com.pem"
      
       #   Server Private Key:
       #   If the key is not combined with the certificate, use this
       #   directive to point at the key file.  Keep in mind that if
       #   you've both a RSA and a DSA private key you can configure
       #   both in parallel (to also allow the use of DSA ciphers, etc.)
      -SSLCertificateKeyFile "C:/Program Files/Apache Software Foundation/Apache2.2/conf/server.key"
      -#SSLCertificateKeyFile "C:/Program Files/Apache Software Foundation/Apache2.2/conf/server-dsa.key"
      +SSLCertificateKeyFile "C:/www.example.com.key"
      
       #   Server Certificate Chain:
       #   Point SSLCertificateChainFile at a file containing the

    SSL鍵の作成


      C:\>"C:\Program Files\Apache Software Foundation\Apache2.2\bin\openssl.exe" req -x509 -config "C:\Program Files\Apache Software Foundation\Apache2.2\conf\openssl.cnf" -new -nodes -days 7300 -out "C:\www.example.com.pem" -keyout "C:\www.example.com.key"

        apache2_win32_modssl_13.png

    Apacheサービスの起動


      apache2_win32_modssl_14.png
      apache2_win32_modssl_15.png

    動作確認


      ブラウザで該当サーバへHTTPSアクセスして、画面が表示されれば完了です。

        apache2_win32_modssl_16.png

    うにっくすさんの覚え書きについて

    Home >> うにっくすさんの覚え書き >> Apache2(Win32) - SSL/TLS(mod_ssl)