coolcommands.com - the search engine for unix sysadmins :: unix commands and scripts
Sunday May 27, 2012


 Home
 Search
 Advanced Search
 Category Search
 Affiliates
 Acknowledgements
 Cool Links

Username

Password

Remember me
Forgot your password?
Create an account

Who's Online
We have 24 guests online

Newest Member

beyondimagem

Hit Counter
9133545 Visitors

cool Statistics
coolcommands:1330
Categories:83
Total queries:595500
Members:16437





Category Search coolcommands.com
Select Category:


coolcommand

how to generate a SSL certificate with Apache and mod_ssl
Description

Before you begin, you must have openssl already installed.

1) The first step is to create your RSA Private Key. This key is a 1024 bit RSA key which is encrypted using Triple-DES and stored in a PEM format so that it is readable as ASCII text. We will use several files as random seed enhancers which will help to make the key more secure. Text files that have been compressed with a utility such as gzip are good choices. The key is generated using the following command, where file1:file2:etc represents the random compressed files.

# openssl genrsa -des3 -rand file1:file2:file3:file4:file5 -out server.key 1024

The command will prompt you for a pass-phrase and then store the key in the file server.key. It is critical that the pass-phrase be secure and not forgotten.

2) Once the private key is generated, a Certificate Signing Request can be generated.:

# openssl req -new -key server.key -out server.csr

Answer all the questions accordingly and enter the pass-phrase from step 1 when requested.

The CSR is then used in one of two ways:

OPTION 1, the CSR will be sent to a Certificate Authority:

Action: Send the file server.csr to the Certificate Signing Authority selected.

OPTION 2 is to self-sign the CSR:

# openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

This will create a certificate valid for 365 days.

3) Once you receive your certificate or you generated a self-signed one, you are now ready to install it. One unfortunate side-effect of the pass-phrased private key is that Apache will ask for the pass-phrase each time the web server is started. To avoid this, type:

# openssl rsa -in server.key -out server.pem

4) Now secure the server.pem file so only root can read it:

# chmod 400 server.pem

5) Now install the private key and certificate. Look for the following lines in your Apache configuration file, httpd.conf (or ssl.conf if it is an include):

SSLCertificateFile /usr/local/apache/etc/ssl.crt/server.crt
SSLCertificateKeyFile /usr/local/apache/etc/ssl.key/server.pem
Example

openssl genrsa -des3 -rand file1:file2:file3:file4:file5 -out server.key 1024;openssl req -new -key server.key -out server.csr

Return to search results

Random coolcommands

coolcommand: trcrpt - how to generate a report from a trace in IBM AIX
Example: trcrpt
[show me the details]
coolcommand: chsyscfg command will change the hardware resource configuration
Example: chsyscfg -r [ alpar | lpar | prof | sysprof ] -m "managed- system" [ -p "partition-name" ] [ -f configuration-file | -i attribute-value ="value" ... ] -n name [ —help ]
[show me the details]
coolcommand: mkfile - to create a large file in Sun Solaris
Example: mkfile 500m bigfile
[show me the details]
coolcommand: klist - how to display the contents of a kerberos credential cache or key table
Example: klist
[show me the details]

coolcommands.com - the search engine for UNIX sysadmins :: unix commands and scripts



FREE
myPMS

Password
Management
System

by

LVOware.com




Top 5 Submitters

lvo1152
audet37
kah00na32
Mariom24
lebjf00014

Top 5 Searches

Category Solaris49379
Category AIX46267
Category General UNIX43933
solaris22927
aix22116

Terms of Use
Privacy
Contact


 
coolcommands.com © 2012. All Right Reserved.
Programming by PRATTICO Consulting . Hosting by Apricusum