Public domain
# openssl genrsa -des3 -out server.key 1024
Generating RSA private key, 1024 bit long modulus
................++++++
....................++++++
e is 65537 (0x10001)
Enter pass phrase for server.key: 1234
Verifying - Enter pass phrase for server.key: 1234
# openssl req -new -key server.key -out server.csr
Enter pass phrase for server.key: 1234
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]:IR
State or Province Name (full name) [Some-State]:Zanjan
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:ISP
Organizational Unit Name (eg, section) []:IT
Common Name (eg, YOUR name) []:83.170.42.23
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
# cp server.key server.key.org
# openssl rsa -in server.key.org -out server.key
Enter pass phrase for server.key.org: 1234
writing RSA key
# openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Signature ok
subject=/C=IR/ST=Zanjan/O=ISP/OU=IT/CN=83.170.42.23
Getting Private key
cp server.crt /etc/httpd/
cp server.key /etc/httpd/
LoadModule ssl_module lib/httpd/modules/mod_ssl.so
Include /etc/httpd/extra/httpd-ssl.conf
/etc/rc.d/rc.httpd stop
/etc/rc.d/rc.httpd start
BY: Pejman Moghadam
TAG: https, openssl, apache
DATE: 2012-01-25 15:45:36