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.0 Hosting - HostForLIFE.eu :: Publish And Deploy ASP.NET Core MVC On IIS

clock March 5, 2021 08:51 by author Peter

ASP.NET Core is able to run as a standalone Application (out of process Console Application). It does not host inside IIS, which does not require IIS to run an application. ASP.NET Core app has its own self-hosted Web Server and processes the requests, which internally use the self-hosted Server instance. ASP.NET Core uses Kestrel Server to host the core Application but it does not support all the features of the Server such as IIS.

In older ASP.NET Web applications, everything is hosted inside IIS Worker process, which can also refer to an Application pool. The Application Pool hosts our Web Application and our Web Application is instantiated by the built-in ASP.NET hosting features in IIS. The ASP.NET Core Application does not run in the IIS worker process but runs as a separate out of process Console Application, which runs its own Web Server, using Kestrel Web Server. If we run on Windows, we may want to run Kestrel behind IIS to gain infrastructure features such as port forwarding via host headers, life cycle and certificate management.

ASP.NET Core Application is a standalone console Application that is invoked through the "dotnet" runtime command. It does not load into the IIS worker process but loads in the native IIS module called "AspNetCoreModule" which runs the console application. We need to install the AspNetCoreModule on the Server and it is part of ASP.NET Core Server Hosting Bundle.


All IIS applications are run on application pool. For ASP.net core, application pool must set to use No Managed Code. The Application pool acts only as a proxy to forward the requests. There is no need to instantiate a .NET runtime.


The primary job of AspNetCoreModule is to ensure that our Application gets loaded when the first request comes. All incoming Http request are handled by AspNetCoreModule and then it is routed to ASP.NET Core Application. Kestrel picks up the incoming request and passes into ASP.NET Core middleware pipeline that subsequently handles the request and passes to the Application logic, which is the same as the response of the Application which is pushback to the IIS and then Http client.
 
AspNetCoreModule is configured via the web.config file, which is stored in an Application root folder, which contains the startup command and argument. The dotnet is a startup command and our Application main DLL, which is used to launch application as aargument.
 
The Web.config file looks, as shown below.
    <?xml version="1.0" encoding="utf-8"?>  
    <configuration>  
    <system.webServer>  
         <handlers>  
          <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>  
        </handlers>  
        <aspNetCore processPath="dotnet" arguments=".\FirstCoreApplication.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>  
    </system.webServer>  
    </configuration>  


Publishing ASP.NET Core Application
To host our Application on IIS, we first need to publish it. There are two ways to publish .NET Core Application
    Using CLI command dotnet publish.
    Using Visual Studio Publishing feature.

Before publishing ASP.NET Core Application, we make sure that we are including all the required folders in PublishOptions node of project.json file. This node looks, as shown below.
    "publishOptions": {  
      "include": [  
        "Views",  
        "web.config"  
      ]  
    }  


Using CLI command “dotnet publish”
.NET Core Application also supports CLI. Using CLI tool, we can create, build and publish the .NET Core Application. The "dotnet publish" command compiles the Application and publishes the Application with the project dependencies (specified in project.json file) and puts it into a specified folder.

    >dotnet publish  


Using Visual Studio Publishing feature
To publish our application, using Visual Studio, the first step is to right click on the project which we want to to publish and select publish option. Next step is to select custom option and enter the profile name. Once the profile is created, we need to select publishing method. Here, we have four different publishing methods, namely File system, Web deploy, Web deploy pack and FTP. In this example, I have selected File System as publish option and also need to pass target location.
 
In the next step, we can select the configuration, target framework and some other publish option. When we click Publish button, Visual Studio publish requires file in to the selected folder.


Host publish folder on IIS Manually
To host ASP.NET Core Application on IIS, we must have Windows 7 or newer / Windows Server 2008 R2 or newer. To configure IIS on Windows machine, we need to turn on some IIS related features of Windows.

Once our Application is published, we can hook up IIS to the published folder. Now, I am going to create a virtual Application directory.


Now, I am creating ASPNETCore Application with .NET runtime "No Managed Code", as shown earlier.



IIS 8.5 Hosting Europe - HostForLIFE.eu :: How to Fix HTTP Error 503. The service is unavailable in IIS

