HomeBlogsHow to use IIS to host a website locally on Windows

How to use IIS to host a website locally on Windows

This tutorial is about How to use IIS to host a website locally on Windows. We will try our best so that you understand this guide. I hope you like this blog, How to use IIS to host a website locally on Windows. If your answer is yes, please do share after reading this.

So lets keep reading for intertesting info:

Check How to use IIS to host a website locally on Windows

IIS or Internet Information Server is the server used to host .Net web applications. IIS hosting is usually installed on a Windows server. In order for users to access a website, the website needs to be hosted on some type of web server. There are different web hosts available for different technologies. In .Net, the available web server is called Internet Information Services or IIS.

Once the web application is developed, it is deployed to an IIS server. End users can access this web application. An example of this is publishing a scene from a Unity project. You’ll probably get an error if you try to open the index.html file directly in your browser without a web server running. In this case, you could store your Unity WebGL files in IIS and run them on the server.

How to use IIS to host a website locally on Windows

Enable IIS

Enable IIS by using the Turn Windows features on and off menu in Windows.

  • Search for Turn Windows features on and off using the search bar.
  • Select the Internet Information Services option.
  • Expand Internet Information Services and select all the secondary functions that you need.
  • Click OK and wait for Windows to apply the new changes. In the future, if you decide to remove or change features, Windows may ask you to restart your computer before applying them.
  • Find the IIS application, which will now be available to open on your Windows computer.
  • Open IIS to see the IIS console.

Create a simple test website

Create a simple static website using HTML and CSS.

  • Create a new file called index.html. Add the following content to the file:
    • Start
    • About
    • Contact
    • This is a test website

    • Create a new CSS file called styles.css. Add the following style to the file.
      • * {
      • font family: sans-serif;
      • }
      • .nav {
      • border-radius: 0px !important;
      • White color;
      • }
      • .Link {
      • right margin: 10px;
      • font size: 12pt;
      • }
      • .brand {
      • left margin: 20px;
      • right margin: 40px;
      • font size: 18pt;
      • }
      • .container {
      • text alignment: center;
      • padding: 40px 20px;
      • }
    • Create a new folder in the C:inetpubwwwroot directory on your computer called MyTestWebsite. This folder is specifically used to store the web pages and other content that make up your website.
    • Copy or move the index.html and styles.css files to the new MyTestWebsite folder.
    • Add and configure your website using IIS

      To host your website with IIS, create a new website and point it to your content.

      • In the left sidebar of the IIS console, right-click the Sites directory.
      • From the options in the menu, select Add Website, to open the settings window.
      • Add a name to the site name, such as “My Test Website”. IIS will automatically fill in the field for the application pool.
      • Add the physical path, which is the location where you have stored your website files on your computer. Click on the three dots to select a folder. In the menu, go to the MyTestWebsite folder, in the C:inetpubwwwroot directory.
      • Select https as Type. The default port for HTTPS is 443, but you can change the port to something else if it is currently in use.
      • You can also set a hostname, but leave it blank for now.
      • For SSL Certificate, select IIS Express Development Certificate.
      • Select Start website immediately and click OK.
      • Highlight the new My Test Website directory in the left column.
      • Click Advanced Settings, which is in the list of options on the right side of the panel.
      • In the Behavior section, change the Enabled Protocols option to “https” and click OK.
      • If you want to edit these details at any time, you can click the Basic Settings or Advanced Settings options in the menu on the right.

      Host a website using IIS

      Local testing is an important part of any development cycle, including when building a website. You can host your website locally using the Internet Information Services (IIS) web server. You can use it to host any static website (for example, a standard HTML or CSS site) or dynamic website (for example, an ASP.NET site).

      There are several options to choose from when hosting your website online. If you are hosting a simple website, you can save your website files to Dropbox, Google Drive or One Drive before hosting.

      Final words: How to use IIS to host a website locally on Windows

      I hope you understand this article, How to use IIS to host a website locally on Windows. If your answer is no, you can ask anything via the contact forum section related to this article. And if your answer is yes, please share this article with your friends and family to give us your support.

      James Hogan
      James Hogan is a senior staff writer at Bollyinside, where he has been covering various topics, including laptops, gaming gear, keyboards, storage, and more. During that period, they evaluated hundreds of laptops and thousands of accessories and built a collection of entirely too many mechanical keyboards for their own use.


      Must Read

      - Advertisment -