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 Hosting Europe - HostForLIFE :: IIS Physical Path VS Virtual Path

clock June 11, 2026 09:08 by author Peter

Let's start by getting a summary of both.

Physical route
This is the path that IIS actually finds the file.

The virtual route
When a file is pointed to from outside the IIS application folder, this is the logical route to access it.
Let's use a virtual directory in the IIS default website to display this image from the hard drive "E:."

Add Virtual Directory

 

Here, we need to provide an alias for the physical path.

Physical Path - E:\Files
Virtual Path - http://localhost/Files/
File Name - image_60140ec0-ce46-4dbf-a14f-4210eab7f42c.png
Full Path - http://localhost/Files/image_60140ec0-ce46-4dbf-a14f-4210eab7f42c.png

Let’s enable the Directory Browsing.

By default, this is disabled for security reasons.


Here, we can see the files of the folder that is in E Drive. Click on the file name. It will load the file which is in the outer part of IIS application folder. Thanks, hope this will help.



IIS Hosting Europe - HostForLIFE :: Details of Log Parser Usage for IIS Logs

clock June 3, 2026 07:56 by author Peter

We can parse many kinds of logs with the aid of Log Parser Studio. The primary focus of this course will be on parsing IIS logs. There are two types of Log Parser software: one that just uses the command prompt and the other that supports a graphical user interface.

Installation
Kindly find the link for Log Parser Studio.
Below is the sample query for Log Parser with GUI to get the output from IIS logs for a URL and other data like [MAX, MIN, AVG] – Response Time in mili seconds and hits.
SELECT cs-uri-stem as URL,
MAX(time-taken) As Max,
MIN(time-taken) As Min,
Avg(time-taken) As Average,
Count(1) as Hits
FROM '[LOGFILEPATH]'
GROUP BY URL
ORDER BY Average DESC

Below is the sample query to run in Log Parser with the command prompt version.
Logparser -i: iisw3c “ SELECT cs-uri-stem as URL,
MAX(time-taken) As Max,
MIN(time-taken) As Min,
Avg(time-taken) As Average,
Count(1) as Hits from D:\test.log GROUP By URL ORDER BY Average DESC TO D:\result.csv” –o : csv


Usage details Log parser studio
The landing screen of Log Parser Studio is given below.

As we are interested in parsing IIS logs, so select IIS-Top25 slow URLs.

The query with all the details will be shown to the user.

Now, we need to choose the IIS logs file. Click the Choose log files icon.

The dialog box with the options will be shown, where we have to select the individual log files or the folder. Now, we need to click the icon to execute an active query.


Below is the screenshot of Log Parser Studio with the results. The data for Max, Min, and Average refers to Response Time in mili seconds. We can copy data or export the data, as required.




IIS Hosting Europe - HostForLIFE :: Install Internet Information Services (IIS) on a Windows server

clock March 6, 2026 07:16 by author Peter

You may host and manage websites and web applications with the aid of Internet Information Services (IIS), a web server function in Windows Server. It is a solid option for handling and providing web content because it is compatible with several web technologies and offers features for growth, performance, and security.

Internet Information Services (IIS): What is it?
Microsoft's Internet Information Services (IIS) web server software is compatible with Windows Server. Websites, web apps, and other online services can be hosted and managed with its assistance. IIS is adaptable to diverse kinds of web content since it works with a variety of web technologies, including HTML, ASP.NET, and PHP. It provides security, speed, and growth capabilities to help you efficiently set up and manage your web environment. You can efficiently manage applications, provide web pages, and manage internet traffic with IIS.

Internet Information Services (IIS) deployment

Step 1. Open the Server Manager.
Step 2. Click on "Manage".
Step 3. Then select "Add Roles and Features".

Step 4. On the "Before you begin" screen, click "Next."

Step 5. Choose "Role-based or feature-based installation"
Step 6. And then click "Next."

Step 7. Choose the appropriate server from the server pool.
Step 8. And then click "Next".

Step 9. Select the server role "Web Server (IIS)."
Step 10. If a box appears asking to add required features, click "Add Features."
Step 11. And then click "Next."

Step 12. Select the features screen, you can choose extra features if you need them, and then Click "Next".

Step 13. Web Server Role (IIS)" screen, review the information about IIS and click "Next".

Step 14. Select role services, anything you want to install, and Make sure to select important services.

Step 15. Then Click "Next"

When setting up the IIS (Internet Information Services) web server role, there are some important services you need to choose to make sure the web server works properly.

Web Server: Common HTTP Features
    Static Content
    Default Document
    Directory Browsing
    HTTP Errors
    HTTP Redirection (if needed)
Application Development
    ASP.NET (for .NET applications)
    .NET Extensibility
    ISAPI Extensions
    ISAPI Filters
