DbAppWeb.com

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

How to Generate Certificate Signing Request (CSR) for Apache Using OpenSSL

February 8, 2019 DbAppWeb Admin

Certificate Signing Request (CSR) is required for placing an order to obtain an SSL certificate from any SSL certificate provider.  You can create your certificate signing request (CSR) for your Apache web server with the OpenSSL utility. OpenSSL utility comes with the OpenSSL package and is usually installed under /usr/bin/openssl. You can find the installed location of the utility using the below command:

[root@dbappweb ~]# whereis openssl
openssl: /usr/bin/openssl /usr/lib64/openssl /usr/share/man/man1/openssl.1ssl.gz

Generate Certificate Signing Request (CSR) for Apache Using OpenSSL

Follow the below instructions to use OpenSSL to create your certificate signing request (CSR) on your Apache server.

Step 1: Generating the Private Key

generate the private key using the below command, and provide the passphrase to enhance the security of the apache service. This passphrase will be required when you will start the apache service after installing the SSL certificate. The private key dbappweb.key will be stored in the current working directory.

[root@dbappweb ~]# 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@dbappweb ~]#

Step 2: Generating the Certificate Signing Request (CSR)

Generate the Certificate Signing Request (CSR) using the below command by using the private key generated in the first step and passphrase. The Generated CSR (dbappweb.csr) will be stored in the current working directory.

[root@dbappweb ~]# 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) [XX]:IN
State or Province Name (full name) []:Delhi
Locality Name (eg, city) [Default City]:New Delhi
Organization Name (eg, company) [Default Company Ltd]:Database Applictaion and Web Server
Organizational Unit Name (eg, section) []:DbAppWeb
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@dbappweb ~]#

Inputs are given in step 2 for various parameters are described below:

Country Name: Use the two-letter code without punctuation for country, for example:US or CA or IN etc..
State or Province: Spell out the state completely; do not abbreviate the state or province name, for example: California, Delhi etc.
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, New Delhi etc.
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 that you should keep the backup of the private key (in my case it is dbappweb.key) on removable media or the backup server if you have one.

Last Updated: February 08, 2019

Prev Article
Next Article
Tags:Apache Apache 2.2.3 openSSL RHEL RHEL 6.8 SSL

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