Enabling Classic ASP on IIS8 (Windows Server 2012)

IIS 8.5 on Windows 2012 R2
IIS 8.5 on Windows 2012 R2

Getting Classic ASP to run on IIS8.5 comes with a few gotchas that can easily cause problems well beyond what you might expect. In the article below I’ll review the general steps and guidelines that I figured out through trial and error by going through the process myself.

To enable ASP on IIS8.5:

For starters you’ll need to configure your server to allow Classic ASP to run. This might come as a bit of a shock to developers who are used to earlier versions of IIS where Classic ASP was enabled by default. However in IIS 7 and above, you will need to intentionally enable IIS to run ASP.

Basic Setup

Here is a link to a support site that gives the step by step instructions for setting up IIS with ASP.NET. This should be enough to get your server going and serving up basic .NET Web sites.

I found that my instance of IIS8 was different from the version in their explanation, but in general the article was decent.

IIS 8.0 Using ASP.NET 3.5 and ASP.NET 4.5

Configuring IIS8 to Serve Classic ASP Sites:

After I had set up my server to host basic sites, I needed to update the configuration to include the ability to host Classic ASP. Here are the steps I took to do so:

  1. Log onto the Windows Server 2012 machine
  2. Open Control Panel
  3. Click to open the Server Manager UI
  4. Click Add Roles
  5. Under Installation Type select: Role-based or Feature-Based Installation
  6. Go through next button if you haven’t configured IIS yet and this is the first time on your Server
  7. Click on the Server Roles option on the left-hand menu
  8. Under Roles in the middle screen, scroll down to the option: Web Server (IIS) and open up this option
  9. Expand the Web Server option
  10. Find and expand the Application Development option
  11. You should see the option now to enable ASP. Click the ASP checkbox
  12. Click the Next button until you reach the confirmation screen, then click the Install option
  13. Congratulations – Your Web Server will now be set to serve and run classic ASP applications

Keep your Sanity: Enable Errors

Ok, so if you want to stay sane, then you should definitely update IIS to output errors to your browser. You can always disable this in future for security reasons, but when you are setting up your site, it’s very important to know why it is not cooperating:

Specifically, by default IIS7 and above will not send detailed error messages to the browser… you need to allow this manually. If you are stumped as to why your application isn’t working here’s how to get a visual of what’s going wrong behind the scenes:

  1. In IIS, click your Web site. Click the ASP option in the main window.
  2. Expand the Debugging Properties option.
  3. Change to true the option to: Enable Client-Side Debugging
  4. Change to true the option to: Enable Server-Side Debugging
  5. Change to true the option to: Send Errors to Browser

Also under the option Enable Parent Paths, set this value to True. This allows you to use the .. notation in your ASP code to traverse directories. Again, for security reasons, Microsoft has disabled this by default.

Getting Further Insight into Errors

If you get errors running your application, then remember that you can also look into the IIS Web site error logs, which are usually found at: C:\inetpub\logs\LogFiles

This is a great resource in addition to viewing errors in browser that should be able to help you track down even the most obscure bug.

Don’t Forget to Escalate your Security

As part of your debugging efforts, you’ll need to change files and test the changes to make sure that IIS is serving your ASP files correctly. While you are doing this, make sure you temporarily escalate your account security level so that you can actually save the changes you are making. By default Windows Server 2012 likes to give the lowest possible permissions, so…

As an admin-level account:

  1. Right Click the folder you will be working with… this is typically the root Web site folder
  2. Click the Edit button to change permissions
  3. Add your account to the list of users and ensure that you have modify as well as write access to the folder (along with the standard: Read, List folder contents, Read & execute)… or just set yourself to full control.

Note that you will need to also give yourself permissions for each sub-folder. Windows 2012 does not automatically propagate your new permissions settings to sub folders unlike earlier versions of Windows. This ends up being annoying, but I guess it is all for enhanced security so I can’t really complain (too much).

Further Handy Resources

Here is a link to the Official Microsoft support site to help you get your Classic ASP applications running under IIS7 and IIS8. There are some very handy resources, so it is worth having a look:

Running Classic ASP Applications on IIS 7 and IIS 8

Optional MIME types:

If you get issues with rendering ASP pages, you may need to check into setting up the MIME types for your site. I did not end up needing to do this, but in case you do, you can add ASP MIME types as follows:

.asa text/asp
.asp text/asp

Here is a site that lists many useful Mime types and the files extensions to set for them. Note that some of the newer MS Office extensions aren’t listed here:

Site with a chart that shows you a list of common MIME types and their corresponding file extensions

Try out this site for another large list of extensions. These include some of the more recent MS Office document types:

Mime types on my Windows/IIS 

14 responses to “Enabling Classic ASP on IIS8 (Windows Server 2012)”

  1. Thanks, it has helped me a lot!

    1. You are very welcome, I am glad the article was helpful.

  2. Thanx it was short and nice.

  3. amoeba7@gmail.com Avatar
    amoeba7@gmail.com

    Thank you , you saved my day !!

    1. I’m glad the article was useful, thanks for letting me know!

  4. I’ll be needing this very soon. Thanks for publishing this.

    1. Not a problem, I’m glad you found the article helpful.

  5. Note: text/html (text/css or text/javascript, etc.) is the mime type you should be delivering to your users. Your users web browser is not concerned over the backend language constructing your site.

    Good article, found it helpful.

  6. I had to reboot the computer in order for Classic ASP configuration icon to appear

  7. […] for your application to run like it should. See a previous article on my blog for instructions on how to enable Classic ASP on your new Web server (since it is not enabled by […]

  8. Perfect Information. Thank you

  9. Thank you. You saved me from getting bald.

  10. I have migrated classis ASP website from IIS6 & 2003 server to IIS 8.5 and windows server 2012.

    Most of the things are working good except the Request.ServerVariables(“LOGON_USER”). It is empty always. Please help me to resolved this issue.

    Shivaji

  11. Excellent post Justin. I noticed something odd after migrating my .asp site over to windows 2012: seems IIS 8 is caching the web site. I have pages that I’ve deleted that still appear in the browser, and new pages are not being found. I’ve set the Output Caching to not caches .asp pages to no avail. Have you run across this before? Thanks for your time.

Leave a comment