Posted by: joachimvandenbogaert | June 4, 2009

Deploying WCF on IIS 6.0 with Certificates, NHibernate and Membership

Get a server that allows you to run .NET 3.5

In most cases you will get a Windows Server that is configured with .NET 3.0, so you will first have to install .NET 3.5 on it in order to use WCF. This is not so difficult, but you need to have the right configuration. From 3.0. .NET 3.5 does not install automatically. You have to make sure that you have Windows Installer 4.5 installed, which you can find here http://www.microsoft.com/DOWNLOADS/details.aspx?displaylang=en&FamilyID=5a58b56f-60b6-4412-95b9-54d056d6f9f4

.NET 3.5 can (redistributable package) be found here http://download.microsoft.com/download/6/0/f/60fc5854-3cb8-4892-b6db-bd4f42510f28/dotnetfx35.exe

Configure ASP.NET and WCF for IIS 6.0

Next, open a command line window and go to the Microsoft.NET directory (typically C:\Windows\Microsoft.Net\Framework or C:\Windows\Microsoft.Net\Framework64).

  • Go to the v2.0.50727 dir and run aspnet_regiis -i
  • Go to the v3.0\Windows Communication Foundation dir and run ServiceModelReg -i
  • Make sure that ASP.NET 2 Web Service extensions are allowed, otherwise you will get a 404 error when opening an svc file.  In the IIS management console, click [Web Server Extensions] and make sure that ASP.NET v2.0.507272 is set to [Allowed]

 

2009_06_11_IIS6andWCF

 

Configure the host header in order to publish the correct host on the svc web page: open the IIS management console, right-click your website, select [Properties] and on the [Web Site] tab click the [Advanced …] button.

Web Site Properties

Web Site Properties

This brings up a new dialog. Click the ip-address for wgich you want to change the identification from localhost to the web site’s ip-address and click the [Edit …] button.

Advanced Web Site Identification

Advanced Web Site Identification

Now you can edit the [Host Header value] field. Click [OK] to accept the changes.

Edit Web Site Identification

Edit Web Site Identification

Configuring Postgres to allow your website to access your databases

If you followed the described procedure, you change your website’s id for some applications from “localhost” to whichever ip-address you are using. It took me some time to figure out what was going on, but apparently Postgres complains about access rights, not configured in pg_hba.conf. So if you want to do this, make sure you add an entry in pg_hba.conf, for example:

host all all 192.168.1.1/32 password

this will allow the host with the IP-address 192.168.1.1 to access postgres using password credentials.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: