apache2 の証明書の作成(Ubuntu 8.04)
| $ sudo -i |
# cd /etc/ssl/private # openssl genrsa -des3 1024 > apache.key Generating RSA private key, 1024 bit long modulus ...++++++ ....................++++++ e is 65537 (0x10001) Enter pass phrase: Verifying - Enter pass phrase: |
<---適当に入力 <---適当に入力 |
| # chown root.ssl-cert apache.key # chmod 640 apache.key |
# openssl rsa -in apache.key -out apache.key Enter pass phrase for test.key: writing RSA key |
<--- 1.で入力した パスフレーズを入力 |
# cd ../certs # openssl req -utf8 -new -key ../private/apache.key -x509 -days 365 -out apache.pem -set_serial 0 You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:JP State or Province Name (full name) [Some-State]:Tokyo Locality Name (eg, city) []:Bunkyo-ku Organization Name (eg, company) [Internet Widgits Pty Ltd]:Terra Corp. Organizational Unit Name (eg, section) []:HQ Common Name (eg, YOUR name) []:www.la-terre.co.jp Email Address []:webmaster.la-terre.co.jp |
<--- 国コードを入力 <--- 都道府県名を入力 <--- 市区町村名を入力 <--- 会社名を入力 <--- 組織名称を入力 <--- サーバのホストネーム <--- 連絡先 |
| # a2ensite httpd-ssl.conf |
92 # Server Certificate: 93 # Point SSLCertificateFile at a PEM encoded certificate. If 94 # the certificate is encrypted, then you will be prompted for a 95 # pass phrase. Note that a kill -HUP will prompt again. Keep 96 # in mind that if you have both an RSA and a DSA certificate you 97 # can configure both in parallel (to also allow the use of DSA 98 # ciphers, etc.) 99 SSLCertificateFile "/etc/ssl/certs/apache.pem" 100 #SSLCertificateFile "/etc/apache2/server-dsa.crt" 101 102 # Server Private Key: 103 # If the key is not combined with the certificate, use this 104 # directive to point at the key file. Keep in mind that if 105 # you've both a RSA and a DSA private key you can configure 106 # both in parallel (to also allow the use of DSA ciphers, etc.) 107 SSLCertificateKeyFile "/etc/ssl/private/apache.key" 108 #SSLCertificateKeyFile "/etc/apache2/server-dsa.key" 109 |
<--- この行を追加 <--- この行を追加 |
