Self-Signed Certificates Ubuntu Server 10.04

Ubuntu Linux Specific Guides
Post Reply
User avatar
Site Admin
Posts: 70
Joined: Wed Mar 15, 2006 8:28 pm

Self-Signed Certificates Ubuntu Server 10.04

Post by dedwards » Fri Feb 11, 2011 9:23 am

Self-Signed Certificate with NO password prompt upon Apache service start

1. Enable Apache2 SSL module

Code: Select all

sudo a2enmod ssl

2. Generate certificate request

Code: Select all

cd /tmp
[code]sudo openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr[/code]

You will be asked for the following minimum information: PEM pass phrase, Country Name, State or Province Name, Locality Name, Organization Name, Organizational Unit, Common Name and Email Address. The two MOST important pieces of information are the PEM pass phrase and the Common Name. The common name should match the domain that the certificate is generated for.

[b]3. Generate certificate[/b]

Create the certificate:

[code]sudo openssl x509 -in server.csr -out server.pem -req -signkey server.key -days 1095[/code]

Copy the certificate to the proper paths:

[code]sudo cp server.pem /etc/ssl/certs
sudo cp server.key /etc/ssl/private[/code]

Restart apache:

[code]sudo /etc/init.d/apache2 restart
Post Reply