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

European IIS 7 Hosting - HostForLIFE.eu :: How to Easily Create Multiple 301 Redirects with a URL Rewrite Map

clock November 6, 2014 08:33 by author Frank

Redesigning a website or creating a new version of an existing web page is a common task for web developers and webmasters. If you have an established web site with good search engine traffic it’s critical to be able to redirect that search traffic from the old pages to the new pages even if the name of the page or the page location changes. Even if that content is great and plenty of people have linked to your page/s, all your hard work won’t matter if search engines like Google are unaware of the new location or people are trying to link to the old, non-existent, page location.

The way to properly communicate these changes to search engines is to use a 301 Redirect which tells search engines the new permanent location of the content.

Using 301 redirects used to be a manual process where you had to place code in the old page using Javascript in the page body or add a special metatag like this:

<meta http-equiv=”refresh” content=”0;url=http://www.domain.com/newpage.html”>

As you can imagine, this can be a tedious and time consuming task if you have several of pages to update. One additional downside to the old manual redirects option is performance. The old page still has to be accessed in order for the redirection to take effect.

URL Rewrite Module with IIS7

Now there’s an easier solution, and one that offers better performance.  Starting with IIS 7 one can implement different kinds of url rewriting and redirecting with ease by using the URL Rewrite Module. The various rules can be configured using the IIS 7 Manager GUI or by directly editing the web.config. To open the URL Rewrite Module simply double click the URL Rewrite icon on your site properties as shown below.


From there you will be able to maintain your existing rules or add new ones as seen in this picture.

 

This is a pretty easy way to create server-side rules for rewriting and redirecting, but what happens when you have 30 or 40 legacy URLs that need to be redirected to new pages? Do you have to enter each one manually? Of course not. The solution to that is to use a URL Rewrite Map.

URL Rewrite MAP

By using a URL Rewrite Map it has never been easier to create and maintain multiple 301 redirects for different pages on your web site.  The rewrite rules are stored in the <system.webServer> section of your web.config so you can quickly make changes as needed.

Here is all the code you need to accomplish this:

<system.webServer>
  <rewrite>
<rewriteMaps>
  <rewriteMap name=”Redirects”>
<add key=”/test.aspx” value=”/test2.aspx” />
<add key=”/aboutus.aspx” value=”/about” />
  </rewriteMap>
</rewriteMaps>
  <rules>
<rule name=”Redirect rule1 for Redirects”>
  <match url=”.*” />
  <conditions>
<add input=”{Redirects:{REQUEST_URI}}” pattern=”(.+)” />
  </conditions>
  <action type=”Redirect” url=”{C:1}” appendQueryString=”false” />
</rule>
  </rules>
</rewrite>
</system.webServer>

In the example above I’m performing a 301 redirect on the test.aspx file to test2.aspx file. There’s also a 301 redirect for the aboutus.aspx file to folder called /about, however, in this case it’s important to note that the /about folder will also need a default page or else a 404 error will result.

As you add more URLs to your Rewrite Map you’ll notice that your web.config can become a bit cluttered. The solution to this will be to store the redirect rules in an external file. Let’s call this file myrewritemaps.config. This file will now contain this code block:

<rewriteMaps>
  <rewriteMap name=”Redirects”>
<add key=”/test.aspx” value=”/test2.aspx” />
<add key=”/aboutus.aspx” value=”/about” />
  </rewriteMap>
 </rewriteMaps>

In your web.config you add the following line of code under the <rewrite> section referencing the external config file:

<rewriteMaps configSource=”myrewritemaps.config” />

Your web.config will now look nice and clean like this:

<system.webServer>
  <rewrite>
<rewriteMaps configSource=”myrewritemaps.config” />  
<rules>
  <rule name=”Redirect rule1 for Redirects”>
<match url=”.*” />
<conditions>
  <add input=”{Redirects:{REQUEST_URI}}” pattern=”(.+)” />
</conditions>
<action type=”Redirect” url=”{C:1}” appendQueryString=”false” />
  </rule>
</rules>  

  </rewrite>
</system.webServer>

Here is a 3rd party site which offers a free test to ensure your 301 redirect rules are working:

http://www.ragepank.com/redirect-check/

There is no real limit on how many URLs can be configured for redirecting with the URL Rewrite Map.  You should perform regular search engine analysis to see when the new URLs have been picked up. Once the old URL is no longer indexed and traffic has dropped off you could remove it from your map.



IIS 7.5 Hosting - HostForLIFE.eu :: Application Pool Idle Time-out Settings on IIS

clock October 23, 2014 09:48 by author Peter

Whether you host in-house or with a managed Windows hosting provider, if you self-administer a web server it's sensible to understand that by default IIS 7.5 sets application pools to “time-out” when twenty minutes of inactivity. therefore if you don’t have a visitor to your website within twenty minutes the application pool can shut down those system resources. Then the next time a request comes into the site IIS7 can automatically restart the application pool and serve the requested pages.

