#freeze ●SSL対応(自己署名) /* CA作成 */ /usr/share/ssl/misc/CA -newca /bin/chmod 400 /usr/share/ssl/misc/demoCA/private/cakey.pem /bin/chmod 700 /usr/share/ssl/misc/demoCA/private /* サーバ鍵作成 */ ・RSA形式の秘密鍵の作成 /usr/bin/openssl genrsa -des3 -rand /var/log/messages -out /etc/httpd/conf/ssl.key/server.key 1024 ・パスフレーズ解除 /usr/bin/openssl rsa -in /etc/httpd/conf/ssl.key/server.key -out /etc/httpd/conf/ssl.key/server.key /* 証明書署名要求作成 */ /usr/bin/openssl req -new -key /etc/httpd/conf/ssl.key/server.key -out /etc/httpd/conf/ssl.csr/server.csr /* CAのカウンタ */ /bin/echo 01 > /usr/share/ssl/misc/demoCA/cacert.srl /* 証明書作成(10年物) */ /usr/bin/openssl x509 -req (-CA /usr/share/ssl/misc/demoCA/cacert.pem -CAkey /usr/share/ssl/misc/demoCA/private/cakey.pem) -in /etc/httpd/conf/ssl.csr/server.csr -out /etc/httpd/conf/ssl.crt/server.crt -signkey /etc/httpd/conf/ssl.key/server.key -days 3650 (-CAserial /usr/share/ssl/misc/demoCA/cacert.srl) /* パーミッション変更 */ /bin/chmod 400 /etc/httpd/conf/ssl.key/server.key /bin/chmod 400 /etc/httpd/conf/ssl.csr/server.csr /bin/chmod 400 /etc/httpd/conf/ssl.crt/server.crt /* httpd.conf設定 */ ~~~~~~~~~~ ※SSLは名前ベースのバーチャルドメインでは使用できないことに注意!!! (httpの前にSSL認証が先に行われ、その時点ではホスト名がわからず、 一番先頭のバーチャルホストと証明書の交換を行おうとするため?) ●tips ・apache configチェック apachectl configtest httpd -t ●PHPを動かす httpd.confやconf.d/php.confに LoadModule php5_module libexec/libphp5.so AddType application/x-httpd-php .php DirectoryIndex index.php とか LoadModule php5_module libexec/libphp5.so AddHandler php5-script .php AddType text/html .php DirectoryIndex index.php を追加