Solved

Setting up new website in IIS7

Posted on 2010-09-21
12
1,465 Views
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.

On IIS7
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:
http://localhost:58618/TestSite/Default.aspx

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?
 
0
Comment
Question by:forsters
  • 7
  • 3
  • 2
12 Comments
 
LVL 17

Accepted Solution

by:
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.
 
0
 

Author Comment

by:forsters
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.
0
 
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?
0
 

Author Comment

by:forsters
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.

0
 
LVL 7

Expert Comment

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

Author Comment

by:forsters
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....

0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 7

Expert Comment

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

Author Comment

by:forsters
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.
screenshot.docx
0
 
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.
0
 

Author Comment

by:forsters
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?

screenshot2.docx
0
 

Author Comment

by:forsters
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 http://forums.iis.net/t/1148262.aspx you can ignore those authentication msgs.

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

Author Closing Comment

by:forsters
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.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

First of all, clustering IIS is something you should rarely consider doing. In almost all cases, Microsoft Network Load Balancing (NLB) (http://technet.microsoft.com/en-us/library/cc758834(WS.10).aspx) is a much better solution when you need to p…
What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now