SSL not working

i am having the same issue can we go into more detail on how to understand this?

apachectl -t -D DUMP_VHOSTS
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:443                  telocall.com (/etc/apache2/sites-enabled/telocall.com-le-ssl.conf:2)
*:80                   is a NameVirtualHost
         default server telocall.com (/etc/apache2/sites-enabled/telocall.com-le-ssl.conf:23)
         port 80 namevhost telocall.com (/etc/apache2/sites-enabled/telocall.com-le-ssl.conf:23)
         port 80 namevhost www.telocall.com (/etc/apache2/sites-enabled/telocall.com-le-ssl.conf:46)
         port 80 namevhost www.telocall.com (/etc/apache2/sites-enabled/telocall.com.conf:1)
         port 80 namevhost www.telocall.com (/etc/apache2/sites-enabled/www.telocall.com.conf:1)
root@localhost:~#

Config File

<IfModule mod_ssl.c>
 <VirtualHost *:443>
 ServerName telocall.com
    DocumentRoot /var/www/telocall.com
    <Directory /var/www/telocall.com>
        Options FollowSymLinks
        AllowOverride Limit Options FileInfo
        DirectoryIndex index.php
        Require all granted
    </Directory>
    <Directory /var/www/telocall.com/wp-content>
        Options FollowSymLinks
        Require all granted
    </Directory>
Include /etc/letsencrypt/options-ssl-apache.conf
ServerAlias telocall.com
ServerAlias www.telocall.com
SSLCertificateFile /etc/letsencrypt/live/www.telocall.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.telocall.com/privkey.pem
</VirtualHost>
</IfModule>
<IfModule mod_ssl.c>
 <VirtualHost *:80>
 ServerName telocall.com
    DocumentRoot /var/www/telocall.com
    <Directory /var/www/telocall.com>
        Options FollowSymLinks
        AllowOverride Limit Options FileInfo
        DirectoryIndex index.php
        Require all granted
    </Directory>
    <Directory /var/www/telocall.com/wp-content>
        Options FollowSymLinks
        Require all granted
    </Directory>
RewriteEngine on
# Some rewrite rules in this file were disabled on your HTTPS site,
# because they have the potential to create redirection loops.

# RewriteCond %{SERVER_NAME} =telocall.com
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

</VirtualHost>
</IfModule>

These three files are using the same name:port.
[one of the downsides of using Apache - it allows for such madness]

You will have to review all three files and see which one you really want to keep - then remove the other two. It seems likely the one with "le-ssl" might be best to keep.

3 Likes

Hi @Abe-Telo, @rg305 is correct. I would like to add that you might have created 2 files in /etc/apache2/sites-enabled/ or /etc/apache2/sites-available/

  • telocall.com.conf
  • www.telocall.com.conf

What you can do is just go with 1 file, and add ServerAlias " www.example.com", like below

<VirtualHost *:80>
    DocumentRoot "/var/www/html"
    ServerName "example.com"
    ServerAlias "www.example.com"
</VirtualHost>
2 Likes

Before you continue, make sure that your server name "ServerName" is established on both *:80 and *:443 .conf files.
Check your "hosts" file, php.info, and any other file. ServerName should fix the issue as you only have aliases at the moment.

No, they actually have an extra ServerAlias but that isn't the main trouble (the multiple conf files with same names/ports is). The AH00558 message is a nuisance warning here.

1 Like

Well, that's needlessly redundant.

3 Likes

Agreed but seems harmlessly so.

1 Like

There is a dupe entry. telocall.com is both a ServerAlias and a SeverName. That is not good, among others.

Update
These files are both identical
/etc/apache2/sites-available
/etc/apache2/sites-enabled/

I deleted some files in the cert area. after a reboot i ran these commands again.

sudo certbot certonly --manual

telocall.com www.telocall.com

and it started working.

For reference the original config posted above is still the same.

@weccode I am seeing that you guys are not completely happy with my config file and i am unsure what extra steps i should do to avoid redundant issues. (Not that i know what that means)

Should i still go ahead and separate a file for 80 and 443?

File telocall.com:443.conf
file telocall.com.conf

I just ran this to triple check and i do see this.

root@localhost:~# apachectl -t -D DUMP_VHOSTS
AH00558: apache2: Could not reliably determine the server's fully qualified domain 
name, using ::1. Set the 'ServerName' directive globally to suppress this message

VirtualHost configuration:
*:443  telocall.com (/etc/apache2/sites-enabled/telocall.com.conf:2)
*:80   telocall.com (/etc/apache2/sites-enabled/telocall.com.conf:26)