Windows Server 2008 R2 + IIS 7.5 - Resource cannot be found - asp.net

I have migrated our company web apps from Windows Server 2003 to Windows Server 2008 R2. The are all .Net 2.0 classic web apps. They all seem to work fine, except when accessing any resource with a path starting with /Reports/...
In one app the physical path on disk is c:\Websites\app_name\WebService\Reports... In this reports folder PDF files are dynamically generated and written to disk. They can be accessed via a URL such as this:
http://domain_name/Reports/xxxx.pdf
where /Reports is a virtual directory mapping to the physical path above. This worked fine on 2003 server & IIS6 but on IIS7.5 & 2008 R2 I keep getting the following 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: /Reports/xxxx.pdf
I have another web app that generates the reports dynamically and streams them directly to the client browser for saving to the local disk, rather than being written to disk on the server. Similar to the above example, the page that generates the report is found under path as follows:
/Reports/Viewer.aspx
In this case there is no virtual directory being used. The URL referenced in the browser is:
http://another_domain_name//Reports/Viewer.aspx
Once again I get the same error message as above... HTTP 404 - The resource cannot be found.
I have tried all the permission settings under the sun to try and get it working but to no avail. I've use built in accounts, created new accounts with permissions from very minimal right up to full admin rights. I've also played with the new AppPool Identities with no success. It doesn't seem to matter what permissions I set specifically on the directories, or the accounts configured for the app pool or basic settings on each website itself.
Once thing I have discovered though, is that whilst the browser is getting the HTTP 404 error, there is no record of this request appearing in the IIS log files for each website!! This is really confusing me, as I would definitely expect to see a failed 404 log entry on the requested resource.
Something else to note, I'm running SQL Server 2008 Enterprise on this machine with Reporting services installed and enabled. It's a stretch, but could there be some contention over the /Reports path in my websites vs something else running on the machine? I'm using different bindings/host headers for each individual domain and website running on the server.

Check Reports folder conflict. And remember, Google is faster than SO.

IIS gives 404 errors for more than just File Not Found these days - so it doesn't give away too much to attackers. Have a look at the event log (application), and also try accessing it from the server itself.
The other thing to check is that your IIS app pools are correctly configured - especially with the correct pipeline mode and .NET framework version.

At a command prompt, type:
netsh http show urlacl
See if there are any bindings with /reports/ --maybe a left over from a SQL Server Reporting Services install?
v/r
BK

Related

HTTP Error 500.19 - Internal Server Error 0x80070003 Cannot read configuration file

I'm getting the above error when I publish my application and move it from development to production server. Below are the error details.
Detailed Error Information
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x80070003
Config Error Cannot read configuration file
Config File \?\C:\inetpub\wwwroot\WorkmenCompTest\web.config
Requested URL http://localhost:80/wictest
Physical Path C:\inetpub\wwwroot\WorkmenCompTest
Logon Method Not yet determined
Logon User Not yet determined
This website used to work previously but recently the published version stopped working due to this error. As far as I can tell, the only change was installing iTextSharp and iTextSharp xmlworker through nuget.
I have tried, without success:
giving modify permission on the site folder to Everyone
checking the web.config file, and using an older version of the web.config file (from when the site worked).
uninstalling iTextSharp and iTextSharp XMLWorker
The project still runs without issue from Visual Studio.
This is solved. The error was caused by the folder name not matching the path for the virtual directory. Oh wow I feel dumb.
Check the applicationhost.config file under - .vs\lpsWeb-UI\config folder of your application root.
Under sites section of the config file check what the physical path points to.
If you modify those you should be able to fix the issue.
This is because of different physical path in the IIS.To change the physical path of application content
You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files directly, or by writing WMI scripts.
User Interface
To use the UI
Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).
In the Connections pane, expand the Sites node and click to select the site in which your application runs.
In the Actions pane, click View Applications.
On the Applications feature page, select an application from the list and then click Basic Settings in the Actions pane.
In the Physical path box, change the path of the application content.
Click OK.
DefaultAppPool application pool runs under the Network Service account. This account is local to the computer and this account does not exist on another computer. Make sure that you configure the DefaultAppPool application pool to use an account that is a domain user. Then, you can use the same account on the WorkmenComp file server. Alternatively, you can create a workgroup account on the WorkmenComp file server.
I am getting this HTTP Error 500.19 error when I am giving physical path as Z:\App_Live in IIS
Instead of using z:\ ,
I used network path \\server\share\live_folder in the IIS physical path – something like this \\server\share\wwwroot\inetpub\wwwroot
Also you may need to specify username/password in "connect as".

