Ok, So I have an instance of Windows Server 2012 R2 installed to a virtual machine on my local development PC with IIS . The idea being I need to practice and learn about how to deploy sites to web servers. I have tinkered around with some of the settings, but I am not entirely sure how to set up this server for .NET development. Does anybody have a clear cut translation of what exactly I am supposed to do to set this server up so that I can deploy to it? I am entirely confused right now because I just came across a couple of how-tos some in books which were actually outlining how to do it on a Windows 7 client environment, not the full fledged server. This instance of IIS will never be allowed to see the internet, it is just for development purposes. If anybody knows how to do this that would be awesome.

Recommended Answers

All 3 Replies

With Docker becoming a thing now perhaps we will all get linux servers! ha!

We work with Internet Information Server (IIS) all the time and find it far easier to setup and manage than any of the Apache on Windows incarnations. It is particularly easy to setup secure websites on IIS.

Irrespective of whether you are working with any modern version of Windows Server, for example 2012 or 2016 or Windows workstation - from Windows 7 upwards, there are two key points to make. Firstly, it is difficult but impossible to create a 32bit IIS environment, 64bit is preferred and secondly, you should start from a plain instance of your Server or Workstation environment. That is do not attempt to add any of the modules, programs and features related to IIS manually. Microsoft supply an excellent tool for the purpose called Web Platform Installer (WPI for short). If you search for "microsoft wpi", you will surely find it.

Download and install WPI on your environment and then use that tool to create your IIS environment. Version 5 is the current level of WPI. The top menu offers three links - spotlight, products and applications. You can ignore spotlight and applications are appropriate after you have installed the web server environment, so click on products. You will be presented with a long list of items that can be installed (a few will already show as installed). To help you out, look for an entry "IIS Recommended Configuration" and select the button "Add". That single item will setup a lot of the web server essentials. You will notice that in the footer of the program, the number of items to be installed will now register maybe 16 items and there is an install button that you can press. At this point you are directed to subsidiary screen where you asked to confirm your request and agree to certain licenses. After that the process of download and installation is totally automatic.

As there are at least a 100 options that can be installed it is impossible to tell you exactly what you need but I can say that this is the best way to install not only the programs that you need to run a web server but also the tools that you need as well. For example if you need a working and configured installation for ASP.NET, then WPI is the preferred way to install a Community Version of Visual Studio and all the .NET support files.

The previous point opens up an interesting point. One is unlikely to put an instance of Visual Studio on a Server. So WPI is the tool that one uses for both the production (or testing) server and the development workstation.

WPI is not perfect and you will find some gotchas that never seem to have been fixed. An example is installing PHP Manager. But if you search for a solution to your problem, there will be many answers.

I am not going to try and replace the excellent tutorial that Microsoft provides at https://docs.microsoft.com/en-us/iis/install/web-platform-installer/using-the-microsoft-web-platform-installer.

Let us assume that you now have two instances if IIS installed - one on your production or testing server and one on your workstation. Alternatively you might have created a virtual machine with a Server and IIS whilst using your parent workstation for programming and development server. What is important is that you can manage both instances of IIS from one instance of IIS Manager running on your workstation.

Setting up any type of website could not be easier as all you need to do is name it, create it and point it at a subdirectory. All websites are capable of doing all the things that the webserver has been configured to do - process aspx.NET pages, PHP pages, .JS pages and .PY Python pages - all in one website if you are so inclined.

I appreciate that setting up a functioning .NET website can be quite tricky, especially the correct registration of libraries, so I do that from within the installed version of Visual Studio.

Finally, as I intimated earlier, setting up secure websites in IIS is far easier than doing the same thin in Apache, in my opinion. From the home IIS sites screen, one has access to Server Certificates. From there you can create a Certificate Signing Request and save it as a text file. We use CaCert.Org for development purposes. We copy the contents of the CSR text file to the appropriate textarea on CaCert and process it to a Certificate. We save that into another text file with a CRT extension. We then Complete the Certificate Request so that IIS has created a chain. The new Certificated is now available to be bound to our new development website.

I hope all of this helps and I stand ready to expand on any individual points.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.