Management Tools
    IIS Management Console
    IIS Management Scripts and Tools
    Management Service (for remote management)
Performance
    Static Content Compression
    Dynamic Content Compression
Security
    Request Filtering
    Windows Authentication (if needed)
    Basic Authentication (if needed)
    URL Authorization

Step 16. Review and click "Install".

Step 17. After installation is finished, click "Close".

Verify the IIS server role Installation

  • open a web browser and enter http://localhost.
  • confirming that IIS is running.


IIS Hosting Europe - HostForLIFE :: Uploading a Big File to ASP.NET or IIS

clock January 23, 2026 08:43 by author Peter

When we upload a large file in asp.net using file upload control we got an error.so how to over come this ? The Default size of Asp.Net is 4MB. Code In Web.Config put this code.

    <system.web>  
       <httpRuntime maxRequestLength="1048576" executionTimeout="600" />  
    </system.web>  
    <system.webServer>  
       <security>  
          <requestFiltering><requestLimits maxAllowedContentLength="3000000000" /></requestFiltering>  
       </security>  
    </system.webServer>  


The below code maxRequestLength measured in kilobytes.Here is an example with a 1GB request length and a 10 minute request timeout:
    <httpRuntime maxRequestLength="1048576" executionTimeout="600" />  

 The below code maxAllowedContentLength measured in bytes. 
    <requestLimits maxAllowedContentLength="3000000000" />  



IIS Hosting Europe - HostForLIFE :: Fixing "Plugin IISBinding Was Unable To Generate A Target" Error

clock December 11, 2025 07:46 by author Peter

This post teaches how to fix a message: 
"ERROR: Plugin IISBinding was unable to generate a target" while enabling the SSL Certificate for your website

So, let us start.
Open IIS - Internet Information Services (IIS).

Select "Default Web Site" and click on "Bindings...."

Edit "HTTP" host to put your websitURLrl.

Insert your website URL and press "OK".

Continue the process as the original POST recommends.

Conclusion
This IISBinding error appeared to me when I moved the website from a Server to another before enabling my HTTPS certification. This solution worked for me pretty awesomely. 



IIS Hosting UK - HostForLIFE.eu :: How to Fix Default Document in Web.config using IIS?

clock December 11, 2025 07:09 by author Peter

A default document is the file that a web server displays when you browse to a folder without specifying a file name.


This is syntax:

<system.webServer>
    <defaultDocument>
      <files>
        <clear />
        <add value="Path of your Page" />
      </files>
    </defaultDocument>
</system.webServer>


Using IIS 7 you can set default document in Web.Config in easy way. Suppose i have to set CommingSoon.aspx page as default page then we should do like this in system.webserver tag.
<configuration>
<system.webServer>
<defaultDocument>
<files>
<add value="CommingSoon.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>


When IIS gets this new default document it adds with parent or global list of default documents.

To remove an individual default document from the list.
<files> 
<remove value="CommingSoon.aspx" /> 
</files>


To remove a default document entry from the inherited or parent list of default documents, do something like this: 
<files> 
<clear/> 
<add value="CommingSoon.aspx" /> 
</files>




IIS Hosting UK - HostForLIFE.eu :: ASP.NET Session State: Maintaining Information After IIS Restarts

clock November 26, 2025 08:14 by author Peter

You must store session data outside of the normal in-memory session state in ASP.NET in order to maintain the user session even after an IIS restart.

1. Use SQL Server Session State
The best approach to persist session data even after an IIS reset is to store it in an SQL Server database.

Steps to Configure SQL Server Session State
1. Enable SQL Server session state in Web.config
<configuration>
    <system.web>
        <sessionState mode="SQLServer"
                      sqlConnectionString="Data Source=your_server;Initial Catalog=ASPState;Integrated Security=True"
                      cookieless="false"
                      timeout="60" />
    </system.web>
</configuration>

2. Run the SQL Server Session State Setup Script
EXEC aspnet_regsql.exe -S YourSQLServer -E -ssadd -sstype p

The session will persist even after an IIS restart.

2. Use State Server Mode (Out-of-Process Session)

If you prefer not to use SQL Server, you can configure a separate session state service.

Steps to Configure

1. Enable State Server in Web.config
<configuration>
    <system.web>
        <sessionState
            mode="StateServer"
            stateConnectionString="tcpip=127.0.0.1:42424"
            cookieless="false"
            timeout="60" />
    </system.web>
</configuration>

2. Start ASP.NET State Service
Open Run (Win + R) → Type services.msc → Find ASP.NET State Service → Start it.

The session will persist after an IIS restart but will be lost if the State Server service is stopped.

