Showing posts with label IIS. Show all posts
Showing posts with label IIS. Show all posts

Wednesday, May 18, 2011

5 Realistic Alternatives to Apache and IIS

Many of these alternative web servers are free to use. Nearly all offer a lightweight, highly scalable server solution. Some even outperform both Apache and IIS in terms of overall speed. The 5 web servers we will be looking at as real alternatives to Apache and IIS are:

Nginx
LiteSpeed
Lighttpd
Hiawatha
Cherokee

Read more: Slodive

Monday, May 16, 2011

Hosting WCF REST Service in IIS with HTTPS

In earlier post I discussed Exposing WCF REST Service over HTTPS. Major limitation on service created in last post was its self-hosted nature. In this post, I will take same service forward and host in IIS. So at the end of this post, you would able to host WCF REST Service in IIS with HTTPS.

Configure IIS
To start with let us first configure a Web Site in IIS

Open IIS
a. Open the command prompt in administrator mode. To do click on Start button then type RUN in search and then in Run window type inetmgr to open IIS.
b. Right click on Sites and then click Add Web Site
c. Now a window will open.
Give any name of your choice as the site name. I am giving name here HostedWcfService
Now in the physical path section, we need to give physical path of the service. So to get the physical path of the service, right click on the WCF Service project in visual studio and click open project in windows explorer. Open the project in windows explorer and from address bar copy the path and paste that below. Or you can browse also. Just click on browse button and navigate to project folder of the WCF Service.
Now at the Binding section select HTTPS. Give any port number. I am leaving default port.

clip_image009_thumb.png?w=463&h=459

Read more: DEBUG MODE……

Wednesday, May 11, 2011

Exposing WCF REST Service over HTTPS

In this post, I will explain; how could we expose a WCF REST Service over secure HTPP (HTTPS)? Essentially there are three steps involved

1. Create a certificate or use a third party provided certificate
2. Configure HTTPS in IIS
3. Configure webHttpBinding to use transport level security


Create Certificate

To expose a service over HTTPS, we need to have a certificate in store. Either you can create your own X.509 certificate or use certificate provided by 3rd parties.
I am going to create my own certificate. To create X.509 certificate Open Inetmgr

clip_image001_thumb4.png?w=431&h=239

In center you will get an option of Server Certificates. Double click on that.

clip_image003_thumb4.jpg?w=563&h=145

Read more: DEBUG MODE……

Sunday, May 08, 2011

Built-in GZip/Deflate Compression on IIS 7.x

