0% found this document useful (0 votes)
18 views

How To Create a SSL Certificate on Apache for Ubuntu

This document provides a step-by-step guide on creating a self-signed SSL certificate for Apache on Ubuntu. It includes instructions for configuring hosts, installing Apache, enabling the SSL module, generating the SSL certificate, and configuring Apache to use SSL. Finally, it covers activating the SSL virtual host and testing the setup.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

How To Create a SSL Certificate on Apache for Ubuntu

This document provides a step-by-step guide on creating a self-signed SSL certificate for Apache on Ubuntu. It includes instructions for configuring hosts, installing Apache, enabling the SSL module, generating the SSL certificate, and configuring Apache to use SSL. Finally, it covers activating the SSL virtual host and testing the setup.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

How To Create an SSL Certificate on apache2

for Ubuntu
 Configure hosts
sudo gedit hosts

127.0.1.1 localhost

127.0.0.1 autochip.ddns.net

192.168.1.17 autochip.ddns.net

127.0.1.1 autochip-H81M-S1

# The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

 You are also going to need to have Apache installed

sudo apt-get update


sudo apt-get install apache2

 Activate the SSL Module

sudo a2enmod ssl

 After you have enabled SSL, you'll have to restart the web server for
the change to be recognized:
sudo service apache2 restart
 Create a Self-Signed SSL Certificate

sudo mkdir /etc/apache2/ssl

Now that we have a location to place our key and certificate, we can
create them both in one step by typing:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -


keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt

When you hit "ENTER", you will be asked a number of questions.

Country Name (2 letter code) [AU]:US


State or Province Name (full name) [Some-State]:New York
Locality Name (eg, city) []:New York City
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Your
Company
Organizational Unit Name (eg, section) []:Department of Kittens
Common Name (e.g. server FQDN or YOUR name) []:your_domain.com
Email Address []:[email protected]

 Configure Apache to Use SSL

Open the file with root privileges now:


sudo nano /etc/apache2/sites-available/default-ssl.conf

modified from the original file:

<VirtualHost *:80>

ServerName autochip.ddns.net

ServerAdmin autochip.ddns.net

Redirect permanent / https://autochip.ddns.net/

TransferLog /var/log/apache2/transfer.erp.your-domain.at.log

</VirtualHost>
<VirtualHost *:443>

ServerName autochip.ddns.net

ServerAdmin [email protected]

SSLProxyEngine on

SSLEngine on

SSLCertificateFile /etc/apache2/ssl/apache.crt

SSLCertificateKeyFile /etc/apache2/ssl/apache.key

SetEnv proxy-nokeepalive 1

ProxyPass / http://autochip.ddns.net:8069/

ProxyPassReverse / http://autochip.ddns.net:8069/

ProxyErrorOverride off

TransferLog /var/log/apache2/transfer.erp.autochip.ddns.net.log

#Fix IE problem (httpapache proxy dav error 408/409)

SetEnv proxy-nokeepalive 1

</VirtualHost>

 Activate the SSL Virtual Host

sudo a2ensite default-ssl.conf

 We then need to restart Apache to load our new virtual host file:
sudo service apache2 restart

 Test your Setup

https://server_domain_name_or_IP

ref:https://www.digitalocean.com/community/tutorials/how-to-create-
a-ssl-certificate-on-apache-for-ubuntu-14-04

You might also like