ssl redirects in IIS7 using 403.4 error pages with response 302

IIS7 adds the ability to use a 302 redirect response as a "Customer Error Page" instead of actually making a file with a html refresh or asp response.redirect. This is much easier to manage when you are doing redirects on several websites.

1. Select the website your are working with in IIS7, and make sure you are in the Feature View.

2. Double click "SSL Settings" and check Require SSL and click Apply.

3. Go back into the Feature View and open "Error Pages"

4. Click on Add and configure the following:

Status code: 403.4
Click on Respond with a 302 redirect and provide the https redirect URL.

*** NOTE HERE *** I had problems with redirection with some clients. I believe https://mysite.thisdomain.com and https://mysite.thisdomain.com/index.asp have different results in some web browser configurations. Changing all my redirection URLs to https://mysite.thisdomain.com/index.asp seemed to correct my problems.

ssh/sftp for Windows 2008 Server using CopSSH

Somehow Microsoft missed the boat again. SSH/SFTP is still not included in Windows Server 2008. Only FTP is included with the same functionality that existed in 2003.

CopSSH allows us to add this much needed functionality to a Windows server, or workstation. These instructions assume you are familiar with vim.

On the server we will use:
CopSSH http://www.itefix.no/i2/download
Runas (built in) http://technet.microsoft.com/en-us/library/cc781769.aspx
gVim for Windows http://www.vim.org/download.php#pc

On the client to test:
Putty http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
WinSCP http://winscp.net/eng/download.php

1) Install gvim
2) Install CopSSH using all the defaults.
It will install to "c:\Program Files\copSSH\" There you will find an etc directory that should look familiar if your a BSD/linux user.
3) Open a command prompt (start run > cmd)
4) Use the runas command to launch gvim as an administrator.
runas /user:domain\username "c:\program files\vim\vim72\gvim.exe"

5) In gvim open the sshd_config file located in "c:\program files\copssh\etc"
6) uncomment and configure the following:
Port 22
Protocol 2,1
AddressFamily any
ListenAddress 10.10.11.60
PidFile /var/run/sshd.pid

Save the file.

Openssh SSHD service ( start > run services.msc )


8) Configure the Windows Firewall to allow internal connections on port 22.
Right click on inbound rules, select new rule, Port, TCP, 22, Allow the connection, Domain Private and Public. Give it a proper name and description.

Now everything is setup to work, but you have no users configured. Users should be created locally on the server, and then activated using Start > Programs > COPSSH > Activate a user. This writes a line to the etc/passwd file. You can edit this using runas and gvim. If you want to give the user access to files that exist outside of the copssh folder, use /cygdrive/Drive letter/path . As an example the D:\webs folder would be written as /cygdrive/d/webs .

Make sure you grant the user NTFS permissions to the folder. Use NTFS permissions to permit or deny them movement around the file system.

You can test SSH using putty, and sftp using WinSCP.

Server Side Includes for HTML in IIS7

By default in .html and .htm files #include virtual does not work in IIS7. I was unable to find the answer quickly on google so I figured I should document it here.

Enable Server Side Includes for IIS7

Control Panel > Programs and Features > Turn Windows Features On or Off to add the component

Now open IIS7 and in features view go to Handler Mappings



Under actions select "Add Module Mapping"

Enter the following information:

Request Path: *.html
Module: ServerSideIncludeModule
Executable: blank
Name: SSI-html

Click Ok and now your includes should function properly.

« 1 2 3 4 5 6 7 8 9 10 11 12 »