IIS 7 improves internal compression functionality dramatically making it much easier than previous versions to take advantage of compression that’s built-in to the Web server. IIS 7 also supports dynamic compression which allows automatic compression of content created in your own applications (ASP.NET or otherwise!). The scheme is based on content-type sniffing and so it works with any kind of Web application framework.
While static compression on IIS 7 is super easy to set up and turned on by default for most text content (text/*, which includes HTML and CSS, as well as for JavaScript, Atom, XAML, XML), setting up dynamic compression is a bit more involved, mostly because the various default compression settings are set in multiple places down the IIS –> ASP.NET hierarchy.
Let’s take a look at each of the two approaches available:

Static Compression 
Compresses static content from the hard disk. IIS can cache this content by compressing the file once and storing the compressed file on disk and serving the compressed alias whenever static content is requested and it hasn’t changed. The overhead for this is minimal and should be aggressively enabled. 

Dynamic Compression 
Works against application generated output from applications like your ASP.NET apps. Unlike static content, dynamic content must be compressed every time a page that requests it regenerates its content. As such dynamic compression has a much bigger impact than static caching.

How Compression is configured

Compression in IIS 7.x  is configured with two .config file elements in the <system.WebServer> space. The elements can be set anywhere in the IIS/ASP.NET configuration pipeline all the way from ApplicationHost.config down to the local web.config file. The following is from the the default setting in ApplicationHost.config (in the %windir%\System32\inetsrv\config forlder) on IIS 7.5 with a couple of small adjustments (added json output and enabled dynamic compression):

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    
    <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
      <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" />
      <dynamicTypes>
        <add mimeType="text/*" enabled="true" />
        <add mimeType="message/*" enabled="true" />
        <add mimeType="application/x-javascript" enabled="true" />
        <add mimeType="application/json" enabled="true" />
        <add mimeType="*/*" enabled="false" />
      </dynamicTypes>
      <staticTypes>
        <add mimeType="text/*" enabled="true" />
        <add mimeType="message/*" enabled="true" />
        <add mimeType="application/x-javascript" enabled="true" />
        <add mimeType="application/atom+xml" enabled="true" />
        <add mimeType="application/xaml+xml" enabled="true" />
        <add mimeType="*/*" enabled="false" />
      </staticTypes>
    </httpCompression>

Read more: Rick Strahl

Thursday, April 28, 2011

IIS Transform Manager 1.0 (Beta)

Overview
IIS Transform Manager 1.0 Beta is an extensible media transform engine that enables "watch folder" job submission, queuing, management, integrated media transcoding/transmuxing, and batch-encryption of on-demand audio and video files. Windows Media-formatted and MP4-formatted files, or other encoder-supported file formats, to on-demand Smooth Streams for delivery to Smooth Streaming-compatible clients (such as Silverlight). Another example is transmuxing Smooth Streaming fragments encoded with H.264 (AVC) video and AAC-LC audio codecs to MPEG-2 Transport Stream (MPEG-2 TS) segments for delivery to Apple® mobile digital devices. Transform Manager can be integrated with the IIS Smooth Streaming feature in IIS Media Services, which delivers the "transformed" content.

Wednesday, April 27, 2011

כיצד לדבג קוד שרץ תחת IIS - צעד אחר צעד

במידה ואתם מריצים קוד ב – Visual Studio זה לא משנה מה בחרתם במאפיינים של הפרויקט האם לעבוד עם ה – server של visual studio או לעבוד מול IIS, תוכלו לדבג את הקוד.
אבל במידה והאפליקציה נמצא ב – IIS והרצתם אותה דרך גלישה בדפדפן ועדיין אתם רוצים לדבג, זה אפשרי בכמה שלבים פשוטים. (לקריאה על Remote Debugging)
ראשית פתחו visual studio. ופתחו את הפרויקט (אם יש לכם אותו – אם אין לכם עדיין אפשר לדבג אם יש לכם את קבצי ה – pdb אבל זה כבר נושא לפוסט אחר)
בחרו ב – Attach to Process (בדרך כלל תחת tools או לחיצה של ctrl + alt + p)
תקבלו את החלון הבא

image_thumb_18EDA4F4.png

Thursday, April 14, 2011

Migrate a Web Site from IIS 6.0 to IIS 7

This quick guide will help you migrate a Web site from IIS 6.0 to IIS 7 by using the Web Deployment Tool.

What kinds of migrations can I accomplish with the Web Deployment Tool?
Migrate 1 or 1,000 Web sites from IIS 6.0 to IIS 7 including all the configuration settings, content and certificates

Migrate a single application 
Migrate an entire server (all Web sites, application pools, etc.) from IIS 6.0 to IIS 7
Migrate a custom manifest comprised of sites, application pools, assemblies, COM objects, registry keys, content and more from IIS 6.0 to IIS 7

Prerequisites
This guide requires the following prerequisites:
.NET Framework 2.0 SP1 or greater
Web Deployment Tool 1.1
Note: If you have not already installed the Web Deployment Tool, see Installing Web Deploy.
Part 1 - View your site's dependencies
1. Get the dependencies of the Web site by running the following command:
msdeploy -verb:getDependencies -source:metakey=lm/w3svc/1
2. Review the output of the dependencies and look for any script maps or installed components in use by the site. For example, if Windows Authentication is in use by the Web site, you will see <dependency name="WindowsAuthentication" />.
3. If your site is inheriting any script maps, these will not be listed in the dependencies and you should also review the script maps for your site manually.
4. Compile a list of the components needed on the destination.
For detailed steps on analyzing the output of getDependencies, see Viewing Dependencies.
Part 2 - Configure the target
1. Review the list of dependencies and install them on the destination server.
For example, let’s assume you had the following in use for your Web site:
Windows Authentication
Anonymous Authentication
Based on this analysis of your dependencies, you would install the corresponding components and modules. 
Part 3 – Migrate your site to the target by using a package file

Read more: IIS

Sunday, April 10, 2011

Virtual Directory vs. Applications–4 IIS Folders-Week 15

Virtual Directories and applications are useful special folder types in IIS.  Yet it’s easy to be confused between them.
Today I cover the differences between vDirs and Applications as I cover the 4 different IIS folder types.

Wednesday, March 30, 2011

Enabling dynamic compression (gzip, deflate) for WCF Data Feeds, OData and other custom services in IIS7

I'm working on a thing that uses an HttpWebRequest to talk to a backend WCF Data Service and it'd be ideal if the traffic was using HTTP Compression (gzip, deflate, etc).

On the client side, it's easy to just add code like this
request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
or more manually

var request = HttpWebRequest.Create("http://foofoo");
request.Headers["Accept"] = "application/json";
request.Headers["Accept-Encoding"] = "gzip, deflate";
However, you need to make sure this is installed and turned on in IIS7 in you server.
Launch your IIS Manager and go to the Compression module.

image_5.png

Read more: Scott Hanselman

Sunday, March 27, 2011

IIS Express Easy Launcher

Project Description
IIS express launcher looks at the directory where it is launched, for a iisexpress.config file, and start iis express with it.
For easy access, can IIS Express Launcher be executed, from the context menu, when used on a directory.
If the IIS Express Launcher cant find an config, it creates it from a standard config, found in iis express install directory.

Read more: Codeplex

Wednesday, March 23, 2011

IIS7 Native API (C++) Starter Kit

Overview
To extend the server, IIS7 provides a new (C++) native core server API, which replaces the ISAPI filter and extension API from previous IIS releases. The new API features object-oriented development with an intuitive object model, provides more control over request processing, and uses simpler design patterns to help you write robust code.

NOTE: The IIS7 native (C++) server API is declared in the Platform SDK httpserv.h header file. You must obtain this SDK and register it with Visual Studio in order to compile this module.

Features
This starter kit is offered to get you started with writing your new C++ HTTP module for IIS7.  In this package, you have the following: 
Readme to assist in setting up your Dev Environment
Walkthrough building a simple sample module

Benefits
For many, using the ISAPI framework was difficult and error-prone after deployment.  In IIS7, this framework is still supported but is replaced by the new native HTTP API documented in the Windows Vista SDK (see httpserv.h) and provides robust extensibility capability for developers.
The new C++ API in IIS7 offers developers the the ability to tie direclty into the native core server using the module built using this starter kit.

Read more: IIS

Monday, March 21, 2011

Enabling IIS Express support in VS 2010 Sp1

With the Sp1 release of Visual Studio 2010 now available for download, you now have the option to use IIS Express as the development server for your web projects instead of the built-in Visual Studio Development server (aka. Cassini). Here are some previous blog posts explaining the IIS Express integration features in VS 2010 Sp1 Beta, which are also available with this new release of Sp1:
VS 2010 SP1 and IIS Express should both be installed to enable IIS Express support
To enable using IIS Express as the development server for your web projects, you need to have both the Sp1 release of VS 2010 as well as the IIS Express web server installed. See the 'Installing VS 2010 Sp1 and IIS Express' section below for details on how to do this.

Sharing projects that use IIS Express in a team environment - Note that the RTM release of VS 2010 does not know about IIS Express, as the feature was added only in Sp1. This means that if you have a project using IIS Express in VS 2010 Sp1 and share that project with a teammate who is still running VS 2010 RTM, then VS 2010 RTM will make an attempt to open the project as if it were an IIS project and probably give you an error similar to “Could not find the server ‘http://localhost:20221’ on the local machine” (assuming that no site with that binding exists in IIS). If everyone on the team is using VS 2010 Sp1, then you will not run into this problem.

If you do have some folks on the team using VS 2010 RTM and others using VS 2010 Sp1, then for Web Application Projects, you can work around the above issue by unchecking the “Apply server settings to all users (store in project file)” checkbox in the Property Pages > Web tab of the WAP. This causes the server selection (Cassini or IIS Express) and related settings to get stored on a per-user basis in the .suo user file rather than in the project file, thus causing the server selection to not persist into source control. This will allow the VS 2010 RTM users on the team to still use Cassini while the VS 2010 Sp1 user can use IIS Express for the same project. For Website Projects, it is necessary that everyone on the team need to be using VS 2010 Sp1 to be able to share projects and use IIS Express.
Installing VS 2010 SP1 and IIS Express:
  • When you install Sp1 from the download page, you should install the IIS Express server separately 
The VS 2010 Sp1 installer, by itself, includes only the tooling in VS to support using IIS Express as the development server. So after installing Sp1, you will see that a new checkbox exists under Tools > Options > Projects and Solutions > Web Projects to use IIS Express for new websites and web projects, but this checkbox is disabled (see figure 1 below). 

Figure 1 – IIS Express needs to be installed for Sp1 tooling to light-up

8524.IISxNotEnabled_5F00_thumb_5F00_5122D684.png

Friday, March 04, 2011

Getting ASP.NET MVC application to work on IIS 6.0

איך להתקין אפליקציית Asp.net MVC על שרת iis 6.0.
שלב 1: התקנת Asp.net Mvc
מכאן אפשר להוריד את ההתקנה ל – Asp.net MVC 2. יש להוריד את הקובץ AspNetMVC2_VS2008.exe
לאחר ההורדה יש לחלץ את ההתקנה.
פתח Cmd, גש לתיקיה שבה נמצאת ההורדה וכתוב את הפקודה הבאה:
AspNetMVC2_VS2008 /x   
נפתח חלון להכנסת שם התיקייה, ולאחר הזנת השם נוצרת תיקייה חדשה בשם שנתת, מתוך התיקייה שנוצרה תחת המחיצה של mvcruntime יש את הקובץ aspnetmvc2.msi אותו יש להתקין על השרת.
clip_image002_thumb_2B5750DD.jpg
שלב 2: wildcard
כדי שאפליקציית mvc תעבוד צריך להגדיר על ה – VirtualDirectory מיפוי כך שהלינקים באפליקציה שאין להם סיומת aspx  יעבדו.
תחת ה – properties ב – VirtualDirectory יש לבדוק שהגירסה של asp.net היא 4.0.
image_thumb_6790FD5D.png

Read more: Dovi Perla's Blog

Thursday, March 03, 2011

Internet Information Services (IIS) 7.5 Express

Overview
IIS 7.5 Express enhances your ability to develop and test web applications on Windows by combining the power of IIS 7.5 with the convenience of a lightweight web server like the ASP.NET Development Server (also known as Cassini). IIS 7.5 Express is included withMicrosoft WebMatrix, an integrated suite of tools designed to make developing web applications on Windows simple and seamless. IIS 7.5 Express can also be used with Visual Studio 2010 as a powerful alternative to Cassini. The benefits of using IIS 7.5 Express include:

  • The same web server that runs on your production server is now available on your development computer.
  • Most tasks can be done without the need for administrative privileges.
  • IIS 7.5 Express runs on Windows XP and all later versions of Windows.
  • Many users can work independently on the same computer.
This package installs only IIS 7.5 Express. For an integrated development experience, also install Microsoft WebMatrix or Visual Studio 2010.

Read more: MS Download

IIS & Hosting Videos for ASP.NET MVC Developers (25)

Monday, February 28, 2011

How much traffic does your website create with each request? Use IISExpress 7.5 to find out.

If you are currently using Cassini (the Visual Studio Development Web Server) – you will definitely want to switch to  IIS Express 7.5 because it is more aligned (feature wise) with IIS. Much has been written about IIS Express 7.5. The one feature I want to focus on here is IIS Express’ command prompt interface. Compliments of WebMatrix, IIS Express 7.5 has a nice GUI admin tool. What if however, you want to monitor traffic as part of your development activities. Sure, we can log that activity. But what if you want to see it real time. This is an area where IIS Express 7.5 shines.

Once IIS Express is installed, you will find it in Program Files (x86)\IIS Express. The configuration files can be found in Documents\IISExpress\config. The file you will be interested in is applicationhost.config. There is a lot going on with this XML configuration file. To get up and running, you can ignore most of it. The one section you will be interested in is <sites>. In VS 2010 SP 1, we will have the ability to configure IIS Express 7.5 within the IDE. For those that have not installed SP 1, getting up and running with IIS Express is actually quite simple.

By default, there is one site setup for you already:

1: <site name="WebSite1" id="1" serverAutoStart="true">
 2:     <application path="/">
 3:         <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
 4:     </application>
 5:     <bindings>
 6:         <binding protocol="http" bindingInformation=":8080:localhost" />
 7:     </bindings>
 8: </site>
To demonstrate, let’s setup NerdDinner to run under IIS Express. All we need to do is add an entry to applicationhost.config:
 1: <site name="NerdDinner" id="2" serverAutoStart="true">
 2:    <application path="/">
 3:       <virtualDirectory path="/" physicalPath="C:\NerdDinner" />
 4:    </application>
 5:    <bindings>
 6:       <binding protocol="http" bindingInformation=":50799:localhost" />
 7:    </bindings>
 8: </site>

Two requirements: 1 – the site name has to be unique. 2 – the id also has to be unique. Once you supply those two items, you need to specify the port. In the Project Properties Dialog, select the Web Tab. Make sure the Specific Port Option is selected. You can specify a port # or use the one that VS assigned. All you need to do is specify that port # in the bindingInformation attribute.

Read more: Los Techies

Tuesday, February 15, 2011

Check out a 'Query Analyzer/SSMS' for Log Parser called Log Parser Lizard

As any incident responder will agree, you can never have too many logs. That is, of course, until you have to analyze them! I was recently on an engagement where our team had to review hundreds of gigabytes of logs looking for evidence of hacking activity. I was quickly reminded of how much I love Microsoft Log Parser.

Log Parser is often misunderstood and underestimated. It could possibly be the best forensic analysis tool every devised. Imagine having the ability to take almost any chunk of data and quickly search it using SQL-based grammar. That's Log Parser in a nutshell. It is a lightweight SQL-based search engine that operates on a staggering number of different input types (see Figure 1). Yes, I know that tools like Splunk and Sawmill are built around this same idea, but keep in mind that Log Parser was written in the year 2000. I am constantly amazed at the power it affords the forensic analyst, and you can't beat the price (free). Save perhaps memory analysis, there isn't much it can't accomplish for an incident responder.

Read more: Greg's Cool [Insert Clever Name] of the Day
Read more: Computer Forensics How-To: Microsoft Log Parser

Internet Explorer Administration Kit 9 Release Candidate

The Internet Explorer Administration Kit (IEAK) 9 simplifies the creation, deployment and management of customized Internet Explorer 9 packages. IEAK 9 can be used to configure the out-of-box Internet Explorer 9 experience or to manage user settings after Internet Explorer 9 deployment.

Read more: MS Download

Tuesday, February 01, 2011

IIS 6: Setting up SSL - Overview

Many years ago I wrote a series of instructions that used dozens of screenshots in order to show my coworkers how to set up and enable Secure Sockets Layer (SSL) communications in IIS 5, which I eventually turned into a blog series on one of my personal blog sites. A few years later I wrote a sequel to that series of instructions for my coworkers, and I wanted to turn that into a series of walkthroughs in the IIS.net website. Sometime ago I proposed the idea to Pete Harris, who was in charge of IIS.net at the time, but then I changed jobs and we scrapped the idea. We followed up on the idea a short time ago, but we just couldn't find a place where it made sense to host it on IIS.net, so Pete suggested that I turn it into another blog series. With that in mind, over a series of several blog entries I will show how to configure SSL on IIS 6.

Note: This first post will leverage a lot of the content from the overview that I wrote for my IIS 5 blog series, but subsequent posts will reflect the changes in IIS 6.
Much like IIS 5, setting up SSL on IIS 6 is pretty simple. SSL is a Public Key/Private Key technology, and setting up SSL is essentially obtaining a Public Key from a trusted organization. The basic process for working with SSL is reduced to the following actions:

  1. Creating a Certificate Request
  2. Obtaining a Certificate from a Certificate Authority
  3. Installing the Certificate
While not necessary, installing certificate services on your computer is helpful when troubleshooting SSL issues, and I'll discuss that later in this blog series.
Creating a Certificate Request
This is a series of steps that need to be performed on the web server, and they differ widely depending on the server and version. A web administrator is required to enter information about their organization, their locality, etc. This information will be used to validate the requester.

Obtaining a Certificate from a Certificate Authority

This is when a web administrator submits their request for a certificate to a Certificate Authority (CA), which is a trusted organization like VeriSign or Thawte. For a list of trusted organizations, see the following section in Internet Explorer.

Sunday, January 30, 2011

Understanding IIS Bindings

Internet Information Services (IIS) uses 4 decision points for the site bindings.  They are the protocol, port, IP and host header.  This video lesson walks through the bindings and shows how each one is used.
This is part 5 of a 52 week series on various topics for the Web Administrator.
Other weeks include:

Read more: Scott Forsyth's Blog