This post describes how to connect domain to WordPress multisite on AWS LightSail with HTTPS, SSL certification. If you know how, it’s very easy, but if you don’t, you’ll experience hell.
This is December 2022 and the latest version of WordPress Multisite is 6.1.1. It’s very easy in the latest version, and you can experience confusion in the older version. Writing based on the old version will create confusion. Beware of the hand gestures from hell.
1. AWS LightSail – site
First, create a static IP on the WordPress multisite instance.
Then assign the domain to the instance as a static IP. Domains and * are the default, and if you have subdomains, register them together. I registered dev additionally.
2. Domain hosting site (Hosting KR)
You need to set it up on the site where you purchased the domain. By default, we generate two A records, @ and www. And if you have a subdomain, register it on record A.
Of course, you must register with the static address you received from AWS Light Sale.
3. AWS LightSail – SSH terminal
Bitnami provides the configure_app_domain tool for domain setting by default.
- sudo /opt/bitnami/configure_app_domain –domain <YOUR_DOMAIN.COM>
$ sudo /opt/bitnami/configure_app_domain --domain surplstimes.com
Configuring domain to surplstimes.com
2022-12-15T17:12:13.020Z - info: Saving configuration info to disk
wordpress 17:12:13.74 INFO ==> Retrieving current WordPress multisite hostname/domain
wordpress 17:12:14.06 INFO ==> Updating hostname/domain for WordPress Multisite
wordpress 17:12:16.21 INFO ==> ** Reloading PHP-FPM configuration **
Disabling automatic domain update for IP address changes
The following are tools for HTTPS and SSL authentication.
This is bncert-tool.If you first run the bncert-tool, you will fail. If you rerun it, the tool will ask you about the Domain list.
- sudo /opt/bitnami/bncert-tool
You can list all possible domains in the Domain list, separated by spaces. This is what you have to do every time you add a site or modify its name on WordPress Multisite. It’s not a big deal, but it’s a hassle.
$ sudo /opt/bitnami/bncert-tool
Warning: Custom redirections are not supported in the WordPress Multisite
packaged by Bitnami. This tool will not be able to enable/disable redirections.
Press [Enter] to continue:
----------------------------------------------------------------------------
Welcome to the Bitnami HTTPS Configuration tool.
----------------------------------------------------------------------------
Domains
Please provide a valid space-separated list of domains for which you wish to
configure your web server.
Domain list []: surplstimes.com www.surplstimes.com dev.surplstimes.com
----------------------------------------------------------------------------
Changes to perform
The following changes will be performed to your Bitnami installation:
1. Stop web server
2. Configure web server to use a free Let's Encrypt certificate for the domains:
surplstimes.com www.surplstimes.com
3. Configure a cron job to automatically renew the certificate each month
4. Configure web server name to: surplstimes.com
5. Start web server once all changes have been performed
Do you agree to these changes? [Y/n]: Y
----------------------------------------------------------------------------
Create a free HTTPS certificate with Let's Encrypt
Please provide a valid e-mail address for which to associate your Let's Encrypt
certificate.
Domain list: surplstimes.com www.surplstimes.com
Server name: surplstimes.com
E-mail address []: surplstimes@gmail.com
The Let's Encrypt Subscriber Agreement can be found at:
https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.pdf
Do you agree to the Let's Encrypt Subscriber Agreement? [Y/n]: Y
----------------------------------------------------------------------------
Performing changes to your installation
The Bitnami HTTPS Configuration Tool will perform any necessary actions to your
Bitnami installation. This may take some time, please be patient.
----------------------------------------------------------------------------
Success
The Bitnami HTTPS Configuration Tool succeeded in modifying your installation.
The configuration report is shown below.
Backup files:
* /opt/bitnami/apache/conf/httpd.conf.back.202212151717
* /opt/bitnami/apache/conf/bitnami/bitnami.conf.back.202212151717
* /opt/bitnami/apache/conf/bitnami/bitnami-ssl.conf.back.202212151717
* /opt/bitnami/apache/conf/vhosts/wordpress-https-vhost.conf.back.202212151717
* /opt/bitnami/apache/conf/vhosts/wordpress-vhost.conf.back.202212151717
Find more details in the log file:
/tmp/bncert-202212151717.log
If you find any issues, please check Bitnami Support forums at:
https://github.com/bitnami/vms
Press [Enter] to continue:
If you have already created a subsite before domain connections, HTTPS, and SSL authentication, the bncert-tool will fail.
Go to WordPress site settings. And modify the address set to the domain address from the existing IP. It is Siteurl and Home. And try the bncert-tool again.
Surprise! For 100% complete HTTPS, please refer to the post below.