IIS 7.5 and IIS 8.0 European Hosting

BLOG about IIS 7.5 Hosting, IIS 8.0 Hosting and Its Technology - Dedicated to European Windows Hosting Customer

IIS 8 Hosting - HostForLIFE :: Automating Database And Folder Backups On Windows Server

clock September 16, 2022 09:51 by author Peter

It is unnecessary to state the importance of having an automated backup strategy for your servers. Every server administrator has to go through the tiring job of setting up backups which include writing scripts, scheduling tasks, setting up alerts, and so on. To simplify this task, I have designed a simple utility to help server administrators and database administrators automate backups. This utility can automate MSSQL, MySQL, and Folder backups.

You are welcome to suggest new features or contribute your own.
Part 1 - Installing the utility

    Download the setup file from the GitHub repository (Installer\bin folder)
    Install on the server where you need to set up backups

After you run the application, you will see the following screen:

Part 2 - Defining Backup Jobs
Click on the 'Settings' button on the bottom right to configure backup jobs.
On the first tab, 'MSSQL Server', click on the 'Add' button to add a new MSSQL backup.
Define the server details as shown below. Check 'Enable Backup' and specify the backup time.

After entering the details, click on 'Validate and Save'. The utility will try to connect with the MSSQL Server using the given credentials. If the connection is successful, the entry will be saved and you will see it in the list as shown below,

Similarly, go to the second tab 'MySQL Server', and click on the 'Add' button to add a MySQL backup.

You can also backup specific server folders by using the 'Folder Backup' tab.

Part 3 - Specifying Local Storage Location
After defining the backup jobs, go to the 'Local Storage' tab and designate a folder on your server where you wish to store the backups.
Be careful that this folder should not be one of the backup folders, otherwise the program may behave unexpectedly.

Since all backups will be stored in this folder, it is recommended to set an auto-delete policy as shown above. You can set a longer duration like 15 days or so as per your convenience.
Part 4 - Remote Storage
After backing up files locally on the server itself, we need to move them to remote storage.
Currently, the utility supports Amazon S3 backups. Go to the 'Remote Storage' tab and define your AWS credentials to automatically move files from 'Local Storage' to 'Remote Storage'.

Part 5 - E-Mail Alerts
You can easily set e-mail alerts to notify you of successful/failed backup jobs (both local and remote backups)
Click on the 'E-Mail Settings' tab and define your SMTP credentials as shown below.

There are four types of alerts available:
    Send mail on failed local backup
    Send mail on failed remote backup
    Send mail on successful local backup
    Send mail on successful remote backup

Click on 'Validate and Save' to check your e-mail credentials. This will send a test mail to the 'Recipient E-Mail' address.
Click 'Close' to go back to the main screen.

The number of backups defined will appear here. It will also show the status of AWS S3 settings and E-Mail settings.
Click on the 'Install' button to install a backup service to process your jobs in the background.
This may take a couple of seconds. The status will change, as shown below:

To view logs, click on the 'Logs' button. Here you can find the logs of backup jobs and results for troubleshooting purposes.
After this, you can click on 'Exit' to close the User Interface.
The backup service will keep running in the background and will take care of defined backup jobs.
To verify the backup service status, open 'services.msc' and check for service name 'Runtime Backup Service'

Here is a sample e-mail sent by the utility:


I hope this will help your business and save you lots of time in managing multiple backup scripts and configuring alerts.
Using this unified interface, you can automate your backup jobs easily.

IIS 8 Hosting - HostForLIFE :: How To Change Localhost To Custom Domain Name In IIS?

clock September 9, 2022 08:55 by author Peter

Most developers face a lot of problems while releasing a website in the production/hosting environment because they don't have experience with local IIS and custom domain names. IIS Express (localhost) provides developers with almost all the settings for development and debugging. Since most of the developers work with IIS Express, they have a lot of issues while working on the real server (hosting environment).

