参考:Webサーバー間通信内容暗号化(Apache+mod_SSL) – CentOSで自宅サーバー構築


centos 5

# cd /etc/pki/tls/certs/
# sed -i ‘s/365/3650/g’ Makefile
# make server.crt
umask 77 ;
/usr/bin/openssl genrsa -des3 1024 > server.key
Generating RSA private key, 1024 bit long modulus
e is 65537 (0x10001)
Enter pass phrase: ← 任意のパスワードを応答※表示はされない
Verifying – Enter pass phrase: ← 任意のパスワードを応答(確認)※表示はされない
umask 77 ;
/usr/bin/openssl req -utf8 -new -key server.key -x509 -days 3650 -out server.crt -set_serial 0
Enter pass phrase for server.key: ← 上記で応答したパスワードを応答※表示はされない
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) [GB]:JP ← 国名応答
State or Province Name (full name) [Berkshire]:Hokkaido ← 都道府県名応答
Locality Name (eg, city) [Newbury]:Asahikawasi ← 市区町村名応答
Organization Name (eg, company) [My Company Ltd] ← サイト名応答(なんでもいい)
Organizational Unit Name (eg, section) []: ← 空ENTER
Common Name (eg, your name or your server’s hostname) [] ← Webサーバー名応答
Email Address [] ← 管理者メールアドレス応答

# openssl rsa -in server.key -out server.key ← サーバー用秘密鍵からパスワード削除
Enter pass phrase for server.key: ← サーバー用秘密鍵・証明書作成時のパスワード応答※表示はされない
writing RSA key