Error 500 on IIS 8/8.5 with ColdFusion 10/11 - coldfusion

If I have an error in my ColdFusion script, I'm getting a 500 error message from IIS instead of ColdFusion. This only happens if I provide the file name in the URL and does not happen if I open the URL without the script name (which would open index.cfm).
For example:
IIS error: http://www.example.com/index.cfm
IIS error: http://www.example.com/foobar.cfm
Coldfusion error: http://www.example.com/
I can reproduce this problem on 2 of my 3 ColdFusion platforms:
Working: IIS 7.5 with ColdFusion 10 Update 12 (with updated connector)
Not Working: IIS 8 with ColdFusion 10 Update 12 (with updated connector)
Not Working: IIS 8.5 with ColdFusion 11
My index.cfm & foobar.cfm:
<!--- provoke a coldfusion error --->
<cfset foo
My web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpErrors errorMode="Custom" existingResponse="PassThrough" />
</system.webServer>
</configuration>
For me it looks like there's a problem with the ColdFusion connector with IIS 8 and IIS 8.5.

Okay, I was finally able to fix this.
The problem
I run multiple web applications each in a own virtual directory under the same IIS website. It turned out that adding existingResponse="PassThrough" to the web.config only works partially in virtual directories. Without that setting I never get any ColdFusion error and instead I always see the IIS 500 error. If I add existingResponse="PassThrough" in the web.config of a virtual directory, ColdFusion errors are only forwarded if you access the site without calling a .cfm script directly (for example: example.com/ instead of example.com/index.cfm).
The solution
The solution was easy. I just had to add the existingResponse="PassThrough" setting to the web.config of the root IIS website aswell and everything is working.
I think this is a bug in IIS 8 and 8.5 since I double checked that on my IIS 7.5 server and I didn't had to add the property on the root website.

Related

Flask app IIS: Keep getting 404 when routing to other pages

I need help on how to make routing in my flask app hosted using IIS windows server 2012 possible. The home [starting page] works though also cannot load images but it works. The error I get is 404 whenever I click on links leading to other pages in the application. Is there anyone who can assist and tell me what I am doing wrong?
Error i get is
You can try to add the following to the web.config file:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" >
<remove name="UrlRoutingModule"/>
</modules>
</system.webServer>

Azure flask <handler> scriptProcessor could not be found in <fastCGI> application configuration

I am trying to deploy Python Flask application in the Azure web app. I had create web app(Flask) and published my code. After publish, I am getting below error from the site.
The page cannot be displayed because an internal server error has
occurred.
When check the Log, i could see the below error.
But this was happening only in my subscription(free subscription got with MSDN). But working fine in the Organisation subscription.
The <fastCGI> settings must be in the applicationHost.config file (in the system.webServer section) of IIS. Just putting it into web.config does not work (confirmed by testing it on a local IIS, not in Azure). An example configuration may look like this:
<fastCgi>
<application
fullPath="D:\home\Python27\python.exe"
arguments="D:\home\Python27\wfastcgi.py"
maxInstances="16"
idleTimeout="21600"
instanceMaxRequests="10000000"
signalBeforeTerminateSeconds="60"
xdt:Transform="InsertIfMissing"
xdt:Locator="Match(fullPath)">
<environmentVariables>
<environmentVariable name="PYTHONHOME" value="D:\home\Python27" />
</environmentVariables>
</application>
</fastCgi>
You may want to adjust this configuration.
This should solve it for a local IIS where you can edit applicationHost.config. I'm not sure about Azure, but maybe you can find some hints here: https://github.com/Azure/azure-python-siteextensions/issues/2.

Webservice .Net 4.0 publishing problems in IIS7