This is an excellent way to preserve resources since each running application pool will place a certain quantity of overhead on the system. But, it conjointly implies that the primary request – the one that causes the application pool to restart – is incredibly slow. it's slow as a result of the method literally must begin, then load the desired assemblies (like .NET) then load the requested pages. betting on the size and complexity of your application, this would possibly simply be a couple of seconds or it'd take 30+ seconds (during which time a user would possible quit and move on to a different site).

If you wish to increase the length of the time-out setting, simply change it from the default of twenty to however several minutes you wish. you can also modify the setting to zero (zero) which effectively disables the timeout so the application pool can never shut down due to being idle.

To make this change, open Server Manager; Expand the Roles node; Expand the web Server (IIS) node. Then click on the web Server (IIS) node; Expand the node along with your local server name; and click on the application Pools icon. You’ll then see a list of the application pools that are defined on your server. within the right-hand pane you’ll see an option for Advanced Settings -> click that.

Once you see the Advanced Settings dialog box simply look for the Idle Time-out (minutes) property; click wherever the default “20″ is, and change it to no matter value you prefer.

This is only 1 of the many settings that may impact the performance, uptime, and functioning of your web site. If you don’t have the time or interest in learning and maintaining the various settings for a secure high-performing web server, you would possibly need to consider a totally managed windows hosting solution and let a trained and experienced administrator take care of the work for you.



European IIS 8 Hosting - How to solve Could not load type ‘System.ServiceModel.Activation.HttpModule’

clock December 10, 2013 04:55 by author Patrick

Do you ever encountered an error if you deploying WebSocket server application which targeted .NET 4.5 to Windows Server 2012 plus IIS 8? Yes, it was an exception shown in browser whenever tried to open a web page. The exception said:


This problem is: the default configuration in applicationHost.config (in C:\Windows\System32\inetsrv\config) declared two conflicted modules and two conflicted handlers:


As we know, applicationHost.config contains the root settings for all web sites and web applications on the server. Therefore, any web application would have all the four conflicted modules and handlers loaded by default. “ServiceModel” and “svc-Integrated” were for .NET Activation 3.x while “ServiceModel-4.0” and “svc-Integrated-4.0” were for .NET Activation 4.x. Unfortunately, the 3.x items were declared before the 4.x items. That was why the exception occurred for a .NET 4.x web application!

Then how did such a situation happen? On Windows Server 2008, it could happen when you install .NET 3.x framework or IIS 7.5 with Activation features after .NET framework 4.x is installed. However, on Windows Server 2012, it always happens when you install .NET framework 3.x with Activation features.



Microsoft officially announced the solution (http://support.microsoft.com/kb/2015129) for Windows Server 2008 plus IIS 7.5: manually running “aspnet_regiis.exe /iru” for .NET framework 4.x (in C:\Windows\Microsoft.NET\Framework\v4.0.30319 or C:\Windows\Microsoft.NET\Framework64\v4.0.30319). However, aspnet_regiis.exe is not allowed to run for IIS 8.

The final solution was to delete the 3.x module and handler from IIS manager. You could delete them at the application or site level if you want to keep them in applicationHost.config. But if you wanted to delete them from applicationHost.config. So you should did the following steps:

1.      In IIS manager, click the machine name node.

2.      In “Features View”, double-click “Modules”.

3.      Find “ServiceModel” and remove it.

4.      Go back to the machine name node’s “Features View”, double-click “Handler Mappings”.

5.      Find “svc-Integrated” and remove it.

Now everything works well.



SSL Installation issue on Windows 2008r2: How to Fix a “CertEnroll::CX509Enrollment::p_InstallResponse: ASN1” Certificate Private Key Error

clock September 18, 2013 08:17 by author Ronny

This error means that the private key does not match the public key (the .crt file).  The keypair is not successfully joined into a working SSL certificate.

 

Here solution to resolve this error

1. (Start button -> RUN -> Type : MMC)

2. Choose Tab “File”

3. Add/Remove Snap-ins -> certificates and click “Add >”.

4. Select “Computer account” and Finish. OK

 

5. Personal > Certificates >  right-click and select All Tasks > select Import > guide to the .crt file.)

6. Double-click the crt certificate file you just imported -> select the Details tab, scroll all the way down to Thumbprint and highlight Thumbprint.

7. In the lower pane, block and copy all the letters of the thumbprint.  Paste the thumbprint characters into notepad.  Open the command prompt and run this command: Certutil /?

8. The command you’ll want to run is:

certutil -repairstore my “{PASTE THE CODE }”

9. When you see “CertUtil: -repairstore command completed successfully” the private key will be associated with the .CRT file in the personal store. The certificate should show up in IIS 7.5 under Server Certificates.

10. Now you should be able to assign the SSL certificate to the appropriate website(s).



European IIS 7.5 Hosting - Amsterdam :: Using New IIS Services (Chapter 2)

clock September 9, 2013 08:14 by author Ronny

This is a continuation of my previous post titled Installing IIS 7.5, A number of Web services that were previously available as separate downloads are now integrated into IIS in Windows Server 2008 R2, as described in the following sections .

Using IIS WebDaV

Web-based Distributed Authoring and Versioning (WebDAV) is an IIS extension, now implemented as a role service called WebDAV Publishing, which expands the capabilities of the Hypertext Transfer Protocol (HTTP) by making it possible for administrators and users to publish documents on Web sites simply by copying them to a mapped network drive.  After installing the role service, you create an authoring rule that specifies what content you want to be able to publish and which users can publish it, using the interface shown. Then, using a feature called the WebDAV redirector on the client computer, you map a drive to your Web site.  Copying files to that drive automatically publishes them on the Web site.

The WebDAV implementation in Windows Server 2008 R2 is fully integrated into the IIS 7 .5 architecture, and supports the following features:

  • Standard compliance - The WebDAV implementation in IIS 7 .5 is fully compliant with the Request for Comment (RFC) 4918 standard published by the Internet Engineering Task Force (IETF) .
  • Site-level support - Unlike earlier versions, you can now enable WebDAV publishing at the site level, instead of on the entire server .
  • Support for HTTP over SSl - This enables clients to publish documents securely by encrypting transmissions using the Secure Sockets Layer (SSL) protocol .
  • Supports for locks - The WebDAV in IIS 7 .5 supports both shared and exclusive locks to prevent lost updates due to overwrites .
  • Per-URl authoring rules - This enables administrators to specify WebDAV security settings for individual Uniform Resource Locators (URLs) .  This provides the ability to create different sets of security parameters for standard HTTP requests and WebDAV authoring .

Using Ftp Server

File Transfer Protocol (FTP) is one of the early protocols in the Transmission Control Protocol/Internet Protocol (TCP/IP) suite .  It was created at a time when security was not as great a concern as it is now, and as a result, it has no built-in data protection of any kind .  Clients transmit passwords in clear text, and transfer files to and from servers in unencrypted form .  Windows Server 2008 R2, however, has an FTP server implementation that is enhanced with better security measures and other new features .

The FTP Publishing Service role service included in the Windows Server 2008 release is a holdover from Windows Server 2003.  It requires you to install the old IIS 6 .0 version of the management console because it is not compatible with the new IIS 7 .0 architecture.  Soon afterward, however, Microsoft released, as a free download, a new FTP Publishing Service that was compatible with IIS 7.0.  Administrators could create and manage FTP sites using the current Internet Information Services (IIS) Manager console, and the service also included new features, such as the following:

  • FTP over Secure Sockets layer (SSl)  - Enables the FTP server to establish secure connections using password protection and SSL data encryption.
  • Combined FTP and Web hosting - Enables a single IIS site to support both HTTP and FTP connections.
  • Virtual host naming - Enables a single IIS server to host multiple FTP sites using a single IP address and port number, distinguishing between the sites by using host names, just as it can with Web sites.
  • Improved logging and error handling - IIS log files include additional fields for FTP connections, and IIS can generate detailed error messages for clients on the local network.

Now, in Windows Server 2008 R2, Microsoft has fully incorporated that FTP Publishing Service into IIS 7.5, so there is no need for a special download and no need to install an outdated management console.  They have also included an additional role service, FTP Extensibility, which enables developers to use their own managed code to create customized authentication, authorization, logging, and home directory providers.



European IIS 7.5 Hosting - Amsterdam :: Installing IIS 7.5 (Chapter 1)

clock September 5, 2013 13:09 by author Ronny

Windows Server 2008, Microsoft introduced Internet Information Services (IIS) 7 .0, a major architectural update to its Web and application server platform .  Since then, as anticipated, the IIS development team has been working on a variety of enhancements and extensions that build on that new architecture .  Now, in Windows Server 2008 R2, Microsoft introduces IIS 7 .5 .  Although based on the same basic structure as IIS 7 .0, this new version includes numerous new features and refinements .  This chapter lists the new features in IIS 7 .5 and explains how they enhance the capabilities of the Web and ap- plication server platform .

Installing IIS 7.5

The Web Server (IIS) role in Windows Server 2008 R2 is only slightly different in appearance from that in Windows Server 2008.  When you select the role in the Add Roles Wizard, the Add Features Required For Web Server (IIS) dialog box does not appear and prompt you to install the Windows Process Activation Service (WPAS) feature, as it didin Windows Server 2008. That dependency is still there, however. Even when you don’t explicitly install WPAS, IIS 7.5 starts the service as needed.

IIS 7.5 also adds three new role services, as follows:

WebDAV Publishing, Enables users to publish content to IIS Web sites inter-actively and securely. For more information, see the section “Using IIS WebDAV,” later in this chapter.

FTP Server, Enables users to transfer files to and from an IIS server and perform basic file management tasks.

IIS Hostable Web Core, Enables developers to integrate IIS request handling functionality into their own applications .

WebDAV Publishing and FTP Server were both add-on products for IIS 7 .0 that administra- tors had to download and install separately. Now, in Windows Server 2008 R2, they are both fully integrated into the Web Server (IIS) role, and you can install them as part of IIS 7.5.

Using Microsoft Web platform Installer

Although Windows Server 2008 R2 administrators can still install IIS and create Web sites in the traditional manner, using the Server Manager and Internet Information Services (IIS ) Manager consoles, Microsoft now provides another way. The Microsoft Web Platform is an integrated set of servers and tools that enable you to deploy complete Web solutions, includ- ing applications and ancillary servers, with a single procedure. The Microsoft Web Platform Installer is a tool that enables you to select, download, install, and configure the features you want to deploy on your Web server.

The Web Platform Installer file you download is a stub, a tiny file that enables you to select the modules you want to install and then to download them, using the interface shown in Figure 7-1. Unlike the Web Server (IIS) role in Windows Server 2008 R2, the Web Platform Installer enables you to download other servers and applications that are produced by Microsoft and third parties. The installer provides a selection of collaboration, e-commerce, portal, and blog applications, and enforces the dependencies between the various elements. If, for example, you select an application that requires a database, the installer will download and install SQL Server Express 2008, Microsoft’s free SQL database product.

During the installation process, Web Platform Installer prompts you for information needed by your selected applications, such as what subdirectory to install them into, what passwords to use, and so on. When the process is complete, you have a fully functional Web site, complete with IIS and applications and ready to use .

Using the IIS Web Deployment tool

The Web Deployment Tool (formerly called MS Deploy) is an IIS extension that enables administrators to package entire Web sites, Web servers, and applications for deployment on other computers, or just for backup purposes.  Packages include all of a site’s content, includ- ing configuration settings, permissions, databases, and certificates.

When you run the Web Deployment Tool offline, it adds a Manage Packages section to the Actions pane of the Internet Information Services (IIS) Manager console.

Selecting a server, site, or application and clicking Export Application launches a wizard in which you can select the elements that you want to export.  The wizard then creates a package in the form of a Zip file, which contains the original content plus configuration settings in Extensible Markup Language (XML) format

The package file now contains a complete copy of the server, site, or application you selected. You can save the package file to function as a backup or an archive of the site’s current configuration, or copy it to another IIS server running the Web Deployment Tool and import it. The tool also includes a Remote Agent Service, which administrators can use to synchronize Web servers in real time over a network connection. This enables you to replicate sites and servers on a regular basis so that you can create Web farms for load balancing and fault tolerance purposes



European IIS 7 Hosting :: How to Fix - Server Error in ‘/’ Application on IIS 7 (allowDefinition=’MachineToApplication’)

clock January 26, 2012 05:35 by author Scott

This is the error message that sometimes you can find on IIS:

Server Error in ‘/’ Application.


Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.

I will gonna show you how to fix this issue. What is the issue?

1. When you create an new web application using visual studio.net, it automatically creates the virtual directory and configures it as an application. However, if you manually create the virtual directory and it is not configured as an application, then you will not be able to browse the application and may get the above error. The debug information you get as mentioned above, is applicable to this scenario.

To resolve it, Right Click on the virtual directory - select properties and then click on "Create" next to the "Application" Label and the textbox. It will automatically create the "application" using the virtual directory's name. Now the application can be accessed.

2. When you have sub-directories in your application, you can have web.config file for the sub-directory. However, there are certain properties which cannot be set in the web.config of the sub-directory such as authentication, session state (you may see that the error message shows the line number where the
authentication or sessionstate is declared in the web.config of the sub-directory). The reason is, these settings cannot be overridden at the sub-directory level unless the sub-directory is also configured as an application (as mentioned in the above point).

Mostly we have the practice of adding web.config in the sub-directory if we want to protect access to the sub-directory files (say, the directory is admin and we wish to protect the admin pages from unathorized users).

But actually, this can be achieved in the web.config at the application's root level itself, by specifing the location path tags and authorization, as follows:-

<location path="Admin">
<system.web>
<authorization>
<allow roles="administrators" />
<deny users="*" />
</authorization>
</system.web>
</location>


However, if you wish to have a web.config at the sub-directory level and protect the sub-directory, you can just specify the Authorization mode as follows:-

<configuration>
<system.web>
<authorization>
<allow roles="administrators" />
<deny users="*" />
</authorization>
</system.web>
</configuration>


Thus you can protect the sub-directory from unauthorized access.



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