Life

Migrating to AWS Malaysia Region: From Linux to Windows/IIS with Free SSL from ACM

By CYLim

September 08, 2024

For the past few weekends, I’ve been busy migrating my website and WordPress blog from my previous hosting provider to the newly launched AWS Malaysia Region. Initially, my plan was to set everything up using the classic Linux/Apache stack, but after evaluating my project requirements (And my expertise in IIS 😅), I decided to go with Windows/IIS instead. This decision was largely based on familiarity, support, and ease of use for what I had in mind.

After a few challenges, I was able to complete the migration seamlessly, and to top it off, I secured everything using the AWS Certificate Manager (ACM) which provided me with a free SSL certificate! In this post, I’ll walk you through some of the steps I took to make this migration successful, and provide some extra instructions for those of you planning to run PHP and Laravel on IIS. Let’s dive in!

Migrating to AWS Malaysia Region

AWS recently launched its Infrastructure Region in Malaysia, offering improved latency and performance for those of us working out of Southeast Asia. The timing couldn’t have been better for my migration.

Here’s a quick rundown of the migration process:

  1. Setting up an EC2 Instance: I spun up a Windows Server EC2 instance using AWS Elastic Compute Cloud (EC2). AWS made it easy to select the region closest to me—AWS Malaysia Region—and launch a server instance that met my performance needs.
  2. Installing IIS: Once my Windows Server instance was up and running, I installed IIS (Internet Information Services) using the Server Manager.
  3. Migrating WordPress: I moved my WordPress site from my old host to AWS manually by copy the directory and export the SQL.
  4. Setting Up SSL with ACM: Security is always a top priority, and I took advantage of AWS Certificate Manager (ACM) to get a free SSL certificate for my domain. ACM automates the provisioning and renewal of SSL/TLS certificates, ensuring my website is secure without the need for manual intervention.

Everything was running perfectly—until I realized I also needed to host a Laravel application on this server.

Enabling PHP in IIS for Laravel

If you’re planning to run PHP-based applications like Laravel on IIS, there are some additional steps you’ll need to follow. Here’s a step-by-step guide to get PHP up and running on IIS, and ensure that Laravel works without issues:

1. Install PHP on Windows/IIS

First, you’ll need to install PHP on your IIS server.

2. Install FastCGI

To enable IIS to process PHP files, you’ll need to install FastCGI support.

3. Configure PHP with IIS

You need to tell IIS where to find the PHP installation. Here’s how:

4. Install Composer

Now that PHP is up and running on IIS, the next step is to install Composer and Laravel.

5. URL Rewrite Module for IIS

Laravel requires the URL Rewrite Module to work correctly with IIS.

6. Database Setup

After following these steps, Laravel app should be fully functional on IIS!

Wrapping Up

Migrating my website, WordPress blog, and Laravel app to AWS Malaysia Region using Windows/IIS turned out to be a rewarding experience. By enabling PHP and configuring the necessary components, I’ve ensured my applications run smoothly and securely in the cloud. Thanks to AWS’s robust infrastructure and ACM’s free SSL certificates, I’m confident my setup will handle future growth and challenges with ease.

If you’re planning to do the same or have any questions, feel free to reach out. I’m more than happy to help!

Key AWS Services Used:

Exploring AWS free tier and expanding my tech knowledge has been a blast, and I highly recommend it to anyone looking to dive into cloud computing. It’s empowering to manage your own cloud infrastructure, and AWS offers great flexibility, whether you’re using Linux or Windows!

Have you tried AWS for your hosting needs? Let me know your thoughts and experiences!