# mount /dev/cdrom /media/cdrom
mount: block device /dev/cdrom is write-protected, mounting read-only
# cd /media/cdrom/CentOS/
# rpm -ihv apr-1.2.7-11.el5_3.1.i386.rpm
warning: apr-1.2.7-11.el5_3.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:apr ########################################### [100%]
# rpm -ihv postgresql-libs-8.1.11-1.el5_1.1.i386.rpm
warning: postgresql-libs-8.1.11-1.el5_1.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:postgresql-libs ########################################### [100%]
# rpm -ihv apr-util-1.2.7-7.el5_3.2.i386.rpm
warning: apr-util-1.2.7-7.el5_3.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:apr-util ########################################### [100%]
# rpm -ihv httpd-2.2.3-31.el5.centos.i386.rpm
warning: httpd-2.2.3-31.el5.centos.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:httpd ########################################### [100%]
# rpm -ihv gmp-4.1.4-10.el5.i386.rpm
warning: gmp-4.1.4-10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:gmp ########################################### [100%]
# rpm -ihv php-common-5.1.6-23.2.el5_3.i386.rpm
warning: php-common-5.1.6-23.2.el5_3.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:php-common ########################################### [100%]
# rpm -ihv php-mbstring-5.1.6-23.2.el5_3.i386.rpm
warning: php-mbstring-5.1.6-23.2.el5_3.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:php-mbstring ########################################### [100%]
# rpm -qa | grep openssl
openssl-0.9.8e-12.el5
# cd /etc/pki/tls/misc
# cd /etc/pki/tls/
# cp -piv openssl.conf openssl.cnf.bk100508
`openssl.cnf' -> `openssl.cnf.bk100508'
# vi openssl.cnf
# diff openssl.cnf.bk100508 openssl.cnf
76c76
< default_days = 365 # how long to certify for
---
> default_days = 3650 # how long to certify for
178c178
< basicConstraints=CA:FALSE
---
> basicConstraints=CA:TRUE
# pwd
/etc/pki/tls/misc
# ./CA -newca
mkdir: cannot create directory `../../CA': File exists
mkdir: cannot create directory `../../CA/private': File exists
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 - 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) [GB]:JP
State or Province Name (full name) [Berkshire]:Tokyo
Locality Name (eg, city) [Newbury]:Edogawa-ku
Organization Name (eg, company) [My Company Ltd]:ranonet.ne.jp
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:www.ranonet.ne.jp
Email Address []:webmaster@ranonet.ne.jp
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
Using configuration from /etc/pki/tls/openssl.cnf
Enter pass phrase for ../../CA/private/./cakey.pem:
Check that the request matches the signature
Signature ok
Certificate Details:
Serial Number: 0 (0x0)
Validity
Not Before: May 8 00:22:18 2010 GMT
Not After : May 7 00:22:18 2013 GMT
Subject:
countryName = JP
stateOrProvinceName = Tokyo
organizationName = ranonet.ne.jp
organizationalUnitName =
commonName = www.ranonet.ne.jp
emailAddress = webmaster@ranonet.ne.jp
X509v3 extensions:
X509v3 Basic Constraints:
CA:TRUE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
95:51:3C:7E:6A:DA:68:1A:76:21:32:FC:DB:7D:A8:69:CC:9C:AD:C3
X509v3 Authority Key Identifier:
keyid:95:51:3C:7E:6A:DA:68:1A:76:21:32:FC:DB:7D:A8:69:CC:9C:AD:C3
Certificate is to be certified until May 7 00:22:18 2013 GMT (1095 days)
Write out database with 1 new entries
Data Base Updated
# cd /etc/httpd/conf
# cp -piv httpd.conf httpd.conf.bk100508
`httpd.conf' -> `httpd.conf.bk100508'
# vi httpd.conf
# ln -s /usr/bin/perl /usr/local/ibin/perl
# ll /usr/local/bin
total 0
lrwxrwxrwx 1 root root 13 May 8 10:37 perl -> /usr/bin/perl
# chkconfig --list httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
# chkconfig ohttpd on
# chkconfig httpd on--list httpd
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# /etc/rc.d/init.d/httpd start
httpd を起動中: [ OK ]
# mount /dev/cdrom /media/cdrom
mount: block device /dev/cdrom is write-protected, mounting read-only
mount: /dev/cdrom already mounted or /media/cdrom busy
mount: according to mtab, /dev/hdc is already mounted on /media/cdrom
# cd /media/cdromC/CentOS/
# rpm -ihv distcache-1.4.5-14.1.i386.rpm
warning: distcache-1.4.5-14.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:distcache ########################################### [100%]
# rpm -ihv mod_ssl-2.2.3-31.el5.centos.i386.rpm
warning: mod_ssl-2.2.3-31.el5.centos.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:mod_ssl ########################################### [100%]
# cd /etc/httpd/conf.d/
# cp -piv ssl.conf ssl.conf.gkbk100508
`ssl.conf' -> `ssl.conf.bk100508'
# vi ssl.conf
# cd /etc/tlpki/tls
# ls
cert.pem certs misc openssl.cnf openssl.cnf.bk100508 private
# cd certs
# pwd
/etc/pki/tls/certs
# ll
total 460
-rw-r--r-- 1 root root 441017 Sep 4 2009 ca-bundle.crt
-rw------- 1 root root 1468 May 8 10:43 localhost.crt
-rwxr-xr-x 1 root root 610 Sep 4 2009 make-dummy-cert
-rw-r--r-- 1 root root 2240 Sep 4 2009 Makefile
# cp -piv Makefile Makefile.bk100508
`Makefile' -> `Makefile.bk100508'
# vi Makefile
# diff Makefile.bk100508 Makefile
41c41
< /usr/bin/openssl req $(UTF8) -newkey rsa:1024 -keyout $$PEM1 -nodes -x509 -days 365 -out $$PEM2 -set_serial $(SERIAL) ; \
---
> /usr/bin/openssl req $(UTF8) -newkey rsa:1024 -keyout $$PEM1 -nodes -x509 -days 3650 -out $$PEM2 -set_serial $(SERIAL) ; \
57c57
< /usr/bin/openssl req $(UTF8) -new -key $^ -x509 -days 365 -out $@ -set_serial $(SERIAL)
---
> /usr/bin/openssl req $(UTF8) -new -key $^ -x509 -days 3650 -out $@ -set_serial $(SERIAL)
74c74
< /usr/bin/openssl req $(UTF8) -new -key $(KEY) -x509 -days 365 -out $(CRT) -set_serial $(SERIAL)
---
> /usr/bin/openssl req $(UTF8) -new -key $(KEY) -x509 -days 3650 -out $(CRT) -set_serial $(SERIAL)
# 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]:Tokyo
Locality Name (eg, city) [Newbury]:Edogawa-ku
Organization Name (eg, company) [My Company Ltd]:ranonet.ne.jp
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:www.ranonet.ne.jp
Email Address []:webmaster@ranonet.ne.jp
# openssl rsa -in server.key -out server.key
Enter pass phrase for server.key:
writing RSA key
# ll
total 468
-rw-r--r-- 1 root root 441017 Sep 4 2009 ca-bundle.crt
-rw------- 1 root root 1468 May 8 10:43 localhost.crt
-rwxr-xr-x 1 root root 610 Sep 4 2009 make-dummy-cert
-rw-r--r-- 1 root root 2243 May 8 14:02 Makefile
-rw-r--r-- 1 root root 2240 Sep 4 2009 Makefile.bk100508
-rw------- 1 root root 1224 May 8 14:05 server.crt
-rw------- 1 root root 891 May 8 14:06 server.key
# chmod 400 server.*
# ll
total 468
-rw-r--r-- 1 root root 441017 Sep 4 2009 ca-bundle.crt
-rw------- 1 root root 1468 May 8 10:43 localhost.crt
-rwxr-xr-x 1 root root 610 Sep 4 2009 make-dummy-cert
-rw-r--r-- 1 root root 2243 May 8 14:02 Makefile
-rw-r--r-- 1 root root 2240 Sep 4 2009 Makefile.bk100508
-r-------- 1 root root 1224 May 8 14:05 server.crt
-r-------- 1 root root 891 May 8 14:06 server.key
# cd /etc/httpd.con/conf.d/
# ll
total 36
-rw-r--r-- 1 root root 566 Sep 4 2009 proxy_ajp.conf
-rw-r--r-- 1 root root 392 Sep 4 2009 README
-rw-r--r-- 1 root root 9677 Sep 4 2009 ssl.conf
-rw-r--r-- 1 root root 9677 Sep 4 2009 ssl.conf.bk100508
-rw-r--r-- 1 root root 299 Sep 4 2009 welcome.conf
# vi ssl.conf
# diff ssl.conf.bk100508 ssl.conf
112c112
< SSLCertificateFile /etc/pki/tls/certs/localhost.crt
---
> SSLCertificateFile /etc/pki/tls/certs/server.crt
119c119
< SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
---
> SSLCertificateKeyFile /etc/pki/tls/certs/server.key
# /etc/rc.d/init.d/httpd restart
httpd を停止中: [ OK ]
httpd を起動中: [ OK ]