Enable Failed Tracing in IIS 8.0 - iis

I am getting a HTTP 500 error when trying to run my website. To try and figure out what is going on I want to turn on Failed Request Tracing Rules.
I am going off of these instructions https://www.iis.net/configreference/system.applicationhost/sites/site/tracefailedrequestslogging
and everything is fine until I get to Step 3 of HOW TO CONFIGURE THE FAILED REQUEST TRACING SETTINGS FOR A SITE. This step is simple enough "In the site's Home pane, click Failed Request Tracing... in the Actions pane." except that isn't there in my action pane. In fact the entire config section isn't there in the Actions Pane. So I either need another way to enable Failed Request Tracing, or a way to get this configure section of the action pane there.
My IIS view
Thanks

Click on "Open Feature" in the top right then click "Add" to add a new rule

Related

Failed to execute 'postMessage' on 'DOMWindow' on Kentico 13 Core

Following this tutorial to setup Kentico Core 13 on local machine with New site as explained in article. It completed successfully. Post that created the Page types and when try to add pages using those page type use to get below error:
An error occurred while attempting to retrieve page templates. The live site application is not running or is not accessible.
When checked in developer console it states that :
GetResource.ashx?scriptmodule=/CMS/VirtualContextAuthenticator.js:1 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('http://localhost:25291') does not match the recipient window's origin ('null').
Then I tried accessing live site and it is not working.
Hmmm… can't reach this page localhost refused to connect.
Please guide.
Go to the Sites application in Kentico, edit your site (click the pencil icon), and enter http://localhost:25291/ (or whatever your IIS Express default address is) into the Presentation URL: field. Save. See if it helps.

Export to excel in classic asp stopped working [duplicate]

