0
votes

I have installed an SSL certificate on my home server. I can access localhost but not https://subdomain.ofmyhp.com.

I don't know so much about SSL so I folloed this instructions to install and generate the SSL certificate. in the instructions it was said to create a new file /etc/apache2/sites-available/ssl but I already have a file /etc/apache2/sites-available/default-ssl should the two be the same?

Here is the content of the file /etc/apache2/sites-available/ssl

<virtualhost *:443>
    SSLEngine On
    SSLCertificateFile /etc/apache2/ssl/apache.pem
    DocumentRoot /var/www
</virtualhost>

This is the content of my /etc/apache2/ports.conf

NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>

In the ports.conf is also marked to use the defaults-ssl file to configure Apache to listen to 443

Edit:

Today I learnd that there is also a hosts file (/etc/hosts). This is what it looks like for me (with an example of course).

80.110.45.25    home.example.com        mypc
# 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
1

1 Answers

0
votes

Because of current apache and ssl limitations. You can only run ONE cert per PORT (443) on a machine.

Make sure you setup your 443 virtual host as the only authoritative vhost listening and using that cert.

If you need additional vhosts, you'll need to listen on different ports.

Many people get around this by placing a proxy or loadbalancing service in front of apache. But this is beyond the scope of a home / dev environment.

Also, to enable new site configs in ubuntu, use the a2ensite command.