Setup Multiple Websites in Windows 7 and IIS

15. October 2010 19:34

I had a need to setup multiple websites in Windows 7. I needed it so I could basically do the following on my local machine

http://website1
http://website2
http://website3

This way I could replicate how it would be on the production servers these sites were on. Now most of the time I don't do this. Usually I just create site after site under the Default website location.

Another note I did was I made different application pools for each individual website.

so here are the steps I took. If you want to skip the rest of this post and you are having problems...make sure to edit your host file! I always forget this for some reason.

Anyway here we go.

First step is to add a new website to IIS.  One important note here is I chose to set the connection to use my local credentials instead of network service.  To accomplish this, click on the "Connect As" button and enter in your username and password your login into your computer with.

At this point a new application pool was created for your website. As you can see the framework is set to 2.0 by default. Switch this if you would like to 4.0. Another note, you may need to switch the Identity the application pool runs under. For example, you may need to switch it to run under the Network Service.

NOTE: You may need to give the account the application pool is running under and the Anonymouse IIS Account access to your directory where the website is located.

OK the next step is to edit your HOST file on your local machine.

Browse to the following directory on your machine (assuming the OS was installed on C:\)

C:\Windows\System32\drivers\etc

First make a copy of the current hosts file in the directory so you have a backup.

Next you are going to want to add the entry of your new website host name. In the case of this example "Website1"

 

Next you may want to logoff or reboot and now you should be able to browse to http://Website1 and be good to go.

Good luck!

 

Tags:

IIS

.docx not working in web page for users

14. April 2008 22:01
I ran into the problem the other day with uploading a Microsoft Office 2007 document to a web server and it not being able to serve it or allow the user to view it.  Then it hit me...IIS 6.0 probably doesn't know what the new Office 2007 file extensions are.  This is an easy problem to solve.  You just need to add the new MimeMaps to IIS 6.0.  The new maps are as follows:

.xlsx  application/vnd.openxmlformats-officedocument.spreadsheetml.sheet  
.xltx  application/vnd.openxmlformats-officedocument.spreadsheetml.template  
.potx  application/vnd.openxmlformats-officedocument.presentationml.template  
.ppsx  application/vnd.openxmlformats-officedocument.presentationml.slideshow  
.pptx  application/vnd.openxmlformats-officedocument.presentationml.presentation  
.sldx  application/vnd.openxmlformats-officedocument.presentationml.slide  
.docx  application/vnd.openxmlformats-officedocument.wordprocessingml.document  
.dotx  application/vnd.openxmlformats-officedocument.wordprocessingml.template  
.xlam  application/vnd.ms-excel.addin.macroEnabled.12  
.xlsb  application/vnd.ms-excel.sheet.binary.macroEnabled.12  


These maps came from the following MS KB article:

http://support.microsoft.com/kb/936496

To add the new Mime Maps you can do the following:

Open up IIS Manager
Right click the web server and go to Properties
Click MIME Types button
Click New
Add the extension and MIME Type and click OK

For example to add the .docx you would enter in .docx for the Extension and then add in application/vnd.openxmlformats-officedocument.wordprocessingml.document for the MIME Type.

This should take care of it. You shouldn't have to restart IIS either.  I did this on the fly.

Tags: ,

IIS




My Random Thought

I think the OCW is a great thing to have available to those who are in school, just finished school or just want to educate themself

http://ocwconsortium.org/

John On Twitter

Discounts