Self-Signed Certificates Ubuntu Server 10.04

Ubuntu Linux Specific Guides
Post Reply
User avatar
dedwards
Site Admin
Posts: 70
Joined: Sat Mar 07, 2020 4:37 pm
Contact:

Self-Signed Certificates Ubuntu Server 10.04

Post by dedwards »

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
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.

3. Generate certificate

Create the certificate:

Code: Select all

sudo openssl x509 -in server.csr -out server.pem -req -signkey server.key -days 1095
Copy the certificate to the proper paths:

Code: Select all

sudo cp server.pem /etc/ssl/certs
sudo cp server.key /etc/ssl/private
Restart apache:

Code: Select all

sudo /etc/init.d/apache2 restart

Post Reply