500 Internal Server Error accessing Image in IIS7 - asp.net

I have created an ASP.Net MVC4 site and deployed it to IIS7.
We noticed that the images in the css were not showing.
Trying to directly access the image file like this
http://.com/CircuitSearch/Images/CircuitSearchBackgroundTrans.png
returns the 500 error. Yes the filepath is correct.
Odd part if another site hosted on the same IIS works fine and can display images.

Change authentication for the site to Anonymous authentication/ application pool identity

I went into the IIS Log (usually under c:\inetpub\Logs) and discovered that I was getting error 500 with sub status of 19.
I looked up the causes for 500.19 via google and found the below link:
https://support.microsoft.com/en-us/help/942055/http-error-500-19-error-when-you-open-an-iis-7-0-webpage
Based off a clue that there could be a duplicate entry for some of the modules, handlers, or mime types causing an error, I commented out my system.webServer and noticed the images worked. I then commented out only portions of my web config and narrowed it down to a duplicate staticContent entry in my web.config.

Related

ASP.NET v4 MVC site deployed on IIS 8 Server 404 (Not Found) error on Javascript content generated by a 3rd Party dll

I've found numerous posts describing this problem but the solutions didn't help me. As described I had a working application on ISS Express, but when switching to Local IIS or deploying to a remote server I'm getting a 404 not found error.
I've ensured my AppPool is running as AppPoolIdentity and have given the pool Read/Execute credentials on the site folders.
I've tried both Anonymous login with IUSR credentials set to Read/Execute as well as Windows Authentication with Impersonation enabled.
I've added runAllManagedModulesForAllRequests="true" to the web.config (the dll's are getting deployed with the site)
I've talked to the original creators of the dll's and had them whip up a working example on their system with the same libraries and send it over. I experienced the same issue as before when deployed, so I'm thinking it's an IIS configuration issue.
Browser Errors:
GET http://serverName:81/websiteName/Service/?Request=LS;Id=websiteName!EBR;Id=0!SCSS; net::ERR_ABORTED
GET http://serverName:81/websiteName/Service/?Request=SRT;AssemblyName=A.ThirdParty.Assembly|Path=A.ThirdParty.Assembly.MinifiedScript.js 404 (Not Found)
I also tried creating the 'Service' folder which turned those 404s into 403 Forbidden, even after giving write credentials to the AppPool (which I don't think I need to)
One of those four things was the solution to most of the posts I've read so far, but none have worked for me.
I resolved this by creating a new site from scratch. Not sure what was causing this issue, could have been that I had the site in a subfolder of the IIS Website.
Now that is no longer true, so I'm guessing the relative path is now working, whereas before it was not able to find the file being served.

Windows 2008 R2 IIS7 windows authentication not working

I have a dev and prod Windows 2008 R2 servers with IIS7 and siteminder, which as far as I can tell are setup the same. Issue being the production websites work but the development ones do not.
Issue being that when I navigate to any dev website, it says "the page cannot be displayed because an internal server error has occured." I do not get a challenge in dev (which I believe is the cause of the issue), but I do in prod. This goes for classic ASP pages or ASP.NET pages.
Some findings :-
- IIS has Windows authentication enabled and all others disabled
- Windows Authentication Provider is Negotiate (tried Negotiate:Kerberos, same result)
- WindowsAuthentication and WindowsAuthenticationModule (Native) are both present in Modules
- WindowsAuthentication is installed under Server Manager -> IIS -> Roles
- Upon receipt of the above error message, IIS logs shows the access with error 401 2 5
All the solutions I found online either do not have the right setup as I do above, or suggests I disable Windows authentication and enable Anonymous Authentication. If I do so, all works fine but the only issue being my websites require Windows authentication to identify the user. I'm at my wit's end and am just short of reinstalling something in hope it works. Any possibilities or log files that I have overlooked?
After screwing around a bit I finally solved my problem ... hope this helps someone.
I realized in fact ASP pages were working but ASP.NET pages were not working
When I had turned on Anonymous Authentication, the ASP.NET pages were now giving 500 0 or 500 19 errors in IIS logs, instead of 401 2 5 with Windows Authentication
I tried to launch a ASP.NET page from within the localhost and got then 500 error with a more detailed error saying I should use relative path in httpErrors under web.config (??)
At this point I realized I had earlier changed the 403 error to a custom file at the default website level, then changed it back. Despite changing it back to it's previous value, What this ended up doing was adding a "remove" then an "add" tag, both for 403.htm, under httpErrors in the wwwroot/web.config. After I deleted the entire httpErrors segment, my websites started working again.
Reverting back to Windows Authentication at this point also worked.
So some take aways is to test websites locally first and keep in mind the existing of the wwwroot/web.config giving near untraceable errors ...

HTTP/1.1 500 Server Error With ASP classic

At the very outset I would like to state that this is my first ASP classic page that I have created which since the first deployment on IIS is giving me server 500 error. I have searched the entire web and have done almost everything possible to get this right, but all in vain.
I have created a classic ASP page using Web Matrix. This is a web based dashboard which connects to MSSQL server and fetch necessary information. I have a similar app in php which is working perfect, but I wanted to learn ASP hence was trying to make a similar web app on ASP. This app works absolutely fine on Web Matrix. When I run this app from within web matrix (both on chrome as well as IE) it connects to the required database and I can browse the details as expected. The problem starts when I host this on IIS (localhost on my windows 7 pc). This is the exact procedure that I have followed :
Created a new Site on IIS named "YCube"
Using basic settings I have given the following Physical path for the app (D:\YVXS\Personal\ASP\SSTool\Ycube) {the project output folder}
In the bindings page I have assigned port 81
IIS authentication is set to "Anonymous Auth"
Application pool for asp is set to classic (as IIS first stated it cannot perform the task in integrated mode)
After this when I tried browsing localhost:81/menu.asp, it given me server 500 error. The 21 days research starts now (bullet points below)
To get the descreptive errors on the web page I did following but the error description did not change IIS->asp->Compliation->send error to browser =true, friendly http error on IE = disabled
IIS log files, not sure if iam not able to understand the error but am getting follwing on the log file (C:\inetpub\logs\LogFiles\W3SVC1
2013-02-23 08:07:44 ::1 GET /menu.asp |-|ASP_0147|500_Server_Error 80 - ::1
On the IIS forum only I underatood at time global.asa file can cause this problem, I deleted this file and tried, all in vain
The folder and files permission for my site is read only, however I have tried the same with read and write access also, this also did not help
On the error pages in IIS, i have changed the "Edit feature settins" to "Detailed error", this also didnot give me any futher error desc.
24 times i have uninstalled IIS and installed back, nothing has happend
Someone suggested to created a dummy asp file and try hosting the same of IIS, so I used a small code
<HTML> <BODY> This page was last refreshed on <%= Now() %>. </BODY> </HTML>,
this is giving correct output (This page was last refreshed at 18:88:22....), however with my original asp page I still get server 500 error
A friend of mine suggested to delete all other hosted web pages from IIS and try (I had one PHP on the IIS), hence I deleted the same and tried, no changes at all
Event log file is showing nothing pertaining the ASP (only few files are there which tells about unexpected shutdown of my PC)
I created a second ASP file which had MS access at the backed, this only is also giving me same server 500 error
Other things that I have tried is changing the web.config file to send detailed error, (thouh i forgot the exact line) but that also did not help me
Here are my system config and other details Windows 7 professional, IIS7.5.7600, MSSQLR2express. Also please note that I have tried hosting this on two othe pc's that I have(both windows 7) and in office server 2003, but all are giving me same server 500 error.
Never thought learning a classic asp will put me into all this Jazz...please help..
Couple of Things u need to take care of while configuring ASP site in IIS
1) Enable parent path = true
2) if you have 64 bit machine need to set your Application pool for 32 bit.
this are default settings which we need to take care.