clock May 20, 2020 08:27 by author Peter

Now, we are going to fix the HTTP Error 503 on IIS. The service is unavailable in IIS 8 is caused if application pool is paused or disabled as shown within the image below:

Steps to resolve HTTP Error 503. The service is unavailable are as follows:
1. First, Open your IIS and then go to Application Pool of the chosen web site. Here in this example the web site name is "test"
2. Choose the application Pool as shown within the picture below:

3. Click on the web site name within the Application Pool and so click on start as shown within the image below:

Browse the web site and the error would be resolved.



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)

 



European IIS 8.5 Hosting – HostForLIFE.eu :: Fix HTTP Error 500.19 – Internal Server Error

clock March 24, 2020 06:46 by author Peter

If you are reading this post you may face Http Error 500.19 error in your IIS 8.5. And in this article I’ll going to show you what I am doing to resolve this problem. I had simple webapi built by Visual Studio 2013, it work good when I run it from Visual Studio 13 but when I copy the project in IIS it give me this error.

Error Message

HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.

Detailed Error Information:

Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x80070021
Config Error 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".
Config File \?\C:\inetpub\wwwroot\APITeslin\web.config

Config Source:

<system.webServer> 
  <handlers> 
    <remove name="ExtensionlessUrlHandler-Integrated-4.0" />