IIS 7.5 , 2008rc2, classic asp, 500 error msg:
The page cannot be displayed because an internal server error has occurred.
I need to know how to configure IIS to get a more detailed error.
I've tried setting to true all of debugging options in the ASP configuration.
But that didn't work. Can anyone help me?
I have come to the same problem and fixed the same way as Alex K.
So if "Send Errors To Browser" is not working set also this:
Error Pages -> 500 -> Edit Feature Settings -> "Detailed Errors"
Also note that if the content of the error page sent back is quite short and you're using IE, IE will happily ignore the useful content sent back by the server and show you its own generic error page instead. You can turn this off in IE's options, or use a different browser.
If you're on a remote server you can configure your web.config file like so:
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
</system.webServer>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
Double click "ASP" in the site's Home screen in IIS admin, expand "Debugging Properties", enable "Send errors to browser", and click "Apply".
Under "Error Pages" on the home screen select "500", then "Edit feature settings" and select "Detailed Errors".
Note that the same steps apply for IIS 8.0 (Windows Server 2012).
After trying Vaclav's and Alex's answer, I still had to disable "Show friendly HTTP error messages" in IE
TLDR:First determine where in the pipeline you're getting the error from (scroll looking for screenshots of something that resembles your error), make changes to get something new, repeat.
First determine what error message you are actually seeing.
If you are seeing the file located here...
%SystemDrive%\inetpub\custerr<LANGUAGE-TAG>\500.htm
...which generally looks like this:
**...then you know you are seeing the currently configured error page in IIS ** and you do NOT need to change the ASP.net customErrors setting, asp error detail setting, or "show friendly http errors" browser setting.
You may want to look at the above referenced path instead of trusting my screenshot just in case somebody changed it.
"Yes, I see the above described error..."
In this case, you are seeing the setting of <httpErrors> or in IIS Manager it's Error Pages --> Edit Feature Settings. The default for this is errorMode=DetailedLocalOnly at the server node level (as opposed to the site level) which means that while you will see this configured error page while remote, you should be able to log on locally to the server and see the full error which should look something like this:
You should have everything that you need at that point to fix the current error.
"But I don't see the detailed error even browsing on the server"
That leaves a couple of possibilities.
The browser you are using on the server is configured to use a proxy
in its connection settings so it is not being seen as "local".
You're not actually browsing to the site you think you are browsing to - this commonly happens when there's a load balancer involved. Do a ping check to see if dns gives you an IP on the server or somewhere else.
Your site's httpErrors settings is set for "Custom" only. Change it to "DetailedLocalOnly". However, if you have a configuration error, this may not work since the site level httpErrors is also a configuration item. In that case proceed to #4
The default for httpErrors for all sites is set for "Custom". In this case you need to click on the top level server node in IIS Manager (and not a particular site) and change the httpErrors settings there to DetailedLocalOnly. If this is an internal server and you're not worried about divulging sensitive information, you could also set it to "Detailed" which will allow you to see the error from clients other than the server.
You're missing a module on the server like UrlRewrite (this one bites me a lot, and it often gives the generic message regardless of the httpErrors settings).
"Logging on to the server is not an option for me"
Change your site's httpErrors to "Detailed" so you can see it remotely. But if it doesn't work your error might already be a config error, see #3 immediately above. So you might be stuck with #4 or #5 and you're going to need somebody from your server team.
"I'm not seeing the error page described above. I'm seeing something different"
If you see this...
...and you expect to see something like this...
...then you need to change "Send errors to browser" to true in IIS Manager, under Site --> IIS --> ASP --> Debugging Properties
If you see this...
or this...
...you need to disable friendly errors in your browser or use fiddler's webview to look at the actual response vs what your browser chooses to show you.
If you see this...
...then custom errors is working but you don't have a custom error page (of course at this point were talking about .net and not classic asp). You need to change your customErrors tag in your web.config to RemoteOnly to view on the server, or Off to view remotely.
If you see something that is styled like your site, then custom errors is likely On or RemoteOnly and it's displaying the custom page (Views->Shared->Error.cshtml in MVC for example). That said, it is unlikely but possible that somebody changed the pages in IIS for httpErrors so see the first section on that.
In web.config under
<system.webServer>
replace (or add) the line
<httpErrors errorMode="Detailed"></httpErrors>
with
<httpErrors existingResponse="PassThrough" errorMode="Detailed"></httpErrors>
This is because by default IIS7 intercepts HTTP status codes such as 4xx and 5xx generated by applications further up the pipeline.
Next, enable "Send Errors to Browser" under the "ASP" section, and under "Error Pages / Edit Feature Settings", select "Detailed errors".
Also, give Write permissions on the website folder to the IIS_IUSRS builtin group.
try setting the value of the "existingResponse" httpErrors attribute to "PassThrough". Mine was set at "Replace" which was causing the YSOD not to display.
<httpErrors errorMode="Detailed" existingResponse="PassThrough">
One thing nobody's mentioned is as a very quick and temporary fix, you can view the error on the localhost of that web server.
You may also verify that if you changed your main website folder (c:\inetpub\wwwroot) to another folder you must give read permission to the IIS_IUSRS group in the new folder.
Fot people who have tried EVERYTHING and just CANNOT get the error details to show, like me, it's a good idea to check the different levels of configuration. I have a config file on Website level and on Application level (inside the website) check both. Also, as it turned out, I had Detailed Errors disabled on the highest node in IIS (just underneath Start Page, it has the name that is the same as the webservers computername). Check the Error Pages there.
Found it.
http://blogs.iis.net/ksingla/archive/2009/02/16/iis-7-5-updates-to-custom-errors-and-compression.aspx
run cmd as administrator, go to your system32\inetsrv folder and execute:
appcmd.exe set config -section:system.webServer/httpErrors -allowAbsolutePathsWhenDelegated:true
Now I can see detailed asp errors .
If you run the browser in the server and test your url of the project with the local ip you have received all errors of that project without a generally error page(for example 500 error page).
In my case it was permission issue.
Open application folder properties -> Security tab -> Edit -> Add
IIS AppPool\[DefaultAppPool or any other apppool] (if use ApplicationPoolIdentity option)
IUSRS
IIS_IUSRS
Double check the encoding of the asp file you are testing.
For instance if you created a file like below on a Windows Server Core 2019 :
echo "<%# LANGUAGE=Javascript %>" > test.asp
echo "<%Response.Write("test");%>" >> test.asp
Then test.asp will be encoded in Unicode, and requesting it will produce a 500 without any details.
Do a notepad test.asp, then click on "Save As..." and choose "ANSI" encoding to fix it.

Why is ASP.NET Core MVC Identity authentication resetting with IIS Cache-Control?

I am using the standard Identity authentication set-up with ASP.NET core MVC. It has been working fine for a long time, but I recently added Cache-Control on the production IIS server. The app is intranet-only and updated regularly, so it was getting to be a major hassle needing to clear everyone's cache every time the app was updated.
The setting I changed is was adding
Cache-Control: max-age=30
to the Http response header.
After making this change, the Identity authentication will randomly "reset" itself. For example, a user will log in successfully; they will then navigate to a page which is protected by Identity authentication. After doing so, the user is redirected back to the login page. This can repeat an arbitrary number of times before the user is finally able to make it to the desired destination page.
The worst part is, I cannot replicate the issue in any repeatable manner. I have witnessed it multiple times, but it doesn't happen 9 times out of 10 and I can't see any reason why it happens to begin with.
Does anyone know how Cache-control affects Identity authentication?
For cache issue, you could use iis HTTP header keep alive option.
you could follow the below steps:
1) Open IIS Manager and select the site from the connection pane.
2)Double-click on the HTTP Response Headers
3)Click Set Common Headers… from the action pane:
4)Check the Enable HTTP keep-alive checkbox, Check the box to expire Web content and set your time.
the main reason behind to use the keep-alive connection header to keep our HTTP requests open. This will avoid the need to repeatedly close and open a new connection.
or
you could use application pool recycling, iis output cache setti9ng.
1)From IIS, select the website.
2)Open “Output Caching” feature.
3)Click “Add…” from the Actions panel.
4)Specify an extension, Check “User-mode caching” and “Kernel-mode caching” and select the “Prevent all caching” options under each section.
5)Click OK.
6)now select Edit Feature Settings from the action pane in output cache window.
7) Uncheck Enable cache and Enable kernel cache.
8)Restart the website.

