I've red many tutorials , some didn't have any dates, some were probably outdated, some were not clear on a few details... Right now I am confused. Spent all day on this.
I'm using ubuntu 16.04 / apache2 with some virtual hosts.
I got a ssl certificate, downloaded the files and uplodaded them. Got a bundle file and a .crt file. The key file was generated earlier in the process.
My first question I guess would be about the config file for the virtual host. Some tutorial said to use the file : default-ssl.conf which is inside : /etc/apache2/sites-available , and use it as a base.
Another tutorial said to include all details regarding the certificate inside the main domain-example.com.conf file.
So , should there be 2 files for one domain, file main-domain.com.conf for the :80 port and the other file which would be default-ssl.conf for the :443 port ?
My other question is about the syntax and the correct names for a few things. First, that part :
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
Does VirtualHost _default_
need to be named like that, VirtualHost _default_
? Or do I have to replace something ? The _default_
part looks strange.
My other question is about the correct name to use in the config file : SSLCACertificateFile
or SSLCertificateChainFile
Also followed a tutorial from the hosting company, which said that the configuration file for the virtual host should have the IP of the server , so it looks like ( note the <VirtualHost 155.131.133.211:80>
part ) :
<VirtualHost 155.131.133.211:80>
ServerAdmin admin@sitexample.com
ServerName sitexample.com
ServerAlias www.sitexample.com
DocumentRoot /var/www/html/sitexample.com/
Is that really the way to do it ? Because after trying different things all day, at some point, sitexample.com wasn't pointing to the correct website anymore with the correct path /var/www/html/sitexample.com/ , but instead to a page with "Index Of" as title it looked like the main IP server page.