I cant get my Webservice published, it should be simple:
I create the app in the IIS,
place it as a 4.0 Classic .Net
I publish it from .Net Solution within VS2012 Right click and publish
on the Webservice project.
The files are placed and it should show by itself on the browser on the URL of the server specified.
But I stumbled upon the following problems:
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
So I've looked for It and found this two options:
Option 1:
http://www.banmanpro.com/support2/Requested_Content_Appears_to_be_Script.asp
This one says I should go to Integrated, instead of Classic App Pool. but it's like if I changed a problem for another because now it says:
HTTP Error 500.21 - Internal Server Error
Handler "WebServiceHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list
When I go to the web config see what is this error talking about I see no handler tag!
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appSettings />
<connectionStrings />
<system.web>
<compilation targetFramework="4.0" />
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>
-->
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
</system.web>
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
</configuration>
Should I add one? If so, how?
Option 2:
Script not served by static file handler on IIS7.5
Basically it says I shoud do a aspnet_regiis -i, but when I try
going to %windir%\Microsoft.NET\Framework\v4.0.30319
Even when the folder exists, There is no aspnet_regiis!!
I've only found the aspnet_regiis on the 2.0 Fwk =(
Is that normal?
The handler tag wasn't the answer, however, both options drove me to look for the missing aspnet_regiis of fwk 4.
There was no aspnet_regiis because the full fwk 4.0 wasn't actually installed on a first place.
I had installed on the server the Framework 4 Client Profile and the debugger, which isn't the full version. From now on, whenever I think I have fwk 4 installed, I'll check twice.
After installing it, on Framework 4.0 Classic Pipeline Mode (instead of Integrated) made it work just fine.
But Attention!
After installing the framework, IIS will change the default pipeline to 4.0, that means, if you had ongoing a web(site/service) on 2.0 it will automatically stop working. (It happened to me)

IIS 7.5 Handling 500 Errors Differently Than IIS 6.0

Our Classic ASP application contains a web service that can be called over an HTTP. POST or GET. The web service does its duty and then writes out, using Response.Write, an XML message over HTTP.
Here is an example.
Response.ContentType = "text/xml"
Response.Status = "500 Error"
Response.Write("<?xml version=""1.0"" ?>")
Response.Write("<PeelMe>")
Response.Write("<Error>Your orange was actually blue!</Error>")
Response.Write("</PeelMe>")
When the application was hosted in IIS 6.0, the caller received the XML and was able to parse it just fine.
Then, we switched to IIS 7.5.
As in IIS 6.0, we set up a customer error page, let's call it "Blah.asp", to render certain custom text to the browser when an error occurred while an actual user was browsing the site. When we switched to IIS 7.5, all 500 error messages written out to the web service caller were now captured by IIS 7.5, redirecting the thread to Blah.asp and subsequently writing the HTML of Blah.asp back to the caller.
Here is my question:
How do I get IIS 7.5 to act like IIS 6.0 so that when I want to write out a 500 Error message back to a web service caller, I can do that, without IIS 7.5's custom error handling getting in the way?
Since IIS7 the web.config offers more options. You could try the following to get the bevaviour you are after:
<system.webServer>
<httpErrors errorMode="Detailed">
<remove statusCode="500" subStatusCode="-1" />
<error statusCode="500" prefixLanguageFilePath="" path="/[CUSTOMERRORPAGE].asp" responseMode="ExecuteURL" />
</httpErrors>
</system.webServer>
Did you try setting the app pool to asp classic? We've been doing a lot of upgrades lately; constantly running into issues with 7.5.
Setting the app pool back, resolves probably 80% of our issues.

Problem with IIS with Multi ColdFusion Server Configuration

This is a multi ColdFusion configured server with cf7 and cf8 and the jrun located in the main C:\ .
After editing the JVM.config and increasing the memory size to Xms1024m Xmx1024m
and GC to XX:MaxPermSize=256m, and then restarting.
I am unable to get any of my sites to load in the browser. One gives me a 404 and the other gives me an ACL 403 (Access Denied). If I try browse the site with the 403 to a subdirectory (ex.http://site.com/folder), I see the CFML code. If I do the same with the site giving me the 404, I get The request is not supported.
This server originally had CF7 and then CF8 was installed in Multiserver Config.
I can get to the CF8 Admin on port 8300 but nothing on port 80 with IIS.
I returned the JVM.config file back to its default by taking the back up file and restoring to the directory, but that didn't work.
Ok, So I solved the issue. The issue was that the Server orignally used a Multiserver configuration because CF 7 and CF 8 are both installed on the machines. When I looked at the MultiServer Configuration for CF 8, everything seemed correct. However, when I looked at the Single Server CF 8 configuration there was no configuration. Although the this type of scenario worked worked prior, I decided to add configurations to the Single CF 8 configuration and both sites came up.
These are guesses, but...
Has "index.cfm" been removed from the list of default documents?
Perhaps the CF connector needs to be re-run.