Setting up new website in IIS7

Posted on 2010-09-21
Last Modified: 2012-05-10
Hi all,

I need some help setting up  a new site on IIS7.

Using Visual Studio 2010 I've created a new ASP.NET web site in .NET Framework 4 C#,
I pointed the site to a local folder called "Test"
I made no changes to the default files.

I created a Folder "Test" on a drive e$ and then used the IIS Manager to "Add New Web Site"
I called the site "Test"
mapped it to my folder "Test" on e$
and under bindings I left the port unchanged,
kept the All Unassigned for the IP
and set the host header to testsite

I returned to VS2010 and used the build website command to publish the default files to my "Test" folder on e$ on the webserver.

Returned to IIS7 to check the folder and noted the files had been published successfully.

If I use f5 from VS I see the default.aspx page without problem but I assume from the url that I am viewing it on the VS built in host:

Because I am new to VS (just to complicate things) I also opened the site in Dreamweaver and used f12 to publish the "Default.aspx" page from there, at which point I get the standard 404 error:
The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Default.aspx

So the url in this case is http://testsite/Default.aspx 

I can't figure out what I'm missing / doing wrong, I just want to be able to view the live page hosted on the web server.

can anyone advise?
Question by:forsters
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
  • 2
LVL 17

Accepted Solution

Andres Perales earned 500 total points
ID: 33733497
Typically URL's will be the http://machinename/ for default website
Try that you should see the IIS 7 Logo.
Also check the Default Document list to see if default.aspx is there, if not you will want to add it to the list!  So you do not have to type out http://machinename/default.aspx every time you try to hit your website.

Author Comment

ID: 33736144
Hi peralesa,

Thanks for your comments.

Yes the default website is as you suggest http://servername/ and I can see the IIS7 logo both from browsing on the server itself and by browsing on my pc.

I checked the Default Document list as suggested, default.aspx is there...I've moved it to the top of the list to apparently improve performance - no change

The other thing I notice is using the feature in IIS manager to browse the site (by right-clicking, manage site, browse) I get a site http:testsite/ but its not mine!

If I change my host header name the page I get changes, but these are not my pages.

If I switch my Test site to Content view and right-click browse on the Default.aspx file rather than the site root I go back to the HTTP 404 error.

This is on the server nothing is found by browsing from my PC.

If I browse http://testsite/ from my pc I get a 403 Forbidden error
If I browse http://testsite/default.aspx I get the 404 error  

Any further help greatly appreciated.
LVL 17

Assisted Solution

by:Andres Perales
Andres Perales earned 500 total points
ID: 33736999
You mentioned host headers, do you have that name in DNS or at least in your host file?
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.


Author Comment

ID: 33742554
yes my host file has the name testsite in it hmm but you saying that has just made me think...

new server = new IP address (I had automatically just put in the old IP)

Have amended IP to resolve but now get "Error 500 Internal server Error" if I browse from my PC.

Obviously no change on the server if I browse the site.

I don't recall ever adding a site name to DNS - presume though if we host all our sites on one/two servers its the servers that are added to the DNS in which case I need to speak to my colleague.

Maybe a step closer to resolving, thanks for your help if you can offer anymore guidance greatly appreciate the help.


Expert Comment

by:Utkarsh Kulkarni
ID: 33743294
You need to access the website as http://<machinName>/Test/Default.aspx

Author Comment

ID: 33743849
hi astroutkarsh

We tried this already using both the machine name and its ip address in the url both bring up 404 errors if I just use the site root, if I use the full address including default.aspx then we get 500 error.

If I put http://machinename/ that brings up the default IIS7 site without problem.

This suggests to me the problem is not the connection to the server its to do with the set up of my testsite on IIS7, or we've missed something when installing IIS7 on the server....


Expert Comment

by:Utkarsh Kulkarni
ID: 33744043
What OS you are using ?
Can you post screen-shot of IIS where you configured the site ?

Author Comment

ID: 33744268
OS = Windows 2007.

Screen shot attached, I set the site up in IIS Manager; the Default app Pool is set to .NET 4.0 which is the framework that was used in VS to create the site.
LVL 17

Expert Comment

by:Andres Perales
ID: 33745091
Since this site is running some scripts, based on the 500 error.  Right click the site and convert to application.

Author Comment

ID: 33745730
Hi thanks,

we gave that a go and I noticed as I set the application up that when I tested the connection I got an authentication error, I now note I get the same error if I rebuild the site and test the settings so could this be the problem?

(see attached for screen shot)

Any ideas what the cause is?


Author Comment

ID: 33753183
Thanks to all who helped on this, we have now located the problem:

In IIS Manager when viewing the features the .NET Compilation was not viewable, the error read Unrecognised expression 'folderLevelBuildProviders' in web.config.

The web.config in question lives on the server %windir%\Microsoft.NET\Framework64\v4.0.30319\config\web.config.

The fix was to run aspnet_regiis.exe /iru from the command prompt window making sure to use the relevant Framework and version (in our case running .NET 4.0 on a 64bit machine)...
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe /iru
did the trick; the .NET Compilation tab subsequently opened without error.

The authentication error mentioned above seems now to be a red-herring:

I did follow one suggestion to add the servername$ to permissions and share the file but have since discovered that the site can now be browsed regardless and that as ultimately suggested here you can ignore those authentication msgs.

Hope this helps others setting up with IIs7 for the first time.

Author Closing Comment

ID: 33768110
The question kinda evolved as we tried different things but definite thanks to peralesa for helping me to identify the root of the problem, my final comment indicates what this was and the fix we used.

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Debug Tools to analyse IIS process: This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage. To take dumps,download the following. Install1: To st…
Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question