URGENT! Cannot log in to wp-admin or access to subdomains after adding Lets Encrypt certificate

Keywords: WordPress Multisite - Microsoft Azure - Technical issue - Secure Connections (SSL/HTTPS)
bnsupport ID: 40082860-ca6a-7dc8-b526-6b1439e43751
Description:
Hi, I was following your tutorial for adding SSL certificate (https://www.youtube.com/watch?v=BF4OlDwPZds) but afterwards I could not login to wp-admin dashboard or access to the site through its IP address. It has static IP address and subdomains, but nothing is available now. I reverted all files from conf folder to the old ones
Backup files:

  • /opt/bitnami/apache/conf/httpd.conf.back.202106031130
  • /opt/bitnami/apache/conf/bitnami/bitnami.conf.back.202106031130
  • /opt/bitnami/apache/conf/bitnami/bitnami-ssl.conf.back.202106031130
  • /opt/bitnami/apache/conf/vhosts/wordpress-https-vhost.conf.back.202106031130
  • /opt/bitnami/apache/conf/vhosts/wordpress-vhost.conf.back.202106031130

and deleted your cron job but with no success. Can you please tell me how to revert our site to the old state (before adding SSL) or you to make needed changes in order to have SSL but still can access the site through its static IP address and its subdomains.

Thanks

I just run your tool once again for adding SSL certificate. And my domain allows https now. But I still cannot access wp-admin or access my subdomain as too many redirects are being done. Please answer.

New bnsupport ID: ca0052ea-c7ca-c98b-f8ce-24953b67a62c

I have run your support tool once again after running your bncert tool for the second time.

Just to add that I tried a lot of suggestions from the forum yesterday, but with no luck. I do not want to make any additional changes, as I want the last support ID to have the last information for you. But please get in touch.

Thanks

I am really trying my best to solve this out. I figured out that our static IP address was left in wp-config.php file and I changed it to our domain. As a result, I can access wp-admin dashboard now. But the problem is that no new subdomain is working. When I go to admin dashboard and create new site, everything works OK, but when I visit the site it is unavailable. I get " This site can’t be reached".

What should I change additionally?

Hi @miki24,

Thanks for using Bitnami. I checked the bnsupport bundle and I see what you mentioned in the last post, that the domain wasn’t properly configured on WordPress. Can you double-check our guide just in case you missed any step?

https://docs.bitnami.com/azure/apps/wordpress-multisite/configuration/configure-wordpress-multisite/#configure-the-domain-for-the-wordpress-multisite-main-blog

In the same guide above, you have another section for troubleshooting that configuration in the database, and also a section for adding new sites with a subdomain. Can you check it?

Additionally, can you run the bnsupport tool again for us to check the updated logs and config?

Hi,

Thanks for reaching out. We are using domain we got within Azure multisite, is that ok? Our plan is to use custom domains for the sites created within this multisite. When I run “sudo /opt/bitnami/configure_app_domain --domain our-planets.com” with our domain instead of our-planets.com, I get this error:

warn: Unable to run recipe configure-host Export configureHost for wordpress failed with exit code 1
Unable to run recipes: one or more recipes failed
Error: Unable to run recipes: one or more recipes failed
at RecipeRunner. (/opt/bitnami/nami/node_modules/provisioner/lib/recipe_runner.js:482:23)
at Generator.throw ()
at rejected (/opt/bitnami/nami/node_modules/provisioner/lib/recipe_runner.js:5:65)
at
at process._tickCallback (internal/process/next_tick.js:189:7)
at Function.Module.runMain (module.js:696:11)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
Disabling automatic domain update for IP address changes

Just to mention that our sites have worked previously, but with static IP address. They do not work with the domain name now.

Just to add that DB configuration is OK and the sites were added by the instructions. I run bnsupport tool once again:

bnsupportID: a12fc72c-1980-f407-6dcd-cfb8d154ab58

Thanks

Hello @miki24,

Could you run the following commands and share the output with us so we can obtain more information?

sudo su
cd /opt/bitnami 
sed -i 's/provisioner/provisioner --log-level=8/g' configure_app_domain
sudo /opt/bitnami/configure_app_domain --domain YOUR_DOMAIN

Please note you need to replace YOUR_DOMAIN placeholder.

Regards

Hi David,

I managed to solve problems related to our subdomains. To be precise, we started using separate domains instead of subdomains. We can access all of them now. But we have problems with making OpenSSL certificate to be applied. Can you please help?

  1. We put our certificates in apache/conf directory
  2. We changed binami-ssl.conf file, as well as wordpress-https-vhost.conf file
  3. Restarted apache

Here is bnsupportID: 4937b92a-2185-fafa-c725-734ad34ecf75

Can you please check the configuration?

In bitnami-ssl.conf:

<VirtualHost _default_:443>
ServerName **ourdomain.com**
ServerAlias **ourdomain.com**
  DocumentRoot "/opt/bitnami/apache/htdocs"
  SSLEngine on
  SSLCertificateFile "/opt/bitnami/apache/conf/**ourcertificate.crt**"
  SSLCertificateKeyFile "/opt/bitnami/apache/conf/**ourcertificate.key**"
  SSLCACertificateFile "/opt/bitnami/apache/conf/**ourbundlecert.crt"**



  <Directory "/opt/bitnami/apache/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
  </Directory>

  # Error Documents
  ErrorDocument 503 /503.html
</VirtualHost>

in wordpress-https-vhost.conf:

<VirtualHost 127.0.0.1:443 _default_:443>
  ServerName **ourdomain.com**
  ServerAlias **ourdomain.com**
  SSLEngine on
  SSLCertificateFile "/opt/bitnami/apache/conf/**ourcertificate.crt**"
  SSLCertificateKeyFile "/opt/bitnami/apache/conf/**ourcertificate.key**"
  SSLCACertificateFile "/opt/bitnami/apache/conf/**ourbundlecert.crt"**
  DocumentRoot /opt/bitnami/wordpress
  <Directory "/opt/bitnami/wordpress">
    Options -Indexes +FollowSymLinks -MultiViews
    AllowOverride None
    Require all granted
    # BEGIN WordPress fix for plugins and themes
    # Certain WordPress plugins and themes do not properly link to PHP files because of symbolic links
    # https://github.com/bitnami/bitnami-docker-wordpress-nginx/issues/43
    RewriteEngine On
    RewriteRule ^bitnami/wordpress(/.*) $1 [L]
    # END WordPress fix for plugins and themes
    # BEGIN nip.io redirection
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})(:[0-9]{1,5})?$
    RewriteRule ^/?(.*) %{REQUEST_SCHEME}://%1.nip.io%2/$1 [L,R=302,NE]
    # END nip.io redirection
    # BEGIN WordPress Multisite
    # Using subdomain network type: https://wordpress.org/support/article/htaccess/#multisite
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress Multisite
  </Directory>
  Include "/opt/bitnami/apache/conf/vhosts/htaccess/wordpress-htaccess.conf"