How to Solve HTTP Error 500.19 In IIS 8.5

  1. Got to Server manager
  2. Click Add roles and Features
  3. In the roles section choose web server
    1. Under security sub-section choose everything (I excluded digest,  IP restrictions and URL authorization as we don't use them)
    2. Under Application Development choose .NET Extensibility 4.5, ASP>NET 4.5, both ISAPI entries
  4. In the features section choose: NET 3.5, .NET 4.5, ASP.NET 4.5
  5. In the web server section choose: Web Server (all), Management Tools (IIS Management Console and Management Service), Windows Authentication - if you are using any of it.

Those is step by step how to solve HTTP Error 500.19 - Internal Server Error IIS.



IIS 8.0 Hosting Germany - HostForLIFE.eu :: How to Use LogParser to Check Visitor IPs to a Certain Page?

clock February 21, 2020 10:50 by author Peter

Today I noticed we were getting an expanding measure of spam on one of our sform pages. I was interested to check whether the majority of the client IP locations were the same (in which case I'd simply add them to the IIS IP Restrictions list). To rapidly and effortlessly make sense of this I chose to utilize LogParser.

Other than simply questioning for the page however, I needed to add an extra condition to prohibit lines that originated from a certain  internal IP address that we use for checking.

Here’s a generic version of the query I used:
LogParser.exe -q:on "SELECT * FROM x:\wwwlogs\W3SVC1\u_ex130411.log WHERE cs-uri-stem='/SomePage/' and c-ip<>'10.10.1.100' >c:\temp\PageVisitors.txt"

I needed to see the full logged information for the request, but if I didn’t, I could have very easily just pulled the IP addresses using:
LogParser.exe -q:on "SELECT c-ip FROM x:\wwwlogs\W3SVC1\u_ex130411.log WHERE cs-uri-stem='/SomePage/' and c-ip<>'10.10.1.100' >c:\temp\PageVisitors.txt"

You can see that I'm funneling the outcomes to a content record (the ">c:\temp\PageVisitors.txt" part) so I can without much of a stretch manage the outcomes. You might likewise need to observe that I'm utilizing the "-q:on" flag which runs the command in Quite Mode. In the event that you don't set this banner then LogParser will show comes about one page at once. At the point when funneling to a content record as opposed to the summon prompt window, you clearly can't hit a key for "next page" so without this banner the question will really hang forever if there is more than one page worth of results.

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 7.5 Hosting France - HostForLIFE.eu :: URL Multiple Specific Character Find and Replace on IIS 7.5

clock February 14, 2020 10:07 by author Peter

At this article, I’m going to tell you how search out and replace any “_” (underscore) characters in a URL .htm file name and replace it with “-” (dash). The list I used to be given had file names with up to 7 underscores in any position in IIS 7.5. Example: my_file_name.htm

While I figured this might be a straight-forward task with IIS URL Rewrite, I used to be wrong. At the end I found that I either had to form one rule for every possible underscore count or write a custom rewrite rule. I went the one rule per count route. I scan in one journal you'll only spend to nine variables (). The other a part of the rule was they'd to be only in the “/articles/” directory.

My first challenge was simply to get regular expression in place. What I seen was that the IIS 7.5 UI’s “Test Pattern” utility doesn’t accurately test. Within the test this worked:
Input: http://www.webtest.com/articles/myfilename.htm
Pattern: ^.*\/articles\/(.*)_(.*).htm$
Capture Groups: {R:1} : "my", {R:2} : "test"

However, this doesn’t match in real-world testing. #1, don’t escape “/” (forward-slash). #2 the pattern is only matched against everything after the domain and first slash. So really, only this works:
Input: http://www.test.com/articles/myfilename.htm
Pattern: ^articles/(.*)_(.*).htm$
Capture Groups: {R:1} : "my", {R:2} : "test"


When  order to match against up to 8 underscores, you need 8 rules, each one looking for more underscores. So, Here is the code that I used:
Input: http://www.test.com/articles/myfilename.htm
Pattern: ^articles/(.*)_(.*)_(.*).htm$
Capture Groups: {R:1} : "my", {R:2} : "test", {R:3} : "file"

To do this with efficiency you only edit the web.config in the web root for that website. the end result concluded up being:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="AUSx1" stopProcessing="true">
                    <match url="^articles/(.*)_(.*).htm$" />
                    <action type="Redirect" url="articles/{R:1}-{R:2}.htm" />
                </rule>
                <rule name="AUSx2" stopProcessing="true">
                    <match url="^articles/(.*)_(.*)_(.*).htm$" />
                   <action type="Redirect" url="articles/{R:1}-{R:2}-{R:3}.htm" />
                </rule>
                <rule name="AUSx3" stopProcessing="true">
                    <match url="^articles/(.*)_(.*)_(.*)_(.*).htm$" />
                    <action type="Redirect" url="articles/{R:1}-{R:2}-{R:3}-{R:4}.htm" />
                </rule>
                <rule name="AUSx4" stopProcessing="true">
                    <match url="^articles/(.*)_(.*)_(.*)_(.*)_(.*).htm$" />
                    <action type="Redirect" url="articles/{R:1}-{R:2}-{R:3}-{R:4}-{R:5}.htm" />
                </rule>
                <rule name="AUSx5" stopProcessing="true">
                    <match url="^articles/(.*)_(.*)_(.*)_(.*)_(.*)_(.*).htm$" />
                    <action type="Redirect" url="articles/{R:1}-{R:2}-{R:3}-{R:4}-{R:5}-{R:6}.htm" />
                </rule>
                <rule name="AUSx6" stopProcessing="true">
                    <match url="^articles/(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*).htm$" />
                    <action type="Redirect" url="articles/{R:1}-{R:2}-{R:3}-{R:4}-{R:5}-{R:6}-{R:7}.htm" />
                </rule>
                <rule name="AUSx7" stopProcessing="true">
                    <match url="^articles/(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*).htm$" />
                    <action type="Redirect" url="articles/{R:1}-{R:2}-{R:3}-{R:4}-{R:5}-{R:6}-{R:7}-{R:8}.htm" />
                </rule>
                <rule name="AUSx8" stopProcessing="true">
                    <match url="^articles/(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*)_(.*).htm$" />
                    <action type="Redirect" url="articles/{R:1}-{R:2}-{R:3}-{R:4}-{R:5}-{R:6}-{R:7}-{R:8}-{R:9}.htm" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

In the end this URL:
http://www.yourdomain.com/articles/my_file_foo_bar.htm

Becomes:
http://www.yourdomain.com/articles/my-file-foo-bar.htm



IIS 8.0 Hosting - HostForLIFE.eu :: Enable Other Protocols (TCP, PIPE, MSMQ etc.) In IIS

clock February 7, 2020 11:18 by author Peter

By default it's available only in HTTP, HTTPS and FTP protocols Windows IIS though it supports others like TCP, PIPE protocols as well.

This blog demonstrates how to enable other protocols like TCP in IIS. Getting started, we know that Windows IIS by default supports only HTTP, HTTPS and FTP protocols and you will get those protocols in the binding window of IIS.

But other protocols like TCP, PIPE etc. Can be enabled by changing IIS feature, the below steps defines how to tune IIS features to enable TCP protocols.

Follow the Steps
     Open Control Panel=>Programs=>Click on Uninstall or Change a Program=> Click on Link ‘Turn Windows Features on or off’.

  1. Windows Features window will be opened, expand .NET Framework Advance Service.

  2. Expand WCF Services=>Select All the Features HTTPActivation, Message Queuing (MSMQ) Activation, Named Pipe Activation, TCPActivation, TCP Port Sharing .Click OK button.

Windows will apply the changes you made and you will get message popup, close the window (Clicking on close button), restart your machine and follow the below steps. Open IIS=> in Connections panel=> expand Sites=>Select your website=>Go to Right site Action Pane=> click on Advanced Settings=> Expand the ‘Behavior’ section In the field ‘Enable Protocols’ set these below values by commas, (http,net.tcp,net.pipe,net.msmq,msmq.formatname). Click OK button.

  • For activating TCP protocol set ‘net.tcp’
  • For activating PIPE protocol set ‘net.pipe’
  • For activating MSMQ Protocol set’ net.msmq’

Now you are done, if you follow the above steps correctly, you will get the mentioned protocols in the binding window.



IIS 8.0 Hosting - HostForLIFE.eu :: PUT , POST & DELETE Verbs Not Allowed in IIS 8

clock January 31, 2020 11:42 by author Peter

Today, I will write about PUT, POST and DELETE verbs on the web application in IIS. And this is the error:

<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


After some troubleshooting the error was isolated to the actual fact that WebDav was put in on the server and was intercepting those requests for its own service use.
Rather than removing WebDav from the server, we tend to went searching for another answer. thankfully somebody on Twitter understood the problem and gave an example of changes to create to the client’s web.config get in order to disable (remove) the WebDav module for simply that specific website while not requiring any manual body actions on the server.

The code updates to create to your web.config file to resolve this error are:
<configuration>
  <system.webServer>
    <handlers>
      <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" />
    </handlers>
    <modules>
      <remove name="WebDAVModule" />
    </modules>
  </system.webServer>
</configuration>

I hope this tutorial works for you!

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 7 Hosting - HostForLIFE.eu :: 401.1 error with windows authentication on IIS7 on Windows 7

clock December 20, 2019 11:25 by author Peter

I wanted to test Windows 7, a website with Windows Authentication.

Normally it is sufficient, Windows Authentication in "Programs and Features" / "Windows Features" to activate



and then in the IIS Manager to enable:



When you call the page, however, to my astonishment, I received a popup to enter the user data:



After I entered the credentials three times, I received the following error:



The reason for this is that I've given the site its own host header.

Produces the result that the loopback check, which was introduced with Windows XP SP2 (and apparently also in Windows 7 is used), fails, and the above error message with the Error Code 0xc000006d.

The behavior and the remedy is in
KB896861 described.



European IIS 8 Hosting - HostForLIFE.eu :: Dynamic Compression Issue in IIS 8.5

clock December 6, 2019 11:49 by author Peter

Windows Server 2012 R2 comes with IIS 8.5, and in this release an issue has been found in relation to the Dynamic Compression module.  The module sets the “Vary” header which is used to specify caching properties that the browser uses to determine whether the response should be cached or not. 

In IIS 8.0 and earlier, the Dynamic Compression module was overwriting the Vary header with the value “Accept-Encoding”, and as it happens this is the correct value to ensure that dynamic content is correctly cached – but – according to IIS it should be appending this value to the existing value and not overwriting it.

As it happens, this was supposed to be fixed in IIS 8.5 but the fix appears to be broken.  In IIS 8.5 (which ships with Windows Server 2012 R2) the Vary header is being set to “*” and the “Accept-Encoding” from the Dynamic Compression module is not appended.  The result of this is that no dynamic content is being cached by the browser.

Workaround

Thankfully there is an easy workaround in IIS 8.5 for this:

1. Select an IIS site, and go to Configuration Editor

2. Select system.web/caching/outputCache section, then set the omitVaryStar property to true

Setting this value results in the Vary header being returned with a value of “Accept-Encoding” and the browser then caches the dynamic content.



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