Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.
My domain is:
macminns.com
I ran this command:
See below
It produced this output:
See below
My web server is (include version):
Apache 2.4.6
The operating system my web server runs on is (include version):
CentOS 7
My hosting provider, if applicable, is:
A2
I can login to a root shell on my machine (yes or no, or I don't know):
yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel):
No
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you're using Certbot):
certbot 1.11.0
My Issue:
I’m trying to deploy a progressive web app from my website. I’m using Apache on CentOS 7 with named virtual hosting. I just set up LetsEncrypt using Certbot for two domains simultaneously, e.g., domain.com and anotherDomain.org. I had certbot generate certificates for both the bare domain name and www. host.
The setup went very smoothly. The site serves under https as it should.
When I navigate to my “PWA” site (which is in a subdirectory,) I get the following message in the Chrome developer tools:
Uncaught (in promise) DOMException: Failed to register a ServiceWorker for scope ('https://www.macminns.com/webapp/') with script ('https://www.macminns.com/webapp/serviceWorker.js'): The script resource is behind a redirect, which is disallowed.
My serviceWorker.js file is in the same folder with everything else.
It's activated from the html page with:
<script>
if('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sa2radar_kiosk/serviceWorker.js', { scope: '/sa2radar_kiosk/' });
}
</script>
(sa2radar_kiosk is the subdirectory containing the webapp)
My VirtualHost directive is:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName domain.com
ServerAlias *.domain.com
#ServerAlias www.domain.com
DocumentRoot "/var/www/sites/domain/wwwroot"
ErrorLog "/var/www/sites/domain/logs/domain.com-error_log"
CustomLog "/var/www/sites/domain/logs/domain.com-access_log" combined
#CustomLog "|/usr/sbin/rotatelogs.exe /var/www/sites/domain/logs/logfile-%Y.%m.%d.log 86400" combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/domain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/domain.com/chain.pem
</VirtualHost>
</IfModule>
I don't know if this is related, but when I run apachectl -S I get, oddly:
AH00526: Syntax error on line 11 of /etc/httpd/sites-enabled/secondDomain.org-le-ssl.conf:
SSLCertificateFile: file '/etc/letsencrypt/live/domain.com/cert.pem' does not exist or is empty
. . . but the cert.pem file is there and is not empty.
I'd appreciate any help in tracking down this issue.
Thanks.