Title: Greenstone.Installing.Linux.13
Created: 2011-11-23 23:52:30 +0000
wjl.monsoonhub.org
Edit /etc/hosts and add
127.0.0.1 wjl.monsoonhub.org
Create keys
$ sudo openssl req -new -x509 -extensions v3_ca -keyout private/cakey.pem -out cacert.pem -days 365 -config ./openssl.cnf Generating a 1024 bit RSA private key …….++++++ ..++++++ writing new private key to ‘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. —– Organization Name (company) [The Sample Company]:Wycliffe Global Alliance Organizational Unit Name (department, division) []:Asia Pacific Communication Email Address []:eric_swanson@wycliffe.net Locality Name (city, district) [Metropolis]:Singapore State or Province Name (full name) [New York]:Singapore Country Name (2 letter code) [US]:SG Common Name (hostname, IP, or your name) []:wjl.monsoonhub.org sysadmin@wjl:~/eric/CA$ sudo openssl req -new -nodes -out req.pem -config ./openssl.cnf Generating a 1024 bit RSA private key .++++++ ……………………………………..++++++ writing new private key to ‘key.pem’ —– 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. —– Organization Name (company) [The Sample Company]:Wycliffe Global Alliance Organizational Unit Name (department, division) []:Asia Pacific Communication Email Address []:eric_swanson@wycliffe.net Locality Name (city, district) [Metropolis]:Singapore State or Province Name (full name) [New York]:Singapore Country Name (2 letter code) [US]:SG Common Name (hostname, IP, or your name) []:wjl.monsoonhub.org $ sudo openssl ca -out cert.pem -config ./openssl.cnf -infiles req.pem Using configuration from ./openssl.cnf Enter pass phrase for ./private/cakey.pem: Check that the request matches the signature Signature ok The Subject’s Distinguished Name is as follows organizationName :PRINTABLE:‘Wycliffe Global Alliance’ organizationalUnitName:PRINTABLE:‘Asia Pacific Communication’ localityName :PRINTABLE:‘Singapore’ stateOrProvinceName :PRINTABLE:‘Singapore’ countryName :PRINTABLE:‘SG’ commonName :PRINTABLE:‘wjl.monsoonhub.org’ Certificate is to be certified until Nov 22 22:52:51 2012 GMT (365 days) Sign the certificate? [y/n]:y 1 out of 1 certificate requests certified, commit? [y/n]y Write out database with 1 new entries Data Base Updated $ sudo cat key.pem cert.pem >key-cert.pem
4. Copy certificate and key file to where Apache wants them
$ sudo cp ./cert.pem /etc/ssl/certs/cert.pem $ sudo cp ./key.pem /etc/ssl/private/key.pem
5. Edit /etc/apache2/sites-available/default-ssl to point to the new cert.pem and key.pem files:
# A self-signed (snakeoil) certificate can be created by installing
# the ssl-cert package. See
# /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
# If both key and certificate are stored in the same file, only the
# SSLCertificateFile directive is needed.
<b>#SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
# use wjl certificate created by Eric Swanson
SSLCertificateFile /etc/ssl/certs/cert.pem
#SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
# use wjl key created by Eric Swanson
SSLCertificateKeyFile /etc/ssl/private/key.pem</b>
$ sudo /etc/init.d/apache2 restart Restarting web server: apache2 … waiting .