IIS7 Website Configuration [Server Error 500.19]

I created a Windows Server 2008 virtual box with IIS7. I have two websites configured, one is my actual development site and the second is a test site to help troubleshoot this issue.
Website 1 (WS1) - the root of this website is on a drive which is mapped to my development machine (Mac Book Pro). The mapping seems to be working and I can access all files fine (W:\www\dev.frogquest.com).
Website 2 (WS2) - is a very simple website with one ColdFusion page just to prove that everything works. It's root is a local directory on the C:\ drive of the VB (C:\sites\localtestsite.com).
I've added host file entries for both sites (127.0.0.1 ...)
WS1 - Throws a Server error when I try to access it...
HTTP Error 500.19 - Internal Server error
The requested page cannot be accessed because the related configuration data for the page is invalid
Here's what I've tried so far...
Uninstalled both .NET 4.5 and URL Rewrite 2, rebooted, reinstalled .NET 4.5, rebooted, reinstalled URL Rewrite 2 Module… retried… FAIL! I took these actions because of information I found here...
HTTP Error 500.19 on IIS7 "Malformed XML" in web.config
Per the same article as above, I tried deleting the web.config file. Strangely, this had no impact, even after restarting the website, restarting the virtual box instance, etc... which I've done frequently btw just to rule that out.
I tried adding IIS_IUSRS to the WS1 directory, but because it's a mapped drive I didn't get a "Security" tab. So, this was fruitless. This was per this article...
IIS 7.0 Error - 500.19 Internal Server Error
I tried playing with the AppPool security, changing it from "pass-through authentication" to connecting as the administrator of the machine. When I clicked "Test Settings" I did get different results, but they didn't have any material affect in the actual server response. I have screenshots of the test setting results.
I copied the contents of WS1 into WS2 and this works! So, it has something to do with the fact that it's a mapped drive and very likely a permissioning issue in my opinion.
I am now out of ideas and in need of competent help and fresh ways of thinking about this!
UPDATE: Adding a screenshot of the actual error for more info...
IIS does not support any type of mapped drive,
https://support.microsoft.com/en-us/kb/257174
You will have to use the recommended workarounds, such as UNC paths.

IIS 7 not showing virtual directory mapped to another machine