How to configure owa to add the HTTP header X-FRAME-OPTIONS to the respond?

my OWA server has suffered from click jacking and I know I have to add HTTP header
X-FRAME-OPTIONS:SAMEORIGIN
to the respond, but I don't know exactly how I can do it.
Please if any one can provide me a way to solve this issue, I'll be grateful.
I wouldn´t change the IIS configuration by hand. The correct way is to use the Microsoft way to configure that. So at first check the current state from that option via:
get-OWAVirtualDirectory -Identity "exchange1\owa (Default Web Site)" | select WebPartsFrameOptionsType
It that stands on "None" then you can change that to SameOrigin via the following way:
Set-OWAVirtualDirectory -Identity "exchange1\owa (Default Web Site)" -WebPartsFrameOptionsType SameOrigin
Please keep noted that AllowFrom isn´t yet supported as written here.
Optional:
You can control that via the OWA mailbox Policy:
To check the status use:
get-OwaMailboxPolicy -Identity "OWA User Policy" | select WebPartsFrameOptionsType
To change that use:
Set-OwaMailboxPolicy -Identity "OWA User Policy" -WebPartsFrameOptionsType SameOrigin
More infos here or here
The following steps helped me to solve this problem, Here are the steps:
1- Open IIS Manager and navigate to the level you want to manage.
2- In Features View, double-click HTTP Response Headers.
3- On the HTTP Response Headers page, in the Actions pane, click Add.
4- In the Add Custom HTTP Response Header dialog box, add a header called "X-FRAME-OPTIONS", and assign it's value to "SAMEORIGIN".
5- Click OK.
For more information, Please visit the following link:
http://technet.microsoft.com/en-us/library/cc753133%28v=ws.10%29.aspx
Best Regards

ColdFusion 10 Update 11 404 handler not firing

I know CF 10 has a number of issues surrounding 404 handling. This seems to be different from the other reports. Details:
Win2k8 R2/64 and IIS7.5
Upgrading from identical config on separate server. Only difference is CF9 -> CF 10. All works fine on CF9. Adobe CF9 Lockdown implemented on original server, CF10 Lockdown implemented on this server.
missing template handler set in CF Admin as /404.cfm, which should translate to the Cfusion root (c:\ColdFusion10\cfusion\wwwroot).
IIS has been config'd to trace failed 404 requests
IIS 404 handling is default (originally executed a CF URL but removed to simplify debug).
Coldfusion webroot where missing template handler resides is default install location
IIS site root is entirely different: c:\Other\Place\SiteRoot\
A sitewide error handler is also set in CF Admin in the same ColdFusion webroot and works as expected.
404.cfm is very simple:
<cfheader
statuscode="404"
statustext="Not Found">
<h1>404</h1><p>Page not found</p>
<cfoutput>#now()#</cfoutput>
Inputting the bad url [domain]/foo.cfm should display the above template. Instead I get an IIS error screen. The CF missing template handler is ignored. The IIS failed request trace says the url is
http://[mydomain]:80/jakarta/isapi_redirect.dll
and a detail view shows at Step 1
RequestURL="http://[mydomain]:80/foo.cfm
I've seen plenty of issues surrounding CF10 and 404's, but never that the missing template handler assignment is completely ignored. In CF9 this will generate output as expected. Anyone seen anything like this?
EDIT:
I have also tried config'ing this to match a different CF9 server I have running: Added a CF mapping to the web root of the site. Then placed the missing template handler in the web site's root rather than the CF default web root, lastly in cfadmin pointed to the missing template handler in the web site's root using the mapped folder. Same problem. Works fine in CF9 and not at all using CF10.
EDIT2:
As Miguel F pointed out in the comments, you can shut off HTML error codes in CF Admin and this will let the Missing Template Handler fire... BUT you get a 200 header to go with it. Apparently cfheader statements are ignored as I have tried placing the cfheader at the beginning and end of the template... still yields a 200. Visually fine but insofar as SEO is concerned thats a disaster. Just looked and my CF9 servers do not require this setting to be unchecked for their handlers to work.
EDIT3
Dana Kowalski's solution displays detailed IIS errors to the public, so for a 404 on, say, a made-up extension (foo.xyz), the screen will show file paths. Default behavior is to NOT display detailed errors except when running templates locally, and display custom error pages to visitors. The CF error template should work fine with that setting.
POSSIBLE SOLUTION
I stepped back to ColdFusion 9 as part of debugging this problem, and may have discovered the solution while debugging a separate related issue.
In the IIS Manager, click on the site in question. Select the Error Pages option. Select the 'Edit Feature Settings' link on the right side. Check that the 'Detailed Errors' option is selected.
If you have either of the other two selected, there are times IIS 7.x will take over and not let ColdFusion handle it.

Resources