Install ssl certificate on apache server in ubuntu 16.04

Install Apache2

sudo apt-get install apache2

Enable SSL Module

sudo a2enmod ssl

Apply SSL Module to Site

sudo a2ensite default-ssl
sudo /etc/init.d/apache2 restart

Add your certificates in default-ssl.conf in /etc/apache2/sites-available

SSLEngine on
SSLCertificateFile /path/to/your_domain_name.crt
SSLCertificateKeyFile /path/to/your_private.key
SSLCertificateChainFile /path/to/DigiCertCA.crt

 

Sometimes you need to create a .ca-bundle file. Use this command to create it

Note : the names of files should be something similar

cat ComodoRSAAddTrustCA.crt ComodoRSADomain/Organization/ExtendedvalidationSecureServerCA.crt AddTrustExternalCARoot.crt > yourDomain.ca-bundle

 

Installing Apache,PHP,MySql,phpmyadmin on ubuntu server

Simply run these commands from terminal

Update the Package

sudo apt-get update

 

Install Apache2

sudo apt-get install apache2

 

Install PHP5

sudo apt-get install php5

sudo apt-get install libapache2-mod-php5

 

Install MySQL

sudo apt-get install mysql-server 

lib apache2-mod-auth-mysql php5-mysql

 

Install PhpMyAdmin

sudo apt-get install phpmyadmin

You just installed phpmyadmin, but you also need to tell apache where to find phpmyadmin. phpmyadmin already comes with an apache configuration and we just need to use it. This configuration is available in: /etc/phpmyadmin/apache.conf

Add the following line to the end of /etc/apache2/apache2.conf:

Include /etc/phpmyadmin/apache.conf

Restart Apache2

sudo /etc/init.d/apache2 restart
or execute service apache2 restart

Now your web services is ready. You can upload your files into /var/www/ directory.

 

To install php5 library for mysql run this command

sudo apt-get install php5-mysql