How to Create an Apache Self Signed Certificate

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

SSL is an important factor to encrypt all web traffic sent to and from your Apache web site. It secures all personal data and communication between users and web server. Before creating a self signed certificate make sure that you have installed OpenSSL in your system.

Steps to create a Self Signed Certificate in Apache

Step 1. Generate the private key using following commend

openssl genrsa -des3 -out server.key 1024

You will be asked for password twice time. Put a strong password and remember it to install SSL Certificate.

Step: 2. Once you have generated private key and also installed OpenSSL, run the following commend to create an Apache self signed certificate-

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mysitename.key -out mysitename.crt

Step:3. As you enter above commend you will be promoted to enter several information related to organization.

Country Name (2 letter code) [GB]:
State or Province Name (full name) [Berkshire]:
Locality Name (eg, city) [Newbury]:
Organization Name (eg, company) [My Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server’s hostname) []: FQDN of the server
Email Address []: myaddress at
Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

The commen name should be mataches the Fully Qualified DomainName of your SSL website. The email address, challenge password, and optional company is not mandatory and you can leave it blank. As finishing the process, you will have two files: a mysitename.key file and a mysitename.crt self signed certificate file valid for 1 year.