3. Use a Distributed Cache (Redis)
If you have multiple servers, using Redis for session storage is an excellent option.
Steps to Configure Redis Session State

1. Install Redis Session Provider via NuGet
Install-Package Microsoft.Web.RedisSessionStateProvider

2. Update Web.config

<configuration>
    <system.web>
        <sessionState mode="Custom" customProvider="RedisSessionProvider">
            <providers>
                <add name="RedisSessionProvider"
                     type="Microsoft.Web.Redis.RedisSessionStateProvider"
                     host="your_redis_server"
                     port="6379"
                     accessKey="your_redis_key"
                     ssl="false"/>
            </providers>
        </sessionState>
    </system.web>
</configuration>


Sessions will persist even if IIS restarts and it works well in cloud environments.

Which Method Should You Use?

Method Session Persistence Performance Best For
SQL Server ✅ Survives IIS Restart ⚡ Medium Multiple IIS servers
State Server ✅ Survives IIS Restart ⚡ Faster than SQL Single-server applications
Redis ✅ Survives IIS Restart 🚀 Fastest Cloud & distributed apps

Final Recommendation

  • If you are running a single-server app, use State Server.
  • If you are using multiple IIS servers, go with SQL Server Session State.
  • If you need a high-performance, scalable solution, use Redis.


IIS Hosting UK - HostForLIFE.eu :: Virtual Directory Within an IIS ASP.NET Core Application

clock October 31, 2025 09:11 by author Peter

Using virtual folders inside of an ASP.NET Core application in IIS may be a challenge for ASP.NET developers switching to work with ASP.NET Core. The web root ([content-root]/wwwroot) is typically where public, static resources like CSS, JavaScript, and image files are kept. Everything will function properly in this scenario, and there shouldn't be any issues. The configuration of middleware, which permits the serving of static files within Startup, is the only addition you must make to your code. Set up.

    public void Configure(IApplicationBuilder app)  
    {  
       app.UseStaticFiles();  
    }  


But, when you need to keep your files in any other folder outside the web root or even outside the application, like somewhere on your drive or file share, you may face the folder access problem.

To reveal the reason, it is important to understand some nuances of ASP.NET Core. ASP.NET Core ships with the next server implementations,

    Kestrel is the default cross-platform HTTP server for ASP.NET Core.
    HTTP.sys is a Windows-only HTTP server based on the HTTP.sys kernel driver and HTTP Server API.

So, ASP.NET Core actually does not require IIS to run; instead of this, cross-platform Kestrel Web Server or HTTP.sys can be used, which is a Windows-only alternative to Kestrel. The most popular among them is Kestrel. However, despite the fact that it’s fast, cross-platform and has been optimized for throughput performance, it does not provide all features as a full-featured Web service (like IIS) provides no port sharing, easy SSL configuration and so on. Some of these features may appear in the future, but today Kestrel is normally used with a reverse proxy server, such as IIS, Nginx, or Apache. IIS is more often than not used on the Windows machines.

In ASP.NET, developers are able to use a virtual directory within IIS website for storing static resources in the directory outside of the application. Unfortunately, with ASP.NET Core, this solution doesn’t work. A virtual directory in IIS won’t be recognized and users will see a 404 error. Kestrel runs beneath IIS (using the HttpPlatformHandler module) and IIS brokers only the requests to it, so Kestrel does not know about virtual directories from IIS.

In case you just use the folder outside the web root, without authorization, e.g. when you just need to access a usual folder on the drive, the only one thing you should do is to configure the Static File Middleware, as it is shown below:

    public void Configure(IApplicationBuilder app)   
    {  
        app.UseStaticFiles(); // For the wwwroot folder  
        app.UseStaticFiles(new StaticFileOptions   
        {  
            FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "StaticFiles")),  
                RequestPath = "/StaticFiles"  
        }); //For the needed folder  
    }  

In the code above, the “StaticFiles” directory hierarchy is exposed publicly via the StaticFiles URI segment. A request to http://<server_address>/StaticFiles/images/image1.png will return image1.png file.

This case is very simple, but in the most common scenarios, you would never use a folder, which is publicly available. For example, the Static File Middleware will throw errors if you use a shared drive because the system does not have access to it. The most proper solution is to serve files through a controller action, returning a FileResult with correct authentication.

