<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>lightsail on Digi Hunch</title><link>https://www.digihunch.com/tag/lightsail/</link><description>Recent content in lightsail on Digi Hunch</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><lastBuildDate>Tue, 08 Apr 2025 22:29:33 -0400</lastBuildDate><atom:link href="https://www.digihunch.com/tag/lightsail/index.xml" rel="self" type="application/rss+xml"/><item><title>The Leanest Web and Email Hosting</title><link>https://www.digihunch.com/2025/02/the-most-cost-effective-web-and-email-hosting/</link><pubDate>Thu, 27 Feb 2025 22:14:11 -0500</pubDate><guid>https://www.digihunch.com/2025/02/the-most-cost-effective-web-and-email-hosting/</guid><description>&lt;img src="https://www.digihunch.com/wp-content/uploads/2025/04/feature-web-email-host.webp" alt="Featured image of post The Leanest Web and Email Hosting" /&gt;&lt;p class="wp-block-paragraph"&gt;This site has been quiet for a while. During this time, I migrated the hosting platform again, and refactored email solution. This post, is another note about how I finally came to the most cost-effective web and email solution for a small business, with a solid security posture, and at nearly no cost.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;For background, I have had this website for more than five years now, and revamped it a couple times. I have been with Amazon Lightsail at an already low cost. I didn&amp;#8217;t have a lot of emails. So I have been relying on the email forwarding feature from my old domain registrar. There have been a few challenges. The content has grown a lot. The speed gradually slows down. WordPress needs reinstall. The outgoing emails get flagged as unverified.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;WordPress Hosting&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Worried about too many plugins, I debated about changing content management platform. Unfortunately, it&amp;#8217;s not easy. There are some alternatives but none has all the features from all the plugins that I&amp;#8217;ve been using. Even if they do, it would be too much work: I&amp;#8217;d have to migrate the code snippets, highlights, etc, find similar themes and verify the new theme and new plugins work together. Despite of the criticism, WordPress today is still a predominant content management platform. So I stick to it.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Staying with WordPress isn&amp;#8217;t maintenance-free. When PHP version has major update once in a while, I still had to re-install and migrate to a new server. Since I&amp;#8217;ll exercise migration anyways, why not also shop around for a new virtual private server. Surprisingly I learned that Google Cloud Platform has an always-free tier including a decent size virtual machine.&lt;/p&gt;&#10;&lt;figure class="wp-block-table"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Amazon&lt;/strong&gt; &lt;strong&gt;Lightsail&lt;/strong&gt; 7USD/mo&lt;/td&gt;&lt;td&gt;&lt;strong&gt;GCP Free tier&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Class&lt;/td&gt;&lt;td&gt;micro&lt;/td&gt;&lt;td&gt;e2-micro&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;CPU&lt;/td&gt;&lt;td&gt;2 vCPUs&lt;/td&gt;&lt;td&gt;2 vCPUs&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Memory&lt;/td&gt;&lt;td&gt;1 GB&lt;/td&gt;&lt;td&gt;1 GiB&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Disk&lt;/td&gt;&lt;td&gt;40GB SSD&lt;/td&gt;&lt;td&gt;30 GB (standard persistent disk HDD)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Data Transfer&lt;/td&gt;&lt;td&gt;1TB&lt;/td&gt;&lt;td&gt;1GB egress&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/figure&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The vCPU in different platforms do not represent exactly the same compute capacity, but should be generally comparable. The egress data transfer usage was below 1GB on Lightsail so the new service is sufficient. By going with GCP&amp;#8217;s free tier, the only downgrade is the disk speed.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The GCP platform provides &lt;a href="https://bitnami.com/stack/wordpress/cloud"&gt;Bitnami package&lt;/a&gt; image and it&amp;#8217;s fairly simple to spin up a new VM. The setup is as simple as Amazon Lightsail and I don&amp;#8217;t have to deal much with networking. It doesn&amp;#8217;t work out to be completely free but the net cost is negligible. I also picked the Nginx-based WordPress image because I had wasted a lot of time dabbling with Apache which I never use elsewhere.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;WordPress Migration&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;With the new server up in a few minutes the next step is migration. The &lt;em&gt;All-in-One WP Migration and Backup&lt;/em&gt; plugin (by ServMask) is the Swiss army knife. There are some pitfalls though.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;First, the plugin has a size limitation in the free version. Luckily I can bypass it with changes to the PHP and Nginx configurations. For PHP configuration, change the line in &lt;code&gt;/opt/bitnami/php/etc/php.ini&lt;/code&gt;, to &lt;code&gt;upload_max_filesize = 512M&lt;/code&gt;. For the other change on Nginx as the reverse proxy, in &lt;code&gt;/opt/bitnami/nginx/conf/nginx.conf&lt;/code&gt;, under &lt;code&gt;http&lt;/code&gt; configuration, add:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-nginx" data-lang="nginx"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;client_max_body_size&lt;/span&gt; &lt;span style="color:#e6db74"&gt;512M&lt;/span&gt;;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;The second pitfall is trickier. I have to temporarily host the new site, either by an public IP, or by a different DNS name (such as new.digihunch.com), so I can log in and verify the functions. Once I log on to the new site, the new DNS name or IP will start to be written to the database. I&amp;#8217;m not sure which exact service does that. But once I put the new site on the production domain name (i.e. www.digihunch.com), the database still contains many entries referencing the temporary DNS name. This causes many insidious broken links. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;There is a plugin for this kind of issue: &lt;strong&gt;Better Search Replace&lt;/strong&gt; by WP Engine. The plugin goes through all tables in the database and allows you to find and replace strings. It also supports dry-run mode and I managed to fix tens of thousands of bad references. In addition, I managed to change username using a plugin called &lt;strong&gt;Easy Username Updater&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Another important activity after migration, is to ensure the MFA by WordFence plugin continues to work, and re-scan the entire file system.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;CloudFlare Security&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;With less egress data and an HDD, the VPS in GCP is slower. I need to speed it up with CDN. It is hard to resist the freebies by CloudFlare. I&amp;#8217;ve already been using it for &lt;a href="https://www.digihunch.com/2023/11/wordpress-security/"&gt;security&lt;/a&gt;. Now it&amp;#8217;s time to dig deeper.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;CloudFlare greatly simplifies TLS certificates. It manages your certificate automatically. On the other side, it issues an origin certificate (and key, with long expiry) for communication with origin server. In full encryption mode, all I need to do is deploy origin certificate to Nginx. There is no manual renewal effort.&lt;/p&gt;&#10;&lt;div class="wp-block-image"&gt;&#10;&lt;figure class="aligncenter size-full is-resized"&gt;&lt;img loading="lazy" decoding="async" width="1024" height="489" src="https://www.digihunch.com/wp-content/uploads/2025/02/cloudflare-tls.webp" alt="" class="wp-image-13001" style="width:487px;height:auto" srcset="https://www.digihunch.com/wp-content/uploads/2025/02/cloudflare-tls.webp 1024w, https://www.digihunch.com/wp-content/uploads/2025/02/cloudflare-tls-300x143.webp 300w, https://www.digihunch.com/wp-content/uploads/2025/02/cloudflare-tls-768x367.webp 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /&gt;&lt;/figure&gt;&#10;&lt;/div&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Note this setup requires CloudFlare to manage DNS so I just transferred my domain to CloudFlare. Therefore I consolidate domain registrar, certificate vendor and CDN to one vendor. CloudFlare can manage DNS record in &lt;a href="https://developers.cloudflare.com/dns/proxy-status/"&gt;proxy&lt;/a&gt; mode, to hide the public IP of the origin server from clients. I can also control the security group of the origin server to only open port 443 to &lt;a href="https://www.cloudflare.com/ips/"&gt;CloudFlare IPs&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Another annoying but necessary configuration is the redirect of zone apex and http requests. Specifically most websites needs the following redirects:&lt;/p&gt;&#10;&lt;ol class="wp-block-list"&gt;&#10;&lt;li&gt;If request from client is http://www.digihunch.com, enforce https;&lt;/li&gt;&#10;&lt;li&gt;If request is https://digihunch.com, redirect to https://www.digihunch.com;&lt;/li&gt;&#10;&lt;li&gt;If request is http://digihunch.com, enforce https, then redirect following rule #2.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p class="wp-block-paragraph"&gt;I used to manage the these redirects in the reverse proxy (Apache). Now that I changed to Nginx, I offload these settings to CloudFlare, instead of configuring another reverse proxy again. For #1, I simply turned on &amp;#8220;&lt;a href="https://developers.cloudflare.com/ssl/edge-certificates/additional-options/always-use-https/"&gt;Always use HTTPS&lt;/a&gt;&amp;#8221; and &amp;#8220;&lt;a href="https://developers.cloudflare.com/ssl/edge-certificates/additional-options/automatic-https-rewrites/"&gt;Automatic HTTPS Rewrites&lt;/a&gt;&amp;#8221; under edge certificates. For #2, I need a CNAME for zone apex to alias to www, along with a &lt;a href="https://developers.cloudflare.com/fundamentals/setup/manage-domains/manage-subdomains/#redirect-the-apex-domain-to-a-subdomain"&gt;redirect rule&lt;/a&gt;. As a result, there is no need to ever open port 80 on the VPS, just to let the reverse proxy redirect URL.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;CloudFlare Cache Rules&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;As to caching, I had to turn on a couple Cache &lt;a href="https://developers.cloudflare.com/support/third-party-software/content-management-system-cms/speed-up-wordpress-and-improve-performance/"&gt;rules&lt;/a&gt; to enable the caching. Cache hit was at about 50% and there are rooms to go higher if I enable reserve cache. Once cache is on, there are other considerations, such as expiring the cache, and by passing the cache during server deployment. CloudFlare allows you to purge cache by rules. There is also a Development Mode that temporarily allows you to bypass all cache for testing. With cache enabled, and the WordPress &lt;a href="https://www.cloudflare.com/en-ca/integrations/wordpress/"&gt;plugin&lt;/a&gt; activated, the page load time for recent posts appear to be faster than before.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;One challenge is that the admin bar of WordPress went into the CDN and is served to visitors. To get rid of this behaviour I have two catch rules:&lt;/p&gt;&#10;&lt;ol class="wp-block-list"&gt;&#10;&lt;li&gt;A cache-everything rule at order 1, to make everything eligible for cache; &lt;/li&gt;&#10;&lt;li&gt;A bypass rule at order 2 to bypass cache conditionally. The condition expression reads:&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;(http.cookie wildcard &amp;#34;wp-.*&amp;#34;) or (http.cookie wildcard &amp;#34;wordpress_logged_in_*&amp;#34;) or (http.cookie wildcard &amp;#34;wordpress.*&amp;#34;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p class="wp-block-paragraph"&gt;To make use of the cache space. It is important to have small image sizes. Last year I added many AI generated feature images, most of which are 2MB in PNG format. I have to convert many PNG images into webp format, which only takes a fraction of the space and is widely accepted by most browsers today.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Sometimes there are other annoyances when it comes to speeding up page loading. For example, I noticed that with integration between Google Tag Manager and Microsoft Clarity, the home page issues a call to &lt;code&gt;https://www.clarity.ms/tag/tag-id-xyz&lt;/code&gt;. This call blocks the rendering of a big chunk of home page by a minute! I didn&amp;#8217;t notice it because my Brave browser&amp;#8217;s ad-block removes that call. Nonetheless, the issue has been there for any visitor without built-in ad-block in their browser. The lessons learnt is that you always test with standard browsers, or at least in Brave browser with shields down.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;SMTP service&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;I have been using email forwarding for incoming emails, and Gmail&amp;#8217;s feature to send email from a different address or alias, for outgoing emails. This feature works but oftentimes the email gets marked as unverified on the recipient side. That gives it a good chance to appear as spam.&lt;/p&gt;&#10;&lt;figure class="wp-block-image size-large"&gt;&lt;img loading="lazy" decoding="async" width="1024" height="122" src="https://www.digihunch.com/wp-content/uploads/2025/02/email-junk-1024x122.webp" alt="" class="wp-image-13011" srcset="https://www.digihunch.com/wp-content/uploads/2025/02/email-junk-1024x122.webp 1024w, https://www.digihunch.com/wp-content/uploads/2025/02/email-junk-300x36.webp 300w, https://www.digihunch.com/wp-content/uploads/2025/02/email-junk-768x91.webp 768w, https://www.digihunch.com/wp-content/uploads/2025/02/email-junk-1536x183.webp 1536w, https://www.digihunch.com/wp-content/uploads/2025/02/email-junk.webp 1698w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /&gt;&lt;/figure&gt;&#10;&lt;p class="wp-block-paragraph"&gt;I need similar email forwarding mechanism and sending service. The free tier of CloudFlare goes a long way. Receiving is simply about creating Email routing rules, with a few MX and TXT records on DNS created and managed by CloudFlare. These records ensure CloudFlare routing rules captures all emails coming to the domain.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;For outgoing emails, I have to get rid of the alias-based mechanism by Gmail. I need a proper SMTP server but CloudFlare doesn&amp;#8217;t offer one. &lt;a href="https://resend.com/"&gt;Resend&lt;/a&gt; seems like a popular choice with a good amount of free tier usage. However I&amp;#8217;m hesitant to introduce another single-purpose platform so I just resort to Amazon SES for a full-feature, low-cost SMTP service. I do have to request production access, stating the server is for transactional email. This allows the SMTP service to arbitrary recipient address.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;The other benefit of having my own SMTP server is to enable email integration in WordPress, which enables other important features such as web form, WordFense security alert and admin password reset by email.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;Sending Reputation&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;To keep outing email from being marked as spam, it is important to understand what &lt;a href="https://www.cloudflare.com/learning/email-security/dmarc-dkim-spf/"&gt;mechanisms&lt;/a&gt; are at play (SPF, DKIM, DMARC) to maintain sending reputation. At minimum, we configure SPF, DKIM and DMARC. SPF (Sender Policy Framework) identifies which mail servers are allowed to send mail on behalf of your custom MAIL FROM domain through a DNS TXT record that is used by DNS. The receiving mail server checks the SPF record of the sender&amp;#8217;s domain to see if the email came from an authorized server. For example, when I use the SMTP server by Amazon SES, and customize the MAIL FROM field to mail.digihunch.com, I need an MX and a TXT record for mail.digihunch.com to tell receivers that it authorized amazonses.com to send email on its behalf.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;DKIM (DomainKeys Identified Mail) is an email authentication method used to verify that an email message was sent by an authorized mail server and that the message content hasn’t been altered in transit. When an email is sent, the sending mail server generates a unique digital signature (based on the content of the email) using a private key. This signature is added to the email header. DNS Lookup: The receiving mail server looks up the sender&amp;#8217;s domain in DNS to find the corresponding public key for DKIM authentication. Amazon SES configuration requires three TXT records to store the sender&amp;#8217;s key information.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;With SPF and DKIM configurations, the Amazon SES setup complies with &lt;a href="https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-dmarc.html"&gt;DMRAC authentication protocol&lt;/a&gt;, making it less likely to be flagged as spam. The email comes off as mailed by &lt;code&gt;amazonses.com&lt;/code&gt; and signed by &lt;code&gt;digihunch.com&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;In addition, there is Brand Indicators for Message Identification (BIMI) protocols that enables logo for your email on the recipient&amp;#8217;s inbox. I managed to set up &lt;a href="https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-bimi.html"&gt;BIMI with SES&lt;/a&gt;, without Verified Mark Certificate (VMC), a protocol that requires evidence of ownership of the logo.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Although SPF, DKIM and DMARC cannot guarantee the email is not marked as junk, this is the best thing you can do. There are other techniques with diminishing return on effort.&lt;/p&gt;&#10;&lt;h2 class="wp-block-heading"&gt;Summary&lt;/h2&gt;&#10;&lt;p class="wp-block-paragraph"&gt;This post summarizes my journey to land on the leanest web and email hosting solutions for small business. After five years of improvement, the tech stack that brings me low cost, solid security posture and lightening-fast speed, consists of: virtual machines from Google Cloud Platform (or Lightsail from AWS), web security and CDN by CloudFlare with Email supported by Gmail and Amazon SES (or Resend).&lt;/p&gt;&#10;&lt;figure class="wp-block-image size-large"&gt;&lt;img loading="lazy" decoding="async" width="1024" height="487" src="https://www.digihunch.com/wp-content/uploads/2025/02/speedtest-1024x487.webp" alt="" class="wp-image-13176" srcset="https://www.digihunch.com/wp-content/uploads/2025/02/speedtest-1024x487.webp 1024w, https://www.digihunch.com/wp-content/uploads/2025/02/speedtest-300x143.webp 300w, https://www.digihunch.com/wp-content/uploads/2025/02/speedtest-768x366.webp 768w, https://www.digihunch.com/wp-content/uploads/2025/02/speedtest-1536x731.webp 1536w, https://www.digihunch.com/wp-content/uploads/2025/02/speedtest.webp 1962w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /&gt;&lt;/figure&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Initially with GCP, I tried to stick to the free tier but I did notice the standard persistent disk struggling, especially when I run system scan from WordFence. To overcome that I upgraded the disk to balanced disk (SSD backed) out of the free tier. There might be even cheaper alternatives but the marginal value isn&amp;#8217;t worth the effort. Also, I configured the caching in CloudFlare for read, adjusted the home page, and schedule IO-intensive activities such as bi-weekly snapshot to quiet hours. The combination gave the site a 100 score in the CloudFlare speed testing.&lt;/p&gt;&#10;&lt;nav class="wp-post-navigation" aria-label="Post navigation"&gt;&#10;&lt;a rel="prev" href="https://www.digihunch.com/2024/11/firewall-deployment-patterns/"&gt;&lt;span class="wp-post-navigation-label"&gt;Previous Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;Firewall Deployment Patterns&lt;/strong&gt;&lt;/a&gt;&#10;&lt;a rel="next" href="https://www.digihunch.com/2025/04/sagemaker-ai-and-networking/"&gt;&lt;span class="wp-post-navigation-label"&gt;Next Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;SageMaker AI and Networking&lt;/strong&gt;&lt;/a&gt;&#10;&lt;/nav&gt;&#10;</description></item><item><title>Lightsail – create a WordPress site in one hour</title><link>https://www.digihunch.com/2019/04/build-a-wordpress-site-in-one-hour-with-lightsail/</link><pubDate>Wed, 10 Apr 2019 01:30:44 -0400</pubDate><guid>https://www.digihunch.com/2019/04/build-a-wordpress-site-in-one-hour-with-lightsail/</guid><description>&lt;p class="wp-block-paragraph"&gt;My challenge with my just revived wordpress.com site is the plug-ins. Even paid premium users cannot install plug-ins for diagram, etc. I don&amp;#8217;t want to upgrade to business plan so I decided to build my own.&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;14 years ago in university, I prototyped an intranet site using the Windows, Apache, MySQL, and PHP. It took a few weeks. Nowadays, this is referred to as WAMP stack with WordPress. AWS has a post on the &lt;a href="https://aws.amazon.com/blogs/architecture/wordpress-best-practices-on-aws/"&gt;best practices&lt;/a&gt; for hosting WordPress. However, I just need a single all-in-one server and there are some &lt;a href="https://docs.aws.amazon.com/linux/al2/ug/al2-tutorials.html"&gt;instruction&lt;/a&gt; on that. With Amazon Lightsail it was made a lot easier. The annual cost to host a WordPress site would be $55 in US, given that virtually nobody visits it except myself. The cost consists of:&lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;Domain registration for $13 a year&lt;/li&gt;&#10;&lt;li&gt;Lightsail blueprint for $3.5 a month&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p class="wp-block-paragraph"&gt;There are several benefit of using this Lightsail blueprint, such as:&lt;/p&gt;&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;You can actually SSH into the EC2 instance. This is important to myself in the habit of probing into how things work;&lt;/li&gt;&#10;&lt;li&gt;Resources are all packaged into a fixed price plan. Remember the pesky accidental AWS charges? &lt;/li&gt;&#10;&lt;li&gt;You have the whole LAMP stack pre-installed, with the bitnami image for WordPress;&lt;/li&gt;&#10;&lt;li&gt;Start small but with scalability.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p class="wp-block-paragraph"&gt;To start with Lightsail is extremely intuitive. Just click and launch:&lt;/p&gt;&#10;&lt;figure class="wp-block-image size-large is-resized"&gt;&lt;img decoding="async" src="https://www.digihunch.com/wp-content/uploads/2019/06/image.png" alt="" style="width:399px;height:450px"/&gt;&lt;/figure&gt;&#10;&lt;p class="wp-block-paragraph"&gt;There is a good instruction &lt;a href="https://www.youtube.com/watch?v=upZOhKhefAs"&gt;here&lt;/a&gt; on YouTube. Once launched successfully, there are some post configurations:&lt;/p&gt;&#10;&lt;ol class="wp-block-list"&gt;&#10;&lt;li&gt;Request a static IP and assign it to the EC2 instance;&lt;/li&gt;&#10;&lt;li&gt;Register a domain (within Lightsail, with Route53 or any other domain registrar) and create an A record referencing the IP address;&lt;/li&gt;&#10;&lt;li&gt;Create a certificate and set up anto-renewal. &lt;a href="https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-using-lets-encrypt-certificates-with-wordpress"&gt;Here &lt;/a&gt;is an instruction but the steps differ if DNS is managed outside of Lightsail;&lt;/li&gt;&#10;&lt;li&gt;Redirect http to https. Refer to the &lt;a href="https://docs.bitnami.com/aws/apps/wordpress-multisite/administration/force-https-apache/"&gt;instruction &lt;/a&gt;from bitnami;&lt;/li&gt;&#10;&lt;li&gt;Export from wordpress.com and import the xml into this little site.&lt;/li&gt;&#10;&lt;li&gt;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Notice that all services relevant to hosting are packaged into a single service called bitnami. In order to restart service, instead of restarting php, httpd and mysql individually, you can run the following:&lt;/p&gt;&#10;&lt;p&gt;# service bitnami stop&lt;br /&gt;&#10;# service bitnami start&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;In fact, in /etc/rc5.d or /etc/init.d, I do not find the individual services for httpd or mysql. There is actually an instance of MySQL database in the Instance:&lt;/p&gt;&#10;&lt;p&gt;# mysql -u root -p&lt;br /&gt;&#10;mysql &amp;gt; show databases;&lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;There you go! Now the site is live. This little &lt;a href="https://www.digihunch.com/2019/04/build-a-wordpress-site-in-one-hour-with-lightsail/"&gt;instruction&lt;/a&gt; will come in handy for rebuilding when this site is blown away 🙂&lt;/p&gt;&#10;&lt;h4 class="wp-block-heading" id="h-migrate-to-new-lightsail-instance"&gt;Migrate to new LightSail instance&lt;/h4&gt;&#10;&lt;p class="wp-block-paragraph"&gt;I have been using the same LightSail instance for 3.5 years and it&amp;#8217;s been stable. By Dec 2022, the version of PHP (7.2.17) has been outdated and I decided to launch a new LightSail instance based on new version of image, which comes with newer version of PHP (8.1.13). Here is a note of my steps:&lt;/p&gt;&#10;&lt;ol class="wp-block-list"&gt;&#10;&lt;li&gt;Create a new LightSail instance with the same SSH key, assign a new static IP to it. As soon as the new instance is created, we can access it by IP on HTTP, using the &lt;a href="https://docs.bitnami.com/aws/faq/get-started/find-credentials/"&gt;initial credential&lt;/a&gt; provided.&lt;/li&gt;&#10;&lt;li&gt;We need the latest version of All-in-One WP Migration plugin to perform the migration. Ensure its latest version is installed on both old and new instance. &lt;/li&gt;&#10;&lt;li&gt;Export site to file using All-in-One WP Migration plugin. It should produce a single file with wpress extension. For this site, the site is 450MB by Dec 2022&lt;/li&gt;&#10;&lt;li&gt;For the new site, try to upload the file and notice that the max size allowed is 80MB. I made the following changes:&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;&lt;a href="https://docs.bitnami.com/aws/apps/wordpress-multisite/administration/increase-upload-limit-php/"&gt;Change PHP attributes&lt;/a&gt;. Edit /opt/bitnami/php/etc/php.ini at the following attributes:&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;post_max_size = 512M&lt;/li&gt;&#10;&lt;li&gt;upload_max_filesize = 512M&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://help.servmask.com/2018/10/27/how-to-increase-maximum-upload-file-size-in-wordpress/"&gt;Change WordPress attributes&lt;/a&gt;. Create /opt/bitnami/wordpress/.htaccess with the following attributes:&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;php_value upload_max_filesize 512M&lt;/li&gt;&#10;&lt;li&gt;php_value post_max_size 512M&lt;/li&gt;&#10;&lt;li&gt;php_value memory_limit 512M&lt;/li&gt;&#10;&lt;li&gt;php_value max_execution_time 0&lt;/li&gt;&#10;&lt;li&gt;php_value max_input_time 300&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://docs.bitnami.com/aws/faq/administration/control-services/"&gt;Restart services &lt;/a&gt;related to wordpress &lt;/li&gt;&#10;&lt;li&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Now upload the .wpress file and it should take less than 5 minutes to upgrade. After the process, the new site is imported. Delete useless plugins.&lt;/li&gt;&#10;&lt;li&gt;Port the certificate files, including keys, certificate and certificate chains. In my case, I had to edit the following files:&#10;&lt;ul class="wp-block-list"&gt;&#10;&lt;li&gt;/opt/bitnami/apache/conf/vhosts/wordpress-https-vhost.conf&lt;/li&gt;&#10;&lt;li&gt;/opt/bitnami/apache/conf/vhosts/wordpress-vhost.conf&lt;/li&gt;&#10;&lt;li&gt;/opt/bitnami/apache/conf/bitnami/bitnami.conf&lt;/li&gt;&#10;&lt;li&gt;/opt/bitnami/apache/conf/bitnami/bitnami-ssl.conf&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;Configure HTTP-&amp;gt;HTTPS redirect on the new server. Revisit the files above.&lt;/li&gt;&#10;&lt;li&gt;Change DNS record to point to the new server.&lt;/li&gt;&#10;&lt;li&gt;Browse the site, check page and posts and pay attention to: images, tables, code blocks.&lt;/li&gt;&#10;&lt;li&gt;One common issue is images do not display. Check the image URL. The URL might have been replaced by bad values during import. Use a plugin (e.g. Go Live Update Urls) to correct the URLs in tables.&lt;/li&gt;&#10;&lt;li&gt;Use a plugin to find out broken links such as image, etc and fix the broken links. This should be an ongoing maintenance activity but is particularly worth doing on newly migrated site.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h4 class="wp-block-heading"&gt;Other little things&lt;/h4&gt;&#10;&lt;p class="wp-block-paragraph"&gt;There are many little things to fix. For example, I need to give transparent images white background. This is because when the site&amp;#8217;s background is black and the transparent area in the diagram will be black too, making diagrams (authored in white background) illegible. To do this, I have to add the following section to the additional CSS setting of the active theme:&lt;/p&gt;&#10;&lt;figure class="wp-block-image size-large"&gt;&lt;img decoding="async" src="https://www.digihunch.com/wp-content/uploads/2021/07/image-3.png" alt=""/&gt;&lt;/figure&gt;&#10;&lt;p class="wp-block-paragraph"&gt;WordPress is dynamic site and if you don&amp;#8217;t edit the site often, and don&amp;#8217;t want to start a static site from scratch (e.g. using &lt;a href="https://gohugo.io/"&gt;Hugo &lt;/a&gt;or &lt;a href="https://jekyllrb.com/"&gt;Jekyll&lt;/a&gt; frameworks), you can use WP2Static plugin. Make sure to configure S3 bucket and CloudFront accordingly. &lt;/p&gt;&#10;&lt;p class="wp-block-paragraph"&gt;Now, enjoy blogging.&lt;/p&gt;&#10;&lt;nav class="wp-post-navigation" aria-label="Post navigation"&gt;&#10;&lt;a rel="prev" href="https://www.digihunch.com/2019/03/storage-nitty-gritty-1-5/"&gt;&lt;span class="wp-post-navigation-label"&gt;Previous Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;Storage Nitty-Gritty 1 of 5 – Disk and RAID&lt;/strong&gt;&lt;/a&gt;&#10;&lt;a rel="next" href="https://www.digihunch.com/2019/04/application-i-o-characteristics/"&gt;&lt;span class="wp-post-navigation-label"&gt;Next Post&lt;/span&gt;&lt;strong class="wp-post-navigation-title"&gt;Application I/O Characteristics&lt;/strong&gt;&lt;/a&gt;&#10;&lt;/nav&gt;&#10;</description></item></channel></rss>