</VirtualHost>

Just to add that I tried the steps from this link and got the same result:
https://docs.bitnami.com/aws/apps/wordpress/administration/check-ssl-certificate/

Hi @miki24,

Accessing your https://wpXXX.XXX.cloudapp.azure.com/ and compXXX.com sites I can see you have a valid certificate.

Screenshot 2021-06-08 at 10.55.23

Are you facing another issue?

Regards

Yes, I set Let’s encrypt ones. I also uploaded the ones from OpenSSL, but when replacing them in SSLCertificateFile and SSLCertificateKeyFile directives in bitnami-ssl.conf and wordpress-https-vhost.conf files for my custom domain I got “server certificate does NOT include an ID which matches the server name error”. What else do I have to change, in order to make my openssl work for custom domains? I checked sha256 sum for the certificate and key, they are both the same.

Hi @miki24,

I understand you are using a let’s encrypt certificate for https://wpXXX.XXX.cloudapp.azure.com/ and and GoDadyy certificate for compXXX.com, is that right?

In your Virtual Host for https://wpXXX.XXX.cloudapp.azure.com/
I can see that ServerName is not defined or it is set to the IP.

Apart from that, could you please share with us the checksum of your /opt/bitnami/apache/conf/compXXXX.crt and /opt/bitnami/letsencrypt/certificates/wpXXX.XXX.cloudapp.azure.com.crt?

Regards

Sure, for the compxxxx.crt sha256sum is aed4452ced5a252458365f42d7f5b84c39f8c499e5df3f49aa2c8d1c46a43be6 -
and for the wpxxx.xxx.cloudapp.azure.crt is 8bff2f307b4c0c0f6d5449c31e847dfc7b94241a36a4f8616c475f048a90583f -

How can I add virtual host with my ServerName as my custom domain?

Thank you

Just to add, yes I was trying to use GoDaddy certificate for my custom domain and lets encrypt certificate for the main domain, but currently using letsencrypt for both, as the GoDaddys one is not being applied.

I just generated new lets encrypt certificate, as I had to add one more domain. New sha256sum for it is:

28f68d4d59cbc75bc00e2d26cd2289aaa27a884a2388f4a85dd27212fa56ef31 -

What I need to add related to this?

Hi @miki24,

I can see this in your apache2/conf/vhosts/wordpress-https-vhost.conf:

<VirtualHost 127.0.0.1:443 _default_:443>
  ServerAlias *

change it to

<VirtualHost 127.0.0.1:443 _default_:443>
    ServerName wpXXX.XXX.cloudapp.azure.com
    ServerAlias  wpXXX.XXX.cloudapp.azure.com

and also, edit your apache/conf/bitnami/bitnami-ssl.conf:

<VirtualHost _default_:443>
ServerName 51.XXX.XXX.XXX

with

<VirtualHost _default_:443>
    ServerName wpXXX.XXX.cloudapp.azure.com
    ServerAlias  wpXXX.XXX.cloudapp.azure.com

don’t forget to restart apache after applying the changes.
If that does not work, please share a new output of the support tool to check the latest changes.

Regards

1 Like

Love U David, you made my day! That was the thing.

Thank you so so much!

Wish you a great day

1 Like