There are two common ways to resolve the problem with authentication, both are for Windows. The one way to access this folder is to run the webserver's AppPool as the identity that can access the share. This way is safer because the credentials are stored securely in the IIS config (rather than in code or in config files). For this, you just need to create a local user on both machines and ensure they both have the same name and password. You can also use Active Directory Domain Account, just make sure, that you correctly type in the name and domain. So, the full instruction is as follows,

  • On your IIS machine, create a user and set a password.
  • On your network share machine, create a user with the same name and password as in step 1.
  • Give permission to a shared folder to this user.
  • In IIS Manager, select the application pool that your web app uses or create a new one if you use the default one.
  • Click on “Advanced Settings” in the right Actions bar. Under Process Model, click on the “Identity” value and select “Custom account”.
  • Click on the “Edit” and enter user name and password from step 1. If you enter all information correctly, the pop-up will be closed successfully without any error messages.
  • After that stop your Web Site.
  • Back again to your application pool and click on the “Recycle”.
  • Start your Web Site.

After that, you easily access the files in this folder as if they were on the web root.

If it is not important to you where to keep passwords and usernames (for any reason), you can store them in your code or, as a better way, in the config file, and use a WNetAddConnection2 function. This solution does not require identical users on the servers, the WNetAddConnection2 function makes a connection to a network resource and can redirect a local device to the network resource. The basic syntax is,
    DWORD WNetAddConnection2A(  
    LPNETRESOURCEA lpNetResource,  
    LPCSTR lpPassword,  
    LPCSTR lpUserName,  
    DWORD dwFlags  
    );   


Where lpNetResource is a pointer to a NETRESOURCE structure that specifies details of the connection:

  • the type of network resource to connect to;
  • a pointer to a null-terminated string that specifies the name of a local device to redirect;
  • a pointer to a null-terminated string that specifies the network resource to connect to;
  • a pointer to a null-terminated string that specifies the network provider to connect to.

The lpPassword is a string that represents a password to make the network connection.

The lpUserName is a string that represents a username to make the connection.

The dwFlags is a set of connection options, e.g. remembering connection, the interaction between the operating system and user, saving credentials by the credential manager and so on.

If the function succeeds, the return value is NO_ERROR, otherwise, the return value can be one of the error codes or one of the system error codes, a list of which can be found in the detailed Microsoft specification: "WNetAddConnection2A function".

Which method should be used depends on your project needs and environment. The first approach is more preferable for security reasons, in particular when you develop a website for a customer, who prefers to keep the ability to change the username and password without any changes in the code and this approach also is the easiest and fastest one for development. The second method can be more useful if you want to mount the shared folder to your local drive. The second method has been described in general terms. Still, this information can be helpful for developers, who migrate existing ASP.NET application into ASP.NET Core and want to understand the reason why the virtual folders do not work and what to do.



IIS Hosting UK - HostForLIFE.eu :: The Entry ‘DefaultConnection’ Has Already Been Added

clock September 19, 2025 10:20 by author Peter

Recently, we were facing this error while deploying the asp.net solution into the server (IIS) as a separate application (Sub Domain) in a main web application.


Scenario
I created a website (say site mymainsite) in window server IIS under a port and then added an another application ( plugin ) under a root-site (mymainsite ) as shown,

After deploying the solution, when I opened the site, I got this error. Oops!!!
 
“The entry ‘DefaultConnection’ has already been added. (C:..\web.config line ..)”
 
With some research, I found that it was conflicting with the parent site connection provider. There was a same connection name (DefaultConection) in the parent site.
 
If you have another project using the same connection string name you will receive this error because that connection string has already been added to the collection.
 
Solution
We can fix this by updating the web.config file.
<remove name="DefaultConnection" />
 
Add the above tag with connection string name just above the connection key.
 
Alternatively, you can clear all connection string adding below tag.
<clear />
 
Cheers!!



IIS Hosting UK - HostForLIFE.eu :: Enable IIS Server to Serve .mp4 Files through web.config File

clock September 4, 2025 10:00 by author Peter

These days, the majority of websites are created with HTML5 and backdrop videos. Using the video tag is a simple task. Although using a CDN is recommended for serving video files, you must set up IIS to serve.mp4 files if you wish to host videos from your own server. A 404 error or an error stating that "The page you are requesting cannot be served because of the extension configuration" may appear if you don't configure it. 

If the page is a script, add a handler. If the file should be downloaded, add a MIME map.” Again, if you have got access to IIS , it’s a great thing but what if you’re hosting the website on a shared server where you don’t have access to IIS Server? In this post, we will see how can we enable IIS Server to serve .mp4 files through web.config file.

To allow IIS to server files, we need to configure proper mimeType for the required files. The mimeType for a .mp4 is video/mp4. Just add the following line in your web.config file under system.webServer tag and you should be good to go.

    <configuration>  
        <system .webServer>  
            <staticcontent>  
                <mimemap fileExtension=".mp4" mimeType="video/mp4"></mimemap>  
            </staticcontent>  
        </system>  
    </configuration>  


Once you do the above changes, your web server should start serving .mp4 files without issues. Hope this blog post helps you! In case you know other ways of doing the same, do let me know via comments.



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