Hosting a WCF Web API app on AppHarbor? - iis

I've implemented a sample app like the one here. It is a really basic app just to get things started. Everything works fine in IIS on my local machine, I've got it running on my IIS Express as well, but now come the tricky part. I do want to host this on AppHarbor, but I get 404 error. I've started a discussion on the support forum of AppHarbor, and they have taken a screen shot of the error when they run it.
It seems like it is something wrong with the routing since the StaticFile handler is used, but I'm just guessing. Does anyone have any suggestions?

Try and add
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
to your web.config

Related

Turning on Anonymous Authentication, but IIS is still sending 401 with kerberos/windows auth request

Ok, so on my new site bob.testing.com, I set it up as anonymous authentication. Under it, i have a folder called apps. That's not an app, and there's no configuration on it. Under apps, I have a folder called MyApp. Originally, I set this up as Windows Authentication, but later I needed to update it to Anonymous. If I rename this folder to MyApp2 and create the application it works with Anonymous Authentication. When I rename it back... it sends back 401. I've tested with Fiddler, tried changing browsers, had someone else at work try it. Same results. I've tried recycling app pool, changing app pool, restarting IIS...
Anyone know how to delete whatever information IIS has cached about this application? I'd prefer not to have to rename and refactor my other apps for this item.
So, after posting; I actually looked here:
C:\Windows\System32\inetsrv\config\applicationHost.config
It was listed with two location path's. I ended up just deleting both and then setting it up again as an application. It appears to be working for now...
Looked something like this:
<location path="bob.testing.com/apps/MyApp">
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="false" />
<windowsAuthentication enabled="true" />
</authentication>
</security>
</system.webServer>
</location>

Configuring Coldfusion On IIS

I have to export a classic asp/asp.net 2.0 web site that uses also coldfusion 8, from Windows Server 2003 with IIS6 to Windows Server 2012 and IIS 8.
I got everything working except setting up coldfusion to work with IIS.
The pages using coldfusion have .cfm as an extension.
I tried to follow this link here but that did not work
http://www.adobe.com/devnet/coldfusion/articles/iis-configuration.html
When I try to add the handlers in IIS, I see a warning saying this site is in classic mode and I need to manage managed handlers directly in the config file.
I tried to add the handlers using appcmd like this:
appcmd set config /section:handlers /+[name='cfmHandler',path='*.cfm',verb='*',type='c:\coldfusion8\runtime\lib\wsconfig\jrun_iis6.dll',preCondition='integratedMode']
Then I added the Wildcard Script Map in IIS as per the link, this seems that it created and entry in the web.config of the site.
<system.webServer>
<handlers>
<add name="JWildCardHandler" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\ColdFusion8\runtime\lib\wsconfig\1\jrun_iis6_wildcard.dll" resourceType="File" requireAccess="None" preCondition="bitness32" />
</handlers>
</system.webServer>
When I try to browse to the web site, if the wildcard handler exists in the web.config, I get error 404 on any page, even the one that does not end with .cfm
I removed the wildcard and I now get the following error:
Handler "cfmHandler" has a bad module "ManagedPipelineHandler" in its module list
Most likely causes:
Managed handler is used; however, ASP.NET is not installed or is not installed completely.
There is a typographical error in the configuration for the handler module list.
During application initialization, either the application initialization feature has set skipManagedModules to true, or a rewrite rule is setting a URL that maps to a managed handler and is also setting SKIP_MANAGED_MODULES=1.
I tried to run the fix that some programmers mentioned in other questions, but did not help
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis -i
I tried to add the handler in the web.config instead of doing it through appcmd but I got the same error.
<add name="cfmHandler" path="*.cfm" verb="*" type="c:\coldfusion8\runtime\lib\wsconfig\jrun_iis6.dll" preCondition="classicMode" />
I have been trying to get this to work for the last 3 days without luck.
All I need get done is to make any page that ends with .cfm handled by the coldfusion server. It's obviously the web site is old .NET and probably classisMode. I could not find simple step by step instructions other than the link above which did not work for me.
Thank you in advance

NetScaler/IIS: 413 Entity Too Large

