| $ sudo apt-get install apache2 ssl-cert |
ns.shitomi.jp 及び mail.shitomi.jp の DocumentRoot に /var/www/errorを指定し, www.shitomi.jp, www.shitomi.net 及び www.shitomi.com の DocumentRoot に /var/www/www を指定します。
| $ sudo chown abc:root /var/www/error $ sudo chown abc.root /var/www/www |
|
| $ sudo /etc/init.d/apache2 restart |
|
| Redirect permanent /server/apache.html http://www.shitomi.jp/ubuntu804/apache.html |
| $ cd /tmp $ openssl req -new -out csr.pem |
| Using configuration from /usr/share/ssl/openssl.cnf Generating a 1024 bit RSA private key .......................++++++ ............++++++ unable to write 'random state' writing new private key to 'privkey.pem' Enter PEM pass phrase:[Passwordを入力] Verifying password - Enter PEM pass phrase:[Passwordを再入力] ----- 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]:Miyagi Locality Name (eg, city) []:Sendai Organization Name (eg, company) [Internet Widgits Pty Ltd]:Self Organizational Unit Name (eg, section) []:[リターンキーを押す] Common Name (eg, YOUR name) []:db.shitomi.jp Email Address []:[リターンキーを押す] Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []:[リターンキーを押す] An optional company name []:[リターンキーを押す] |
| $ sudo openssl rsa -in /tmp/privkey.pem -out /etc/ssl/private/apache.key |
| $ sudo rm -rf /usr/lib/ssl/misc/demoCA $ cd /usr/lib/ssl/misc/ $ sudo ./CA.sh -newca |
| CA certificate filename (or enter to create) [リターンキーを押す] Making CA certificate ... Generating a 1024 bit RSA private key ..++++++ ............++++++ writing new private key to '../../CA/private/./cakey.pem' Enter PEM pass phrase:[パスワードを入力] Verifying password - Enter PEM pass phrase:[パスワードを再入力] ----- 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]:Miyagi Locality Name (eg, city) []:Sendai Organization Name (eg, company) [Internet Widgits Pty Ltd]:Self Organizational Unit Name (eg, section) []:[リターンキーを押す] Common Name (eg, YOUR name) []:192.168.0.1 Email Address []:[リターンキーを押す] Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []:[リターンキーを押す] An optional company name []:[リターンキーを押す] |
| default_days = 365 |
| $ sudo openssl x509 -inform pem -outform der -in /usr/lib/ssl/misc/demoCA/cacert.pem -out /tmp/ca.cer |
| $ cd /usr/lib/ssl/misc $ sudo openssl ca -out /etc/ssl/certs/apache.crt -infiles /tmp/csr.pem |
| $ openssl x509 -fingerprint -noout -in /etc/ssl/certs/apache.crt |
443 番ポート (SSL) で Apache が利用できるようにします。
| $ sudo chown abc:root /var/www/ssl |
|
| $ sudo a2enmod ssl $ sudo a2ensite ssl |
| $ sudo /etc/init.d/apache2 restart |
| $ sudo /etc/init.d/apache2 restart |