IIS - "The system cannot find the file specified."

I am building an asp.net web application which has been working on local and staging. however, when i deployed to live, there is a little weird issue occurred. below is the live environment details.
live environment:
Server 2003
IIS 6
when the request url is below, if page not found, it will redirect to page 404 configured in the IIS.
"http://www.xxxx.com/folder1/default.aspx"
however, when the request url is below (with a dot in the folder), it will show a IIS default 404 message which is "The system cannot find the file specified." which isn't what i configured in the IIS and it seems like it skips all the http handlers and modules. Therefore, my custom http handler stop working with this kind of url.
"http://www.xxxx.com/folder.1/default.aspx"
My guess it something to do with the IIS setting. i have have several research, there is no other issue like me.
appreciated if anyone can help. Thanks a lot.
Dion
One of the possible reason could be tool such as UrlScan - you need to explicitly configured it to allow dot(.)s in the url - this can be done by editing <Windows Folder>\system32\inetsrv\urlscan.ini and setting AllowDotInPath=1

CustomErrors only catches explicit page links

I have custom errors turned on and when I go to
www.mywebsite.com/video/default.aspx it shows error which corresponds to 404 and this is fine
but when I go to www.mywebsite.com/video/ it shows a generic iis 404 error.
My other pages that have files work fine like
www.mywebsite.com/photo/ would redirect to www.mywebsite.com/photo/default.aspx because files exists and default is setup in IIS.
Please help. Thanks!
The 404 handler specified in the web.config only works for files handled by the ASP.NET runtime. This is why it is working for www.mywebsite.com/video/default.aspx and not www.mywebsite.com/video/, the generic error your observing is the one configured by default in IIS. You will need to go into IIS Manager and set 404's to be redirected to your PageNotFound.aspx.
Here's some more infomtion on configuring custom error messages in IIS 6.0.

Resources