• 12 hours
  • Medium

Free online content available in this course.

course.header.alt.is_video

course.header.alt.is_certifying

Got it!

Last updated on 6/1/22

Configure the IIS Service to Host a Web App

In this final chapter, let’s head off the beaten track and configure Windows Server to host a web app using PHP.

Why are we doing this?

Your manager at Gift Ltd. has hired a junior web developer tasked with creating a web app for managing procurement. You have a budget for purchasing an identity and file server, and you’ve chosen to use Windows Server. So why not go big and configure the web server role on a virtual machine?

Decide Where to Host Your App

You will have to work with the developer to decide on the size of your server. The first question is, do you need one or several virtual machines?

In Gift Ltd., like other companies, you have a Microsoft Support contract, so you have to work within this setting. It’s important that anyone can call Microsoft for help if there are any problems when you’re not there. Therefore, you can only use Microsoft Windows as your operating system.

Your other limitation is that you only have two licenses for your virtual machines. Remember, you purchased one physical server with a Windows Standard license. One virtual machine is dedicated to the Active Directory and the second to your file server. To avoid using the Active Directory server, you decide to host your web app on your file server.

Therefore, you must set up the following architecture:

Your network architecture
Your network architecture

You’ll need to provide your web developer with all of the necessary tools and access and client access to the app being built.

Configure App Hosting

So first, add a role to your file server VM. Next, configure the Web Server role to allow management of the language required by Gift Ltd.’s new developer (PHP in this case). Remember that you’re about to set up a production application, so you cannot use a turnkey installer (WAMP, Laragon, EasyPHP, etc.).

Your next step, then, is to install the Web Server role. This role consists of IIS (Internet Information Service), a competitor to the Apache server commonly used on Unix/Linux systems. IIS lets you serve web pages to your users.

IIS manager
IIS manager

This manager is the same for other roles (DNS, DHCP, etc.) and needs no introduction. By default, IIS will suggest a website to recommend an initial functional configuration. Go to http://localhost to look at this website. You’ll get the information from IIS10:

IIS10 default website
IIS10 default website

Your goal is to provide your colleague with a functional environment. Therefore, you’re going to create a  test.php  file at the root of this website, for which the path is the following by default:   C:\inetpub\wwwroot  . Within this file, enter the following lines of code:

<?php
phpinfo();
?>

If you try to display this page at this stage, you should receive a 404.3 not found error message, meaning that IIS cannot handle this type of file. You want this file to be handled and get the phpinfo page, which will provide your developer with lots of information. Until this page can be handled, there’s no point giving your colleague access because it’s not functional.

You now have two potential options for activating PHP and configuring your IIS:

  1. The automatic method using Web Platform Installer.

  2. The manual method.

The manual method is very similar to installation with Unix/Linux, so I’ll let you work out how to do the different tasks, which are basically:

  • Get a PHP binary.

  • Configure php.ini.

  • Associate PHP to a CGI model.

The Automatic Method

This method simplifies the installation of web platforms by using Microsoft approved modules. Before any action, go to Add Features to proceed with installing CGI support for IIS.

Next, install the Web Platform extension on the IIS Manager.

Go to your server name in the manager window. Then, in the Actions menu on the right-hand side, select Get New Web Platform Components. Finally, install the suggested extension

Once the extension is installed, launch Web Platform Installer and search for the module you want to install, which is PHP in this case.

Search results for PHP
Search results for PHP

PHP will be ready to go once you’ve added this and installed it using Web Platform Installer!

Your test.php page should render correctly, allowing you to give your colleague controlled access. You have several options for giving access:

  • You could share a remote desktop.

  • You could provide them with administrator rights only for the IIS server or only on the service start up or shut down. 

Your new service is online, so you need to open the application ports for your clients. Then, you can add support using TLS through the Let's Encrypt service. It will give you a free certificate in x509 format, allowing you to use the TLS protocol and HTTPS.

Additional Resources

Let’s Recap!

  • Microsoft IIS is the web server that works in Windows Server.

  • IIS lets you manage a web application with advanced handling of programming languages through the CGI modules.

  • IIS is installed and administered using Server Manager, like  all Windows Server roles.

  • Web Platform Installer lets you easily and automatically install modules or web applications securely.

Conclusion

You’ve come to the end of the course. You now have all the information you need to use Windows Server like a pro! You are now able to:

  • Select, install, and administer the right version of Windows Server.

  • Install and configure both roles and features.

  • Manage network services.

  • Run advanced services and features such as cloud, virtualization, or management without the GUI.

Having all of these tools opens up a host of options for you, both professionally and academically.

I hope to see you in another course soon!

Example of certificate of achievement
Example of certificate of achievement