I setup two sites (links below) using certbot and entered the "www." portion of the domain when generating the HTTPS certificate resulting in non-www URL's for both sites causing an error.
There are many similar questions on StackOverflow but none have fixed my issue so far.
Related Links
https://certbot.eff.org/lets-encrypt/ubuntubionic-apache
https://letsencrypt.org/
Working Domains
https://www.fastsitephp.com/en/
https://www.dataformsjs.com/#/en/
Invalid Domains (because of the missing 'www.')
https://fastsitephp.com/en/
https://dataformsjs.com/#/en/
Attempted Fix Commands
sudo certbot certonly --standalone -d fastsitephp.com -d www.fastsitephp.com
sudo certbot delete --cert-name www.fastsitephp.com
Chrome will re-direct to the 'www' site using the above links however the error is clear from Firefox and Mobile Safari
Server
Ubuntu 18.04 LTS with Apache
HELP! What can I do to fix this without having to setup a new server and changing the URL. Ideally the severs would support both www and non-www; however if it can't be fixed an Apache url re-write would also be acceptable.
Thank you in advance!
I ended up solving it myself. The primary issue is that Certbot still leaves the HTTP->HTTPS redirect it created and some other Apache config settings even after running delete (this assumes you selected redirect from HTTP to HTTPS on the original setup).
In case someone else has this issue and needs to fully delete a certificate generated by Certbot here are the commands that I used:
sudo certbot delete
cd /etc/apache2/sites-enabled
ls
sudo nano 000-default.conf
# Remove the redirect
sudo rm 000-default-le-ssl.conf
# Also any file other SSL files such as [000-default-le-ssl.conf.sav]
sudo certbot --apache
# enter both Domains "example.com www.example.com"
sudo service apache2 restart
Related
I have set up a Apache server with the 3 virtual hosts tomrouse.me, dev.tomrouse.me and server.tomrouse.me. All of the virtual hosts worked fine. When I went to each one, it would take me to the index for that site.
But when I added SSL and forced HTTP to redirect to HTTPS, it is now always going to the tomrouse.me virtual host no matter what subdomain I request.
Files I have in available sites in Apache:
SSL configuration for Apache:
I dont think it is a issue with the virtual hosts, as all were working fine until I added SSL with redirects using the python-letsencrypt-apache program.
All fixed, i went wrong by trying to install the ssl in all sub domains at once did a full reinstall then did each one one at a time and it works fine!
For example:
This is what it tells you to do (this will not work):
sudo letsencrypt --apache -d tomrouse.me -d dev.tomrouse.me -d server.tomrouse.me
I reinstalled the server the same but did this part like this:
sudo letsencrypt --apache -d tomrouse.me
sudo letsencrypt --apache -d dev.tomrouse.me
sudo letsencrypt --apache -d server.tomrouse.me
and selected the force https like i did before for each this is a fix if you have the same issie however if you already did it the first way you have to restart as far as i know i tryed doing this after the first way and it dint work.
Correct format of apache config files:
All of the ssl config files should be created by the lets encrypted program https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-16-04
I'm trying to secure my CentOS 7 VPS with Let's Encrypt. I've followed the guidelines in https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-centos-7 . I've set up virtual hosts, installed server dependencies and the Let's Encrypt client. But when I try to set up the SSL certificate with:
./letsencrypt-auto --apache -d example.com -d mail.example.com
I get the error:
The apache plugin is not working; there may be problems with your existing configuration.
The error was: NoInstallationError()
The Apache Plugin for Let's Encrypt is not working, but how do I make it work?
Same error on CentOS 7 and Apache 2.4. Checked through my configuration, had a couple of IfModule lines that were not closed with /IfModule. Apache is OK with them, but apparently certbot parser isn't. Hope this helps others.
appretnly they are a bug in the letsencrypt-auto script, you can use this command to do the job.
sudo certbot --authenticator standalone --installer apache -d <yourdomain> --pre-hook "systemctl stop apache2" --post-hook "systemctl start apache2"
This answer is not working. In my cases i checked apache config file and found the following line at the end of it <IfModule mod_ssl.c> It was not making sense. On removing it the renewal went on without a problem
I am new with Let's Encrypt certificate. I registered my domain for a nginx server at digitalocean.com following this command
cd /opt/letsencrypt ./letsencrypt-auto certonly -a webroot
--webroot-path=/usr/share/nginx/html -d mydomain.com -d www.mydomain.com
and it works fine. Then i have changed my webroot path to /var/www/xxx for my domain.
Now when i trying to renew my letsencrypt certificate it's getting error.
Then i rollback my webroot path, try again and the renewal works perfectly.
Now my question is how can i change my registered webroot-path for Let's Encrypt?
change it in /etc/letsencrypt/renewal/mydomain.conf
set
authenticator = webroot
webroot_path=/var/www/xxx/
and key moment that took me several hours to figure out - configure webrooth path with webroot_path=/var/www/xxx/ not with webroot-path=/var/www/xxx, note the underscore
You don't have to roll back your webroot path in nginx, just change the webroot value when run let's encrypt script.
/opt/letsencrypt/letsencrypt-auto certonly -a webroot --webroot-path=/var/www/xxx -d mydomain.com -d www.mydomain.com
The letsencrypt script requires your webroot because the authentication is based on files that added to your webroot, which should be under /.well-known/acme-challenge/, the authentication process including external requests to those files so if the two webroot values doesn't match, you will see an error because the auth server couldn't reach that file. Every time you try to get/renew a cert, just make sure you pass exact the same root value from nginx to let's encrypt.
Hi i set up Let's Encrypt within Debian.
Now it works fine when i put https://example.com but it does not work fine
when i put https://www.example.com
i used the following command ./letsencrypt-auto --apache -d example.com
instead of ./letsencrypt-auto --apache -d example.com -d www.example.com
I performed the last command but the it still not working thus what can i do to
have https://www.example.com working ?
Thanks
You have th execute the following command :
./letsencrypt-auto --apache -d example.com -d www.example.com
I just went through the process of generating a single Let's Encrypt certificate for multiple subdomains. There were some minor challenges that I encountered and resolved. I posted a short article in the link below explaining the leasons learned I gained when installing Let's Encrypt digital certificates on my Apache web server which provides HTTP and HTTPS access to multiple subdomains.
My most important "lesson learned" is that you need to create a VirtualHost for the HTTP access AND a VirtualHost for each subdomain accessible via HTTPS. IMPORTANT: Each VirtualHost definition must be specified in a single configuration file. The Let's Encrypt certbot will not operate correctly if multiple VirtualHosts are defined within a single configuration file. I defined three (3) VirtualHosts in three (3) different configuration files below. The dummy.conf file serves no functional purpose within Apache (i.e., it will not cause an unnecessary 999 listening port), but it is absolutely necessary for digital certificates to be successfully generated by the Let's Encrypt certbot.
Then you can run the following command to generate the certificate:
certbot --apache -d example.com -d www.example.com
https://www.hueyise.com/index.php/letsencrypt
Recently I discover letsencrypt which is awesome project, and it basically allows you to get ssl certificate for free.
I manage to setup my server and domain with their certificate, everything work great and my site showed the https in green which was great.
Then I connected this domain to cloudflare, which is another great solution, for many web problems.
Once my name servers were changed to cloudflare name servers the https stopped working.
:(
I am not really sure what is the root of that issue, but I manage to fixed it with a little bit of luck, so decided to write here the problem and the solution who worked for me in case other will encounter this issue in the future.
On cloudflare
https://www.cloudflare.com/a/crypto/yourdomain
default settings for ssl is full, once I changed it to
strict https start working again like charm.
2 days after I had the same issue, I changed it back to full from strict and then it worked again so I am confused and not sure if my answer here is good.
you need to use certbot when you're already using cloudflare.
check this link
So before you run the certbot command try this first export LC_ALL="C"
Then if you're on apache change the command to this
./certbot-auto certonly --webroot --webroot-path /var/www/html/ --renew-by-default --email email#host.tld --text --agree-tos -d example.tld -d www.example.tld
/var/www/html/ = where your webroot path for the domain is located.
I hope this helps..
I've faced the same issue that CloudFlare said there is a 526 error.
I could solve it by adding
SSLCertificateChainFile "/etc/letsencrypt/live/DOMAIN/chain.pem"
to the apache hosts config, since Apache < 2.4.8 needs the chain (see http://letsencrypt.readthedocs.org/en/latest/using.html)