After installing ssl certificate i got 404 error

Hi, after I have installed the certificate trough ssh I got 404 error in my website.

site: www.federicoporta.it

1 Like

Your site has IPv4 and IPv6 but only IPv4 is working:
Name: www.federicoporta.it
Addresses: 2a00:6d40:72:b12d::1
80.211.79.45

curl -Iki4 www.federicoporta.it
HTTP/1.1 301 Moved Permanently
Date: Tue, 17 Dec 2019 20:14:21 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.3.12
Location: https://www.federicoporta.it/
Content-Type: text/html; charset=iso-8859-1

curl -Iki6 www.federicoporta.it
curl: (7) Failed to connect to www.federicoporta.it port 80: No route to host


curl -Iki6 www.federicoporta.it
curl: (7) Failed to connect to www.federicoporta.it port 80: No route to host
root@ul18ipv46:/var/tmp/trash# curl -Iki4 https://www.federicoporta.it/
HTTP/1.1 404 Not Found
Date: Tue, 17 Dec 2019 20:15:05 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.3.12
Content-Type: text/html; charset=iso-8859-1

curl -Iki6 https://www.federicoporta.it/
curl: (7) Failed to connect to www.federicoporta.it port 443: No route to host

And, yes, the working HTTPS site returns 404 error.
Can you show the HTTP and HTTPS configs?
[they should have the same document root]

Hi rg305 how can I show you the configuration? I am new of apache and linux.

Hi @fedeanimation

your 404 is only one problem. More critical: Ipv4 has the correct certificate, ipv6 not - see https://check-your-website.server-daten.de/?q=federicoporta.it

And you have created the correct certificate with both domain names:

Issuer not before not after Domain names LE-Duplicate next LE
Let’s Encrypt Authority X3 2019-12-17 2020-03-16 www.federicoporta.it - 1 entries duplicate nr. 1
Let’s Encrypt Authority X3 2019-12-17 2020-03-16 federicoporta.it, www.federicoporta.it - 2 entries duplicate nr. 1
Let’s Encrypt Authority X3 2019-12-17 2020-03-16 federicoporta.it - 1 entries duplicate nr. 1

But you don’t use it, instead, you use the certificate with one domain name, so your non-www version isn’t secure.

First step: What says

apachectl -S
1 Like
AH00112: Warning: DocumentRoot [/var/www/federicoporta.it] does not exist
AH00112: Warning: DocumentRoot [/var/www/federicoporta.it] does not exist
AH00112: Warning: DocumentRoot [/www/pes2020/public-html] does not exist
VirtualHost configuration:
*:443                  is a NameVirtualHost
     default server www.federicoporta.it (/etc/httpd/conf.d/federicoporta.it               -le-ssl.conf:2)
     port 443 namevhost www.federicoporta.it (/etc/httpd/conf.d/federicoport               a.it-le-ssl.conf:2)
             alias federicoporta.it
     port 443 namevhost www.surfwebagency.it (/etc/httpd/conf.d/ssl.conf:56)
             alias www.surfwebagency.it
     port 443 namevhost surfwebagency.it (/etc/httpd/conf.d/your_domain-le-s               sl.conf:2)
             alias www.surfwebagency.it
*:80                   is a NameVirtualHost
     default server www.federicoporta.it (/etc/httpd/conf.d/federicoporta.it               .conf:1)
     port 80 namevhost www.federicoporta.it (/etc/httpd/conf.d/federicoporta               .it.conf:1)
             alias federicoporta.it
     port 80 namevhost pes2020.com (/etc/httpd/conf.d/pes2020.conf:1)
     port 80 namevhost surfwebagency.it (/etc/httpd/conf.d/your_domain.conf:               1)
             alias www.surfwebagency.it
     port 80 namevhost www.surfwebagency.it (/etc/httpd/conf/httpd.conf:358)
     port 80 namevhost www.federicoporta.it (/etc/httpd/conf/httpd.conf:363)
             alias federicoporta.it
     port 80 namevhost 80.211.79.45 (/etc/httpd/conf/httpd.conf:374)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex authdigest-client: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
PidFile: "/run/httpd/httpd.pid"
Define: _RH_HAS_HTTPPROTOCOLOPTIONS
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48
1 Like

There

you see a part of the problem. You use a not existing document root.

And your port 443 vHost config is ok. But your port 80 vHost config has duplicated entries.

Every combination of port and list of domain names must be unique. Merge the duplicated vHosts -> restart, then again apachectl -S to see, if it is fixed.

2 Likes

Hi JuergenAuer I tried to merge it but I don’t konow how to do it.

I comment some line now I got this

AH00112: Warning: DocumentRoot [/var/www/federicoporta.it] does not exist
AH00112: Warning: DocumentRoot [/www/pes2020/public-html] does not exist
VirtualHost configuration:
*:443                  is a NameVirtualHost
         default server www.federicoporta.it (/etc/httpd/conf.d/federicoporta.it-le-ssl.conf:2)
         port 443 namevhost www.federicoporta.it (/etc/httpd/conf.d/federicoporta.it-le-ssl.conf:2)
                 alias federicoporta.it
         port 443 namevhost www.surfwebagency.it (/etc/httpd/conf.d/ssl.conf:56)
                 alias www.surfwebagency.it
         port 443 namevhost surfwebagency.it (/etc/httpd/conf.d/your_domain-le-ssl.conf:2)
                 alias www.surfwebagency.it
*:80                   is a NameVirtualHost
         default server pes2020.com (/etc/httpd/conf.d/pes2020.conf:1)
         port 80 namevhost pes2020.com (/etc/httpd/conf.d/pes2020.conf:1)
         port 80 namevhost surfwebagency.it (/etc/httpd/conf.d/your_domain.conf:1)
                 alias www.surfwebagency.it
         port 80 namevhost 80.211.79.45 (/etc/httpd/conf/httpd.conf:374)
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
PidFile: "/run/httpd/httpd.pid"
Define: _RH_HAS_HTTPPROTOCOLOPTIONS
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48

Edit: solved the problem it was just in the var/www/ the name was federiscoporta insthead to federicoporta.it. I have renamend the directory and now working

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.