I am facing an issue where I am getting a 413 Request Entity Too Large whenever I post/put JSON to our servers running IIS 7.5 through a Citrix NetScaler.
We have tried to set the aspnet:MaxJsonDeserializerMembers to 30000, 40000 and 512000, as so:
<appSettings>
<add key="aspnet:MaxJsonDeserializerMembers" value="xxx" />
</appSettings>
as well as setting the <jsonSerialization maxJsonLength="xxx"/>
But without any resolution.
Setting the aspnet:MaxJsonDeserializerMembers in our local test environment, where we don't have a Citrix NetScaler, works just fine .
Is there any settings in the NetScaler that I should know of? or Is there some IIS settings I have to be aware of as well, considering that this works in our local test environments I am leaning towards the later, but I wan't all basis covert.
Edit: After further investigation, it surely seems that the NetScaler is the source as we can post to the API from behind the NetScaler.
As it turns out, it was actually a combination between the two products.
Internally we use SSL and Client Certificates which means we needed to configure a IIS property called "uploadReadAheadSize"
http://forums.asp.net/t/1702122.aspx?cannot+find+uploadReadAheadSize+in+applicationHost+config+in+IIS7+5
This is done in the host config or though the IIS manager.
...
<system.webServer>
<serverRuntime uploadReadAheadSize="{BYTES}" />
</system.webServer>
...
We used 10 MB = 10485760 Bytes for now which shows to be enough. Since this is defaulted to 48KB you may reach this rather fast.

Write requests to log file in IIS

I have a cabinet which consists of several servers, handling quite a bit of traffic.
I need to construct a system to keep statistics - and I struggle to find out if it's possible or makes sense to make a null-request to a server? That is, calling something like http://XXX.XXX.XXX.XXX?objectid=9563828&sreq=2854&nc=29291947829 and letting IIS do nothing with it, except adding the request in the log.
As mentioned, my servers handle a lot of traffic - and every bit of CPU-power and byte I can save, counts in the long run = save money.
At the moment, my plan is to make IIS return nothing on 404-errors, but I'm not sure if this is the best approach. And are all requests logged (having caching in mind)?
Theories or suggestions, please?
Solved - it is possible by adding
<configuration>
<system.webServer>
<httpErrors existingResponse="PassThrough" />
</system.webServer>
</configuration>
in the configuration file. The reason I didn't succeed, is that this command is apparently only supported from IIS 7.0 and later and I was testing it on a version 6.5

IIS Url Rewriter rewrite fails but redirect works flawlessly

I have to set up a couple of apps on a new intranet server (Win 2008 R2 Standard SP1). I have been having some difficulty with a URL Rewriter rule. I had a similar rule working great on my local IIS (Win 7). The rule is designed to create a reverse proxy for a web service that enables jQuery AJAX requests from the client to avoid XSS.
The rule is as below and if I use this as is, and type an example URL into the browser:
http://srv01.domain.com/serviceproxy/workflow/Users/GetUsers?q=smith&max=10
I get a 404 response from the server. If I change the type to "Redirect" I get the response from the server expected (but obviously this will void my attempt to avoid XSS).
<rewrite>
<rules>
<rule name="Reverse Proxy - WCF Service" stopProcessing="true">
<match url="serviceproxy/workflow/(.+)" />
<action type="Rewrite" url="http://srv01.domain.com/WorkflowService/{R:1}" />
</rule>
</rules>
</rewrite>
Any ideas what might be missing from the server configuration? Is it a security setting somewhere that needs to be configured to allow the rewrite to occur?
I found my issue. I didn't have Application Request Routing installed on this server. Either I forgot installing it on my other server or it was already on there for another reason.
Found this article that helped me resolve it.
http://www.iis.net/learn/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing
Had a similar issue on Windows 2008, IIS 7.5
The problem was that the app pool was in integrated mode. that caused issues with the rewrite.
Redirect was always ok, but rewrite always failed.
changed the app pool to classic mode and problem solved (at least for now).
a better solution might be http://forums.iis.net/t/1200671.aspx?ARR+URl+Rewrite+is+not+working+for+external+servers
right at the end. but i havent tried it.

Resources