I have an issue with IIS7 when mapping virtual directories to another machine.
This is my setup:
my Web APP is running on the web server (let's call it WEBSERVER). Windows Server 2008, IIS 7.
I got some assets/images in an assets server (let's call it ASSETSSERVER). Windows Server 2003, on the C:\Assets folder, shared as \\ASSETSSERVER\Assets
Servers are in a workgroup, not a domain. This is something beyond my control, which I can't change.
Following the recommendation of our network team, I configured the app pool to run under the user WEBSERVER\portaluser
In my web app, I define a virtual directory. I map it to \\ASSETSSERVER\Assets. In the log in credentials, I specify the user ASSETSERVER\assetsuser (which exists). The 'Test credentials' buttons show that i am authenticated OK and that I have authorisation.
At first, I got a 500.19 error telling me I could not log in. This post revealed the solution: I had to create a WEBSERVER\assetsuser user with same password (counter-intuitive, but it worked).
After that, my assets still refuse to display. I now get a message similar to this:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: An error occurred loading a configuration file: Failed to start monitoring changes to '\\ASSETSERVER\assets'.
Source Error:
[No relevant source lines]
Source File: \\ASSETSERVER\assets\web.config Line: 0
I have done some extensive googling, and I have tried the following:
Modified the local policy to allow WEBSERVER\portaluser to impersonate other accounts after login, as suggested here (it's for Windows 2000 Server but it was worth a try!)
Added permissions to everyone to the \\ASSETSSERVER\assets, as indicated here (bottom answer)
Added read/execute/list permissions to the c:\ drive in ASSETSSERVER to the ASSETSSERVER\assetsuser user, as suggested here (method 3)
I edited the registry key to stop IIS from monitoring the folders for changes, as indicated here (the writer claims that it's not related to IIS but I am quite certain that IIS does monitor the folders for changes in web.config)
I have configured allowsubdirconfig="false" in applicationHost.config as indicated here
None of these solutions have worked, and I am running out of ideas of what to try. It seems like I'm so close yet so far. Any suggestions?
After several of work I found the solution to this issue.
It was as simple as creating a user called "portaluser" (the same as my app pool identity user) in ASSETSSERVER.
This is counter-intuitive: I explicitly told IIS7 to connect to ASSETSERVER as the assetsuser server, but it was still using portaluser to check for the existence of web.config (and monitor for changes).
Having seen that, I decided to use the same account to run the app pool and to connect to the remote virtual directory. I just used 'assetsuser' instead of 'portaluser'
Hope this helps

ASP.NET and IIS 7.5 - HTTP Error 403.14 - Forbidden

I try to configure IIS 7.5 on a new server (Windows Server 2008 R2), in order to run an ASP.NET 4.0 application. Two "domains" are defined on the server (managed with Parallels Plesk), each one appearing as a site in IIS. One domain is for the public site, the other is used for tests. At the present time, the DNS of the test site points to that new server while the DNS of the public site still points to our old server. We transfer the test site first, to see if everything is OK, before transfering the public site to the new server.
Pointing to the test site in IIS, if I run the Browse command on the folder of the application, I get the HTTP Error 403.14, with the message: The Web server is configured to not list the contents of this directory. The strange thing is this: if I put the exact same folder structure in the other domain on the same server, and I run the same Browse command, I see the default page of the application (I don't know if everything works after that but, at least, the first page shows up as expected). I should add:
Both sites use the same application pool.
Both sites have the same permissions (I checked one by one, also compared with cacls)
The default page is not set in IIS but is the authentication form specified in Web.config
So, same setup but different results. I don't know if there is something else that I should check. I am on very shaky ground when I talk about server configuration and IIS; so I hope that this description is clear enough and makes sense.
I think I found it. It probably doesn't work for both sites on the new server. When I run the Browse command, it shows the page in IE using the DNS of the site. Since the DNS of the public site still points to the old server, the page displayed in IE is not from the folder that I clicked, but rather from the old server site.
I can now look for standard solutions to the 403.14 problem on the new server...

How do I set up debugging under my local IIS for an MVC3 app?

My host is having issues getting my MVC3 app to work on their server, so I though I'd check it out myself. Until now I've been too busy developing under the built in server to worry about IIS, but today I tried my first deployment to the host with no joy. Then I tried one to my local IIS, with no joy. Then I tried telling VS to use IIS for debugging, to maybe resolve some local issues, with no joy.
What steps and configuration are required to use local IIS 7.5 to debug an MVC3 application?
EDIT: Going through a browser, after clearing up a permission problem for my Windows user on Temp ASP.NET Files, I now site with a I get a HTTP Error 403 (Forbidden), but the occassional basic auth login dialogue. Here I have tried a Forms auth user, my normal Windows user, and my Windows admin user, all to no avail.
When I try and debug under VS, I get a 500, internal error.
THE PLOT THICKENS: When I enable directory browsing on the site, I get a proper directory listing for the site root url. This suggests the the MVC3 routing is not working, but why not?
If you're getting a directory listing that means there's not a default file set (for IIS6). It usually means the request wasn't routed to IIS to deal with. thing are slightly different with II7 & it's integrated pipeline.
Simon

Resources