O'Reilly logo

Professional Microsoft IIS 8 by Benjamin Perkins, Dennis Glendenning, Scott Forsyth, Jeff Cochran, Kenneth Schaefer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Extending IIS Configuration

If you have followed through with the examples, you will recall that some of the static variables hard-coded into the module source may vary from application to application.

For example, the native code module example used the variable pszProtectedPath to determine which path to protect from cross-link requests. Another website may store images in a different path, and to use the same module on that other website, you would need to edit the source code and then recompile a special DLL just for that application.

Obviously, it would be a far better solution to permit configuration of the custom module without requiring access to the source.

The following section demonstrates how you can use IIS 8.0's extensible configuration to manage and control custom modules, to provide seamless integration of your custom module configuration parameters.

Adding Configuration Support to Custom Modules

This section uses the example managed code module discussed above to demonstrate extending the configuration system.

If you have followed the tutorial above, you will already be familiar with the module design and functionality. You may recall that the BlockLinks module will supply an alternative image if the request for an image file contains a blank HTTP_REFERER value. This means that if the request is generated by a non-link source, such as a bookmark or search index robot, the requested image will not be delivered.

It might be useful to allow the Server Administrator ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required