Instead of running, developing, and debugging (testing) a website using a localhost URL (like http://localhost:), local IIS (custom domain name) gives a good feel and looks professional. Setting a custom domain name instead of localhost will help you during website development, debugging, and its release.

Often, developers release security patches and updates to their customers. For this, they require the versioning of the domain. The virtual directory and application concept in IIS (Internet Information Services) helps developers to a version that I will also discuss in my article.

In this tutorial, I am going to explain various steps to change localhost to a custom domain name in IIS. This detailed article will cover the following topics as follows,

    IIS Setup Configurations
    Changing localhost to Custom Domain Name Configurations
    Advanced Custom Domain Name Configurations

As per Wikipedia, "Internet Information Services (IIS, formerly Internet Information Server) is an extensible web server software created by Microsoft for use with the Windows NT family. IIS supports HTTP, HTTP/2, HTTPS, FTP, FTPS, SMTP and NNTP".

Application Pool
An application pool defines a group of one or more worker processes, configured with common settings that serve requests to one or more applications that are assigned to that application pool. Since application pools allow a set of web apps to share one or more similarly configured worker processes, they provide an easy way to isolate a group of web applications from other web applications on the server machine.

With the help of application pools, we can achieve the level of application isolation required in terms of availability and security by deploying applications across multiple application pools. Each worker process is separated by process boundaries. Therefore, problems with applications in one application pool have no effect on sites or applications in other application pools. Application pools significantly increase the dependability and management of your web infrastructure.

A site is a container for applications and virtual directories that can be accessed through one or more unique bindings. Binding has two major communication properties:

    Binding Protocol: It defines the protocol over which communication between the server and the client occurs. It can be either HTTP or HTTPS.
    Binding Information: It defines the information that is used to access the site. It is the combination of IP address, port, and optional host header.

If a site requires different protocols or binding information, it may have more than one binding.

In earlier versions of IIS, only the HTTP and HTTPS protocols were supported, but in IIS 7 and above, bindings can apply to any protocol.

An application is a set of files that delivers content or provides services over a protocol, such as HTTP. When you create an application in IIS, the path to the application becomes part of the URL of the site.

Virtual Directory
A virtual directory is a directory name (also called a path) that you specify in IIS and mapped to a physical/virtual directory on the system.

Virtual Directories aren't supported with ASP.NET Core apps. An ASP.NET Core app can be hosted as an IIS sub-application.

In short, a site can contain more than one application or virtual directory, an application can contain more than one application or virtual directory, and a virtual directory can contain more than one application.


    IIS (Internet Information Services)
    Running Project (Here, I am using an ASP.NET web application).
    Web Browser (Whatever you use, but I like Microsoft Edge)

IIS (Internet Information Services) Setup Configurations

This section will tell you how to set up IIS (Internet Information Services) in your system. First of all, we have to check whether our system has IIS enabled or not? For this open any of your favorite browsers and just type the following URL, "IIS Windows".

If you get this page, it means that you have already enabled IIS in your system. So, you can skip this section and go to the next section.

If you get this error, it means you need to enable it. So, stay with us and follow the steps given below very carefully. (Make sure you are connected to the Internet when configuring it).

You can also check if you have IIS enabled on your system by searching for "IIS" in your Universal Search, which is next to the Start button.

Step 1
Click Start and type "Turn Windows features on or off" in the search bar. Then, click Turn Windows features on or off to open Windows Features.

Step 2
Search for "Internet Information Services" and check it and every box that appears in it needs to be checked. Click on the "OK" button to proceed.

Make sure you have checked every box inside it. Because if some features are left, it will cause problems in IIS while mapping your application.

Step 3

After successful installation, a message will appear on the screen "Windows completed the requested changes". Now, click Close. (Now, you have to restart your system to apply all the changes).

After the system restarts, search for IIS again in your Universal Search Bar near the Start button. You will see the IIS as a result. Now, click on, to open it. (Alternatively, you can confirm it by typing the following URL, IIS Windows in any of your favorite browsers).

Congratulations, you have successfully enabled IIS in your system.

Changing Localhost to Custom Domain Name Configurations
Step 1
Click Start and type "IIS". Then click "Internet Information Services (IIS) Manager" to open the Internet Information Services (IIS) Manager.

Step 2
First, we create a new application pool to host our new application. Follow steps 2a and 2b very carefully to create a new application pool.

Step 2a
Right-click on the Application Pools, and click on "Add Application Pool...".

Step 2b
Now, create a new application pool by choosing the following configurations. (Note, if you are using the latest version of the .NET framework, select the following options).
    Give a name to your new application pool
    Select ".NET CLR Version v4.0.30319" option from .NET CLR Version
    Select the "Integrated" option from Managed pipeline mode

Step 3
Right-click on the Sites and select the "Add Website..." option from the list.

Step 4
Now, enter the details as per the given fields and your requirements. And, click the "OK" button.

    Site Name: Choose a name for your new website.
    Application pool: Select the "Application pool" that you have created earlier, by clicking on the "Select" option.
    Physical path: Select the main (root) directory of the application.
    Host name: Now, it's time to set up your custom domain name. In the "Host name" field, type the custom domain name you want for your application.

If you do not select the Application Pool, a new application pool is created using the name of the site when the site is added. IIS defaults to one application pool per site.

Step 5It's time to register/map your custom domain name with your local IP ( To do this, navigate to the following path, "C:\Windows\System32\drivers\etc" and open the "hosts" file in any text editor with the Administrator privileges. Remember that, you will need administrator privileges to save your changes in the "hosts" file.

This is a sample HOSTS file used by Microsoft TCP/IP for Windows. This file contains the mappings of IP addresses to host names. Each entry should be kept on an individual line. The IP address should be placed in the first column followed by the corresponding host name. The IP address and the host name should be separated by at least one space. Additionally, comments may be inserted on individual lines or following the machine name denoted by a '#' symbol.

For example:

  •     rhino.acme.com      # source server
  •       x.acme.com           # x client host

Now, map your custom domain name as in the following example and save the file.


Congratulations, you have successfully changed localhost to the custom domain name for your application.

IIS 8 Hosting - HostForLIFE.eu :: Running an ASP.NET MVC Application on IIS 8

clock April 3, 2020 08:04 by author Peter

IIS has ever increasing amounts of security, you can’t publish a basic ASP.NET MVC website anymore and expect IIS 8 to host it without some additional work. The default config settings that the MVC uses are locked down in IIS, so it issues an error when you try to navigate to your fresh site.

Initially you may get a screen that says something bland and non-descriptive, like “Internal Server Error” with no further information. To get the more detailed error messages modify your web application’s web.config file and add the following line to the system.webServer section:

<httpErrors errorMode="Detailed" />

Now, you’ll get a more detailed error message. It will look something like this:



The key to the message is: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

The “Config Source” section of the error message will highlight in red the part that is denied.

In order to allow the web.config to modify the the identified configuration element you need to find and modify the ApplicationHost.config file. It is located in C:\Windows\System32\inetsrv\config. You’ll need to be running as an Administrator level user in order to modify the file.

Find the section group the setting belongs to, e.g.

<sectionGroup name="system.webServer">

Then the section itself:

<section name="handlers" overrideModeDefault="Deny" />

And update overrideModeDefault to "Allow" in order to allow the web.config to override it.

When you refresh the page for the website the error will be gone (or replaced with an error for the next section that you are not permitted to override)


IIS 8.0 Hosting UK - HostForLIFE.eu :: How to Fix Troubleshoot HTTP 400 Bad Request error on IIS ?

clock November 8, 2019 10:25 by author Peter

There's a J2EE app running on the Tomcat with ISAPI redirector on IIS 8 of Windows Server 2012. Recently the customer got the error related to an AJAX request. At the point when debugging the issue, I figured out that the IIS returns HTTP 400 Bad Request error instead of passing along the url for the Tomcat to handle it.In the IIS log record, there's no record for this appeal nor lapse log not one or the other.

Go to the IIS admin:
Website > Advanced Settings > Limits > Maximum URL Segments: 32
Request Filtering module > Edit Feature Settings:
Maximum URL Length: 4096
Maximum query string: 2048

All is well. The url that makes blunder meets those design since it has recently few segments and the length is around 380 characters - a long ways behind the utmost settings. At that point I attempted to shorten the url a little bit and then a little bit.. and then finally it worked. It seems there's a limit around 300 characters.

Google around to to enable the error log and I found How to troubleshoot HTTP 400 errors. At that point go to  Error logging in HTTP APIs. Download the Enable HTTP API lapse logging  Microsoft Fix it 50634 to introduce it, yet it said the current OS is not matched! In spite of the fact that the direction applies for Windows Server 2012 Standard as the application is running on.
So have to go to regedit and configure the Http.sys registry settings with following parameters:
EnableErrorLogging: Decimal 1
ErrorLogFileTruncateSize: Decimal 10 (MB)
ErrorLoggingDir: C:\inetpub\logs\LogFiles

Then do : net stop HTTP
It will asks you to confirm another services also:
   Windows Remote Management (WS-Management)
   Windows Event Collector
   World Wide Web Publishing Service

Then do: net start HTTP
The HTTP Service service was started successfully.
Check the website, it will stop. Start HTTP again, but it said the HTTP service is already started!
So go to the services manager to start World Wide Web Publishing Service, then Windows Remote Management (WS-Management) and Windows Event Collector

Then test again and see the error log file with a record just shows a very simple error reason: URL. There's a breaking point setting called UrlSegmentMaxLength with 260 characters of course! I felt that brought about the issue in light of the fact that the full url with space name that worked when there's around 300 characters.  So go to regedit and add UrlSegmentMaxLength with 1000 characters value to the HTTP parameters and restart http, w3svc, winrm and wecsvc services again.

I ask why the MS didn't make it for an every particular site like the Maximum URL Segments and effectively to set. In any case we'll need to arrange in the Windows registry that requires to restart entire administrations and influence all sites.

HostForLIFE.eu IIS 8.0 Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.

IIS 8 Hosting Germany - HostForLIFE.eu :: WordPress on Windows Server 2012 with IIS 8 and SQL Server 2012

clock October 18, 2019 11:09 by author Peter

Yesterday I decided to install WordPress for my new blog, both because it seemed like good product for the job and also to get some experience in running it (and thus also PHP) on Windows Server 2012 with IIS 8 Hosting. There are some good resources scattered around the web, but none seemed up to date, so I decided to share my notes from the install on here. I’m assuming you already have Windows Server 2012 and SQL Server 2012 installed.

The configuration of IIS 8 is quite easy: you just enable the Web Server role through Server Manager. Just to be complete, the screenshot below shows the options I currently have installed, but keep in mind that I’m also running ASP.NET on my server.

Yesterday I decided to install WordPress for my new blog, both because it seemed like good product for the job and also to get some experience in running it (and thus also PHP) on Windows Server 2012 with IIS 8. There are some good resources scattered around the web, but none seemed up to date, so I decided to share my notes from the install on here. I’m assuming you already have Windows Server 2012 and SQL Server 2012 installed.

The configuration of IIS 8 is quite easy: you just enable the Web Server role through Server Manager. Just to be complete, the screenshot below shows the options I currently have installed, but keep in mind that I’m also running ASP.NET on my server.I also highly recommend you install PHP Manager (http://phpmanager.codeplex.com/) as it will help us in enabling/disabling PHP extensions from within IIS Manager later on and provides an easy way to access php.ini as well.

To make things easy, you can install and configure PHP quite easily using the Microsoft Web Platform Installer. When you run the Web Platform Installer (Web PI), you can do a quick search for “sql php” and it comes up a few results. When you select “Microsoft Drivers 3.0 for PHP v5.4 for SQL Server in IIS”, which is what we need, all other prerequisites will be automatically installed as well as dependencies (PHP and URL Rewrite for IIS).

After Web PI finishes, you will have PHP installed and configured for use in IIS. Time to do a little test to see if everything is running smoothly. Create a new file under C:\inetpub\wwwroot\ (or wherever your Default Web Site is pointing to) named test.php with the following content:
<?php echo phpinfo(); ?>

This will output information about your PHP configuration.

Time to try it out: navigate to the page (likely http://localhost/test.php). If you are greeted with a screen with purple blocks of information about your PHP configuration, you’re all set and you can skip ahead to the WORDPRESS INSTALLATION section. Chances are you’re going to be greeted with an IIS 403.1 error screen, however, which is due to the fact that the user account that IIS is currently using for the anonymous access to your site doesn’t have the proper privileges to access your wwwroot (or equivalent) folder on disk. This is solved quite easily by granting this user (called IUSR by default) access to the wwwroot folder through Windows Explorer or your other favorite method.

Retry and bask in the glory of the phpinfo() output.


Now we can start downloading the actual WordPress files and start the installation. First off, grab the latest version (or the version of your choice) of WordPress. We will also need the WP Db Abstraction plugin. After downloading, unblock and unZIP both files in a folder under wwwroot (or your Web Site’s location). Installation of the WP Db Abstraction plugin is quite easy, just follow the steps outlined in the readme.txt:Upload wp-db-abstraction.php and the wp-db-abstraction directory to wp-content/mu-plugins. This should be parallel to your regular plugins directory. If the mu-plugins directory does not exist, you must create it.

Put the db.php file from inside the wp-db-abstraction.php directory to wp-content/db.php
Visit $your_wordpress_url/wp-content/mu-plugins/wp-db-abstraction/setup-config.php to generate your wp-config.php file

Before you perform the last step, though, go to IIS Manager and enter PHP Manager (it’s located on the Features page of your server under IIS). Scroll down and click the “Enable or disable an extension” link. You need to make sure that php_pdo_sqlsrv.dll and php_sqlsrv.dll are both enabled. You can also go ahead and disable the *mysql*.dll extensions. Here’s my list of enabled extensions:

Now we can visit the setup-config.php page as outlined above. The steps here are quite straightforward, so I’m not going to walk you through them. You will need to create a user on your SQL Server 2012 installation with SQL Server authentication that has access to a database that you also need to create to use for your WordPress installation.

One note about this process: I had some issues when choosing the default selected “SQL Server using MS PHP driver” and went with the “PDO SqlSrv” option the second time to eliminate these issues.

If the wizard has trouble automatically creating the wp-config.php file, you can either choose to give IUSR write permissions on the folder you created to hold all your WordPress files or you can manually create the file under that folder and paste the output you see on screen in there (I chose the latter). After the wp-config.php file is created, you can start the installation of WordPress by clicking the link on the bottom of the page you’re on.


After the install, which should only take a minute tops, you are now ready to log in to your WordPress admin dashboard and start configuring it how you’d like. As you can see, there’s a sample post and comment already waiting for you. If your experience is anything like mine, you will notice that when you navigate to the Posts -> All Posts option on the top left of your dashboard you won’t actually see these posts in the list. It took some hunting around the web to figure this out, but apparently there’s a line in the translations.php file of the WP Db Abstraction plugin that’s causing this (thanks to tm3ister on http://sourceforge.net/projects/wp-sqlsrv/forums/forum/1124403/topic/5004241 for figuring this out!). The solution is to manually edit the translate_limit function in the mu-plugins/wp-db-abstraction/translations/sqlsrv/translations.php file:


// Check for true offset
if ( (count($limit_matches) == 5  )  && $limit_matches[1] != '0' ) {
    $true_offset = true;
} elseif ( (count($limit_matches) == 5 )  && $limit_matches[1] == '0' ) {
    $limit_matches[1] = $limit_matches[4];


// Check for true offset
if ( (count($limit_matches) == 5  )  && $limit_matches[1] != '0' ) {
    $true_offset = true;
} elseif ( (count($limit_matches) >= 5 )  && $limit_matches[1] == '0' ) {
    $limit_matches[1] = $limit_matches[4];

And voila, your posts will now show up.

The last thing we’re going to configure is Permalinks (or pretty URLs) for our posts. When you navigate to Settings -> Permalinks on the admin dashboard, you’ll see some options to rewrite URLs to be more human and search engine friendly. For now, select Custom Structure and enter /%year%/%monthnum%/%postname%/ in the text field and hit Save Changes. The last step is to create a web.config file in our WordPress folder to rewrite the URLs according to this scheme with IIS URL Rewrite. Create a new web.config file (if you don’t have one already) in the folder you installed WordPress to and copy in the following:

<?xml version="1.0" encoding="utf-8"?>
        <rule name="wordpress" patternSyntax="Wildcard">
          <match url="*" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          <action type="Rewrite" url="index.php"/>

You’re now all set to use WordPress on Windows Server 2012 with IIS 8 and SQL Server 2012!

IIS 8.0 Hosting - HostForLIFE.eu :: DHCP Installation in Windows Server 2016 Using Powershell

clock March 29, 2019 09:24 by author Peter

Now, I want to do the same thing, but this time, using PowerShell. We can easily achieve this with the help of PowerShell and typing a few simple commands.

Before we begin with DHCP installation process, first we need to make sure that it’s not installed in our Server 2016. We can verify this in two ways., which are given below.

  • Using Server Manager.
  • Using PowerShell.

As you can see below, I opened my Server Manager to check (Left side , under Dashboard), if DHCP is already installed, as we can see in the screenshot given below, DHCP Server roles are not installed yet.

Server Manager
Let’s verify this, using PowerShell. All you need to do is, just open your PowerShell and type the command given below.


You can notice in the screenshot given above, install Sate for DHCP says “Available”, which means that it’s available for the installation and it’s not installed yet. Thus, we can continue with our installation process..

To install this DHCP server role using PowerShell, we need to use the command given below.

Install-WindowsFeature -Name ‘DHCP’
After installing this DHCP Server role, type the commands given below to install DHCP Management Tools.

We have successfully installed DHCP Server role and all the required tools to manage it. We can verify this in two ways. We can go back to Server Manager to see, if there is a DHCP Server role, the other way is suing PowerShell…Let’s first verify this, using Server Manager.

Go to —> Server Manager and check for DHCP under Roles and Server Groups (See the screenshot given below.)

We can also verify this using PowerShell, using the command given below.


HostForLIFE.eu IIS 8.0 Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.

IIS 8.0 Hosting - HostForLIFE.eu :: How to Fix PUT/POST/DELETE Verb Errors On Site ?

clock March 13, 2019 09:41 by author Peter

A customer was getting errror when utilizing PUT/POST/DELETE verbs on their web application as of late. The error looks like this:
<h2>405 - HTTP verb used to access this page is not allowed.</h2>

<h3>The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access</h3>

After some troubleshooting the error was disengaged to the way that WebDav was installed on the server and was catching those requests for its own service use.

Instead of removing Webdav from the server, we made a go at searching for an alternate solution. Thankfully somebody on Twitter comprehended the issue and gave an illustration of changes to make to the customer's web.config record with a specific end goal to disable (remove) the Webdav module for simply that particular webpage without requiring any requiring managerial activities on the server.

The code updates to make to your web.config record to intention this error are:
      <remove name="WebDAV" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
      <remove name="WebDAVModule" />

HostForLIFE.eu IIS 8.0 Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.

European IIS 8 Hosting in Cloud - France :: How to Host Your WCF Service in IIS 8?

clock June 11, 2014 10:10 by author Scott

It sounds like it should be trivial: Create a WCF web library and host it in IIS. Surely lots of people need to do this, and it will be easy in a fairly modern version of Visual Studio like 2012? Previously I have created this article about how to host WCF Service in IIS 8, however I will explain more details in this article.

Whatever the reason, I hope this page will offer a useful step-by-step guide to set up a WCF Service Library project to be run from its development folder on Windows 8.0 or Windows 2012, IIS 8.0 – and I have been using VS 2012 and .Net Framework 4.5 as the target.  Also, before I begin, and something of a spoiler alert; you may prefer to publish your website to a specific location, and host it in IIS from there, rather than try and host it from your development folder.  This option is covered after the walk-through below.

Please Make Sure that You Have Integrated your ASP.NET with IIS

The easiest way to check this is to create a minimalistic web application (e.g. ASP.NET MVC with “No Authentication”) and try to host it in IIS (see configuration steps below). If something is missing, make sure that:

  • “Internet Information Services” and “Word Wide Web Services” are enabled in the “Turn Windows Features on or off” dialog.
  • If IIS is up and running, but the ASP.NET integration is missing (you can check the ISAPI filters in IIS Manager), you should run “%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe –i” and hope for the best (maybe restart the machine afterwards).

Take a look at WCF Service

I assume that you have created WCF service called “WCF Service Application”. Hosting this application in IIS means that you create a virtual directory in IIS, where you link the root folder of your project to a URL. You also need to specify an app pool to be used, which should match to the .NET framework you target (e.g. “.NET v4.5”).

If you have configured your.svc files within the specified URL, you should see a page with some positive messages and links to the WSDL contracts. If you see this, then stop reading, you are done.

However, you can receive an error page, “HTTP Error 404.17 – Not Found”, “The requested content appears to be script and will not be served by the static file handler.”. This most probably means that your IIS is not configured to host WCF services (this seems to be the default).

With .NET 3.5, you had to run the “ServiceModelReg.exe” tool, but this doesn’t seem to be necessary anymore for .NET 4.0+ (“aspnet_regiis” does this already). If you look into the details of the IIS settings, you can see some references to WCF.

The only thing you have to do is to enable “HTTP Activation” in the “Turn Windows Features on or off” dialog under the “WCF Services” node. With this, you basically enable the creation of WCF service instances to serve requests coming through HTTP.

Then, please test it again and you wont see any error message anymore.

I hope this article will help you a lot.

IIS 8 Netherlands Hosting - HostForLIFE.eu :: Using Outbound Rewrite Rules to Offload Your Content on IIS 8

clock March 10, 2014 09:06 by author Peter

Recently a colleague of mine wrote an article on setting up a CDN (Content Delivery Network). This made me experiment a bit with some IIS 8 settings. It is possible to set up IIS to rewrite all outgoing requests in such a way that your static content (e.g. images, style-sheets, etc) will be downloaded from a separate location. The main benefit of this method is (in my opinion) that it doesn’t requiren any adjustments on your target site. All it requires is some tweaking of your web.config and ofcourse a working CDN.

Outbound rewrite rules are a pretty powerful thing, when used properly. When used incorrectly, they can slow your site down to a screeching halt. Lucky for us, the outbound rewrite rules can be used to filter out specific requests. In this case we will use them to rewrite all outgoing HTML code. We want to search out all static content (in this example .jpg and .png files) and rewrite it on the fly to be downloaded from a CDN. So, first we want to set the proper precondition. Loads of data leaves a webserver, so let’s make sure we only look at the relevant parts of it. We start by setting up a precondition:


      <preCondition name="CheckHTML"> 

           <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /> 



Now we’re looking at all HTML only it’s time to get even more specific. Outbound rules allow you to filter a tag you want to look for. In this case we assume all images are located in tags. So we can use the following filtering before actually matching it to a pattern:

<rule name="CDN"stopProcessing="false">  
      <match filterByTags="Img" pattern="(https?:\/\/www.(.*)\.(jpg|png))" />  
      <action type="Rewrite" value="http://cdn.{R:2}.{R:3}" />  

Noticed the ugly regex I used there? Let’s take a look at it:


All this baby does is matching all url’s containing .jpg or .png on the end. So basically it makes sure we catch all outgoing image url’s before they reach the browser. This same regex gives us 3 backreferences. We only need two of them: {R:2} and {R:3}. These contain (in my case) the stripped url (no more http://www.) and the extension. We use these later on to rebuild the url for our CDN. You might want to adjust this regular expression to suit your specific needs.

For me: this one is all I need. Now it’s time for rewriting our url. I can use the backreferences that are given to re-assemble the image location to something that should be working on the CDN. How the data gets there is up to you. I’m only pointing out how you can redirect traffic there ;) After your done, the following can be used in your web.config:



          <rule name="CDN" preCondition="CheckHTML" stopProcessing="false"> 

                <match filterByTags="Img" pattern="(https?:\/\/www.(.*)\.(jpg|png))" /> 

                <action type="Rewrite" value="http://cdn.{R:2}.{R:3}" /> 



                <preCondition name="CheckHTML"> 

                     <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /> 





About HostForLIFE.eu

HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2016 Hosting, ASP.NET Core 2.2.1 Hosting, ASP.NET MVC 6 Hosting and SQL 2017 Hosting.

Tag cloud

Sign in