Wednesday, 14 October 2015

Oracle and ODBC

For some reason on Oracle 12 at least I having trouble getting the ODBC call SQLColumns to work . I was using it as an existance test for a database table, and Oracle kept returning 942 (table does not exist) even though the table was owned by the schema associated with the user that was being used in the ODBC call. It turned out that the user needed the SELECT ANY DICTIONARY system privilege. Not sure why, but granting that to the user allowed me to make the call successfully.

Thursday, 30 April 2015

Getting an IIS reverse proxy via ARR to use IIS custom error pages


This took a while to discover!

The problem - you have  IIS configured with ARR and you have rewrite rules set up to pass incoming requests from IIS to a back office machine, e.g. Tomcat.

You would like to leverage IIS to display customer error pages when either IIS can't find a page, or the server behind the reverse proxy can't.

In the first case (404 coming from IIS directly) you can use the "Error Pages" feature of an IIS site (or the defaults set at the server level).  Just double click the "Error Pages" feature and then in the Actions pane on the right, select "Edit Feature Settings".  Pick "Custom error pages" get IIS to server up the files pointed to in the feature list for each status code.

You can then edit the file to or create a new file and point at it instead for a given error code.

However, by default,  IIS assumes that if a request a reverse proxied then the remote server will handle setting the HTML for error scenarios, so if, e.g.  404 is returned from the reverse proxied server, IIS will display that response, and not interject with the custom page.

To change that behaviour, execute the following in an admin command prompt:
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/httpErrors -existingResponse:Replace

Hey presto, the reverse proxied reponse are now replaced as well.

I found this, after much searching here:
http://forums.iis.net/t/1157934.aspx?Web+farms+with+URL+rewrite+and+error+pages