Score:0

letsencrypt not working for base domain

cn flag

I'm using centos 8, and have installed let's Encrypt certificate that's not working for base (root) domain but working for sub domain. I've checked certificates available for both root and sub domains Found the following certs:

    Certificate Name: teachersbook.pk
    Serial Number: XXXXXXXXXXXXXX
    Key Type: XXXXXXXX
    Domains: teachersbook.pk www.teachersbook.pk
    Expiry Date: 2021-12-13 06:54:33+00:00 (VALID: 89 days)
    Certificate Path: /etc/letsencrypt/live/teachersbook.pk/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/teachersbook.pk/privkey.pem

my VHost configuration is

<VirtualHost *:80>
    ServerName teachersbook.pk
    ServerAlias www.teachersbook.pk
    ServerAdmin [email protected]
    DocumentRoot /var/www/teachersbook.pk/

    ErrorLog /var/log/httpd/teachersbook.pk-error.log
    CustomLog /var/log/httpd/teachersbook.pk-access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =teachersbook.pk [OR]
RewriteCond %{SERVER_NAME} =www.teachersbook.pk
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

and my Let's Encrypt SSL file configuration is

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName teachersbook.pk
    ServerAlias www.teachersbook.pk
    ServerAdmin [email protected]
    DocumentRoot /var/www/teachersbook.pk/

    ErrorLog /var/log/httpd/teachersbook.pk-error.log
    CustomLog /var/log/httpd/teachersbook.pk-access.log combined

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/teachersbook.pk/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/teachersbook.pk/privkey.pem
</VirtualHost>
</IfModule>
John Hanley avatar
cn flag
What does not working mean?
cn flag
[http://teachersbook.pk base domain](http://teachersbook.pk) redirecting to centos 8 test page but [http://www.teachersbook.pk sub domain](http://www.teachersbook.pk) working fine, [http://teachersbook.pk base domain ](http://teachersbook.pk) is a base domain for that ssl certificate not working
Michael Hampton avatar
cz flag
Your site is not serving a Let's Encrypt certificate. Restart Apache.
cn flag
I've already done, that's my problem Let's Encrypt certificate works for sub domain but not for parent(root) domain. you can check it [subdomain] (https://www.teachersbook.pk/)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.