CentOS 5.6 & Create CSR

deklinm used Ask the Experts™
I need to create a CSR and a private key so I can setup https for my website.   My web server is running CentOS 5.6. I have never done this before and am looking for step by step instructions on how to perform this.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
First you will want to make sure you have the right dependencies:

yum install mod_ssl openssl

Then you will generate the self signed certificate:

# Generate private key
openssl genrsa -out ca.key 1024

# Generate CSR
openssl req -new -key ca.key -out ca.csr

# Generate Self Signed Key
openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt

# Copy the files to the correct locations
cp ca.crt /etc/pki/tls/certs
cp ca.key /etc/pki/tls/private/ca.key
cp ca.csr /etc/pki/tls/private/ca.csr

Make sure that your virtual hosts are setup correctly and that there is a virtual host record for SSL such as:

<VirtualHost *:443>
        SSLEngine on
        SSLCertificateFile /etc/pki/tls/certs/ca.crt
        SSLCertificateKeyFile /etc/pki/tls/private/ca.key
        <Directory /var/www/vhosts/yoursite.com/httpsdocs>
        AllowOverride All
        DocumentRoot /var/www/vhosts/yoursite.com/httpsdocs
        ServerName yoursite.com

After that restart Apache with /etc/init.d/httpd/restart


The above commands generate a 1024 bit kit.  I tried to run the above command wth replacing the 1024 with 2048 but it did not work.

How do i perform the above task with the 2048 byte requirement?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial