In my last tutorial, I showed you how to host a WordPress website on a Windows Server. Assuming you already have one WordPress site up and running, this guide will walk you through the steps to add another domain.
Hosting multiple WordPress sites on a single Windows Server 2022 setup can efficiently manage your web resources. So let’s get started.
Prerequisites
- A running Windows Server 2022 with IIS, PHP, MySQL, and URL Rewrite installed and configured. DO NOT proceed if you haven’t followed my guide.
- Additional Domains.
- Access to DNS settings for your domain names.
How to Add Multiple WordPress Websites on Windows Server 2022 Datacenter
Step 1: Prepare Your New Domain
Ensure you have registered the new domain that you want to add. You can get one on Namecheap.
In my previous tutorial, I had a domain called webshanks.shop. I will add a second domain called webshanks.online.
Log in to your domain registrar’s control panel and point the new domain’s A record to the IP address of your Windows Server 2022.
Step 2: Create a New Database
Create a new MySQL database for your new WordPress site using the MySQL Command Line Client.
CREATE DATABASE wordpress_webshanks;
CREATE USER 'wp_webshanks'@'%' IDENTIFIED BY 'strong_password';
GRANT ALL PRIVILEGES ON wordpress_webshanks.* TO 'wp_webshanks'@'%';
FLUSH PRIVILEGES;
Note down the database name, username, and password.
Step 3: Create a New Website in IIS
Open the IIS Manager from the Start menu.
Let’s add a new website.
In the Connections pane, right-click on Sites and select Add Website.
Fill in the Site name, and set the Physical path to a new directory (e.g., C:\inetpub\wwwroot\wordpress2).
Set the IP to your server’s IP address and hostname to your new domain name (e.g., webshanks.online).
Click OK to create the new website.
Step 4: Install WordPress for the New Domain
Download the latest version of WordPress from WordPress.org.
Extract the WordPress files and upload them to the new directory (e.g., C:\inetpub\wwwroot\wordpress2).
Now in your browser, go to localhost/wordpress2 so that we can install our WordPress.
Rename the wp-config-sample.php to wp-config.php and copy the configuration rules and save it.
Once you’ve done copying, click Run the installation.
Next, you need to add the title, admin username, password, and email.
Now you have installed a second WordPress website on Windows Server.
Time to create a certificate.
Run the wacs.exe as administrator.
Follow the steps I will share with you to create a certificate below.
Now you should be able to see an https and port 443 in your site bindings.
You can now securely access your second WordPress site hosted on Windows Server.
But wait, we still need to edit the WordPress Address (URL) and Site Address (URL). Go to your localhost and edit these parts.
We can access our WordPress admin page using our domain.
That’s it! If you want to add more WordPress websites, just rinse and repeat.
Step 5: Optimize and Secure Your New Site
Now we have another working WordPress website, you need to develop it to make a suitable website.
Install caching, security, and backup plugins to optimize and secure your new WordPress site.
For maintenance, ensure regular updates for WordPress, themes, and plugins to maintain security and performance.
Conclusion
By following these steps I’ve laid out, you can efficiently add multiple domains to your Windows Server 2022 for hosting separate WordPress installations.
This setup allows for streamlined management and resource optimization, leveraging the robust features of IIS and Windows Server.