DbAppWeb.com

Menu
  • Home
  • Linux
  • HP-UX
  • macOS
  • Windows
  • Web Servers
  • App Servers
  • Storage

How to Generate Certificate Signing Request (CSR) for Apache SSL

September 22, 2016 DbAppWeb Admin
The utility “openssl” is used to generate the key and CSR. This utility comes with the OpenSSL package and is usually installed under /usr/local/ssl/bin. If the utility was installed elsewhere, these instructions will need to be adjusted accordingly.
In this example, CSR was generated for Apache 2.2.3 running on RHEL 5.8 system.

Generate Certificate Signing Request (CSR)

Generate Private Key

Type the following command at the prompt:

openssl genrsa -des3 -out <private key file name>.key 2048

Example:

[root@TestServer ~]# openssl genrsa -des3 -out dbappweb.key 2048
Generating RSA private key, 2048 bit long modulus
.+++………………………………………………+++
e is 65537 (0x10001)
Enter pass phrase for dbappweb.key:
Verifying – Enter pass phrase for dbappweb.key:
[root@TestServer ~]#
 
When prompted for a pass phrase: enter a secure password and remember it, as this passphrase is what protects the private key. Both the private key and the certificate are required to enable SSL.
NOTE: To bypass the passphrase requirement, omit the -des3 option when generating the private key. If the private key is left unprotected, Symantec recommends access to the server be restricted so that only authorized server administrators can access or read the private key file.

Type the following command at the prompt:

openssl req -new -key <private key file name>.key -out <csr file name>.csr

openssl req -new -key <private key file name>.key -out <csr file name>.csr

Example:

[root@TestServer ~]# openssl req -new -key dbappweb.key -out dbappweb.csr
Enter pass phrase for dbappweb.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]:IN
State or Province Name (full name) [Berkshire]:Delhi
Locality Name (eg, city) [Newbury]:New Delhi
Organization Name (eg, company) [My Company Ltd]: DB APP WEB
Organizational Unit Name (eg, section) [ ]: SSL  Department
Common Name (eg, your name or your server’s hostname) [ ]:www.dbappweb.com
Email Address [ ]:Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password [ ]:
An optional company name [ ]:
[root@TestServer ~]#
Country Name: Use the two-letter code without punctuation for country, for example:US or CA.
State or Province: Spell out the state completely; do not abbreviate the state or province name, for example: California
Locality or City: The Locality field is the city or town name, for example: Berkeley. Do not abbreviate. For example: Saint Louis, not St. Louis
Company: If the company or department has an &, @, or any other symbol using the shift key in its name, the symbol must be spelled out or omitted, in order to enroll. Example: XY & Z Corporation would be XYZ Corporation or XY and Z Corporation.
Organizational Unit: The Organizational Unit (OU) field is the name of the department or organization unit making the request. To skip the OU field, press Enter on the keyboard.
Common Name: The Common Name is the Host + Domain Name. It looks like “www.company.com” or “company.com”.

NOTE: Please do not enter an email address, challenge password or an optional company name when generating the CSR.A public/private key pair has now been created. The private key (dbappweb.key) is stored locally on the server machine and is used for decryption. The public portion, in the form of a Certificate Signing Request (dbappweb.csr), will be submitted for certificate enrollment.

Backup the private key

It is recommended to back up the .key file and storing of the corresponding passphrase. A good choice is to create a copy of this file onto a diskette or other removable media. While backing up the CSR is not required, having one will be helpful in the instance of server failure.
Last Updated: Apr 17, 2016

 

Prev Article
Next Article
Tags:Apache 2.2.3 Linux Sys Admin

Leave a Reply Cancel Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Popular
  • Recent

Categories

  • Android (2)
  • Blogger (16)
  • Domain and Hosting (1)
  • Hardware Issues (7)
  • HP-UX (55)
  • HPE Data Protector (9)
  • IBM Lotus Notes (2)
  • IBM WebSphere Application Server (16)
  • Internet Tips & Tricks (15)
  • iOS (8)
  • JBoss/WildFly Application Server (2)
  • Linux (76)
  • macOS (15)
  • Microsoft Windows (31)
  • News and Updates (11)
  • Oracle Database (5)
  • SSL/TLS (1)
  • Storage Servers (23)
  • Tools/Softwares (1)
  • VMware ESXi (17)
  • Web Servers (14)
  • WordPress (5)

Archives

DbAppWeb.com

Solution of Database, Application and Web Server Problems

About DbAppWeb.com

One Stop Solution for Database Server, Application Server and Web Server Problems.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

DbAppWeb on Social Media

Copyright © 2025 DbAppWeb.com
Terms and Conditions   Theme by MyThemeShop.com