Saturday, June 20, 2015

Configure Https In apache - Ubuntu server - Azure

To Configure https In Apache ( Ubuntu )
  •  First need to enable  https
          $ sudo a2enmod ssl
  • Create a Folder to store SSL certificate
         $ sudo mkdir /etc/apache2/ssl/
  •  Next copy the following certificate to above folder
    1. SSL CertificateFile (.crt)
    2. SSL Certificate Key File (.key)
    3. Certificate Chain file (.crt)
Note : 
  • This certificates can be downloaded form the Certificate authority.
  • Also can Self Signed SSL Certificate form following command.
" $ sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt "
This was copied form https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-12-04
  •    Next open the SSL configuration file.
$ sudo nano /etc/apache2/sites-available/default-ssl.conf
  • Make sure SSL on
    # SSLEngine on
  • And change the  following with the certificate name.
 # SSLCertificateFile    /etc/apache2/ssl/SSL CertificateFile.crt
          #  SSLCertificateKeyFile /etc/apache2/ssl/SSL Certificate Key File.key
 # SSLCertificateChainFile /etc/apache2/ssl/Certificate Chain file.crt
  • Save the file.
  •  Next Open the 443 port from the Firewall
$ sudo ufw allow 443
  • Restart the Apache service.
$ sudo service apache2 restart
  •  In azure to work this also need to open the 443 from Azure port. 
  # log in the portal and select the Virtual Machine  and go to Endpoint and create a endpoint with following config.

1 comment:

  1. I have read this post. collection of post is a nice one. Keep update with us..!!..Azure Online Training

    ReplyDelete