8 min read

How To Host Different Sites On IIS Servers

IIS/Servers/Azure/SSL/SSL Certificartes/Tech/Technology/Software/Software Development/Coding/IP/IP Address/Win Acme/Front End Development/Back End Development
Not sure how to navigate IIS servers? Here's a quick rundown on how to host multiple sites securely by using modern tools and methodologies.
Written by
Suresh C
Published on
October 20, 2023

Let’s explore the process of hosting multiple sites on Internet Information Services (IIS) while securing them with SSL certificates using win-acme—a popular Let's Encrypt client for Windows servers. For this we will use Azure VM which will host our app/websites via IIS. We will also demonstrate how to configure subdomains for your hosted sites and for this we will use GoDaddy as our hosting provider. By assigning unique IP addresses to each website, we can enable SSL for each site individually. So, let's get started!

1. Adding Subdomains in DNS Settings:

a. To begin, add two subdomains in your domain's DNS settings. Add A records for "devapi.yourdomain.com" and "api.yourdomain.com," both pointing to the same VM public IP. A record maps a domain to the physical IP address of the computer hosting that domain. We will use these subdomains in bindings within IIS.

2. Setting Up the Initial Websites and Subdomains:

a. Firstly, let's add the "dev-api" site on port 443 in IIS.

A screenshot of a computerDescription automatically generated

3. Hosting a Site with a Specific IP Address:

a. To host another site named "prod-api" on port 443, create a new site in IIS.

b. Instead of using "All Unassigned," use the specific IP address in the site's binding. This ensures that the site is associated with a unique IP address.

4. Assigning Unique IP Addresses for SSL Certificates:

a. Assigning a unique IP address to each website is the traditional method of hosting multiple sites with SSL on the same server.

b. Each site is linked to a specific IP address, and each IP address can have its own SSL certificate.

c. This approach allows each website to use port 443 for secure HTTPS connections since they have different IP addresses.

5. Downloading and Configuring win-acme:

a. Download the win-acme setup from its official website.

b. Extract the zip file and move the extracted folder to the C drive for easy access.

6. Running the win-acme Setup:

a. Locate the wacs.exe file in the extracted folder and run it from the command line.

b. When prompted, select "N" to choose the default settings for certificate creation.

7. Choosing the Binding for SSL Certificate Generation:

a. Provide the number associated with the binding for which you want to generate the SSL certificate.

b. You can choose to create certificates for specific bindings or all bindings on the server.

A screenshot of a computer programDescription automatically generated

8. Proceeding with Certificate Generation:

a. Once you have selected the desired bindings, confirm your choice by entering "Y" to proceed with the certificate creation process.

9. Verifying Certificate Renewal:

a. Check the scheduler to ensure that the certificate renewal task is added successfully. This ensures that your SSL certificates remain valid and up to date.

A screenshot of a computerDescription automatically generated

By following these steps, you can effectively host multiple websites on IIS with individual SSL certificates using win-acme. By assigning unique IP addresses to each website, you ensure a secure and seamless hosting environment. With SSL certificates properly installed, your websites will be encrypted, and users can access them securely over HTTPS. Additionally, by using different bindings for subdomains, you can route requests to the appropriate site based on the subdomain information provided by the user's web browser. Enjoy the benefits of a secure and efficient hosting environment for your various web projects!

Weekly newsletter
No spam. Just the latest releases and tips, interesting articles, and exclusive interviews in your inbox every week.
Read about our privacy policy.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Contact us

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Take a step closer to the new way!

Explore creative and new approaches with experts by your side.