Receiving IIS 500 error for static files when installed with Sitecore 7.2 - asp.net

Hopefully somebody can point me in the direction of a solution for this particular problem.
The Scenario (Sitecore 7.2 rev 140526)
I have a static 'index.html' file hosted in a folder (let us call it 'test') inside my Sitecore web application.
If I access the index.html file directly via a web browser, everything loads correctly.
However, if I access the directory (i.e. http://myweb.site/test/) I receive a 500 error.
The error message is binding to the default document correctly, as evidenced by the details in the error message.
UPDATE: I have been able to reproduce with a fresh 7.2 instance with the NTTData CDN Connector configuration file in place.
What I have tried already
To prevent Sitecore from serving it's 404, I updated IgnoreUrlPrefixes setting
The index.html file name is in the list of default documents for the site (and folder)
In order to bypass the ExtensionlessUrl handler for .NET and resolve a 404 error, I have re-ordered the Handler Mappings to place the StaticFile handler before the ExtensionlessUrlHandler handlers.
Running on the same IIS instance, I setup a separate site with the same files and the default document loading worked correctly.
I have verified that the folder in IIS has Anonymous Authentication enabled
I have tried providing the Everyone group with full control to the folder in NTFS permissions
I have validated that the folder and folder parents are not marked as 'Hidden'.
IIS Failed request tracing did not provide much, but I did notice the Sitecore Rewrite module changing the URL a few times in the handler pipelines to append a "?". Subsequent calls by the static module did not show any warnings or errors though.
I have reproduced with a blank Sitecore 7.2 instance by adding the NTTData CDN Connector configuration file
The error I am seeing
HTTP Error 500.0 - Internal Server Error
Module: DefaultDocumentModule
Notification: ExecuteRequestHandler
Handler: StaticFile
Error Code: 0x800703e9
Requested URL: http://myweb.site/test/index.html
Physical Path: C:\MyWebsite\test\index.html
Logon Method: Anonymous
Logon User: Anonymous
Any thoughts?

While I have not figured out why the CDN connector interferes with the loading of the static files, I have been able to resolve the issue using an approach from this answer.
Essentially, by running the subfolder as an application with a classic mode application pool and putting the static file handler mapping first, the CDN connector doesn't execute and everything works great.

I think I found the cause of this.
There is a processor that is patched just before the FilterUrlExtensions processor called CDNInterceptPipeline which attempts to convert the following via a url rewrite:
/path/to/file.ext!cf!a=1!b=2 to /path/to/file.ext?a=1&b=2.
This caused all number of problems in our solution, including the one you stated above, and for the CDN set up we're using we didn't even need it. It might be that you can safely remove it from the SitecoreCDN.config as we did.
Source: https://github.com/NTTDATA/SitecoreCDN/blob/master/Code/Pipelines/CDNInterceptPipeline.cs

I accidentally had a web.config in the folder. Deleted that. Everything worked.

Related

web.config file not there in the root(/) directory

I was trying to run a .cshtml file but it gave an error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.cshtml' may be incorrect. Please review the URL below and make sure that it is spelled correctly.
Requested URL: /index.cshtml
So I searched for the solution and found that I had to edit the web.config file which is in the root directory(here it is My Site), but there is no file like that there there is only an index.cshtml which I had created.
I searched even the IIS and the IIS Express folders in Programs Files\ but there was no file like that?
If you are using WebMatrix, maybe your mistake was the starting point choice.
If you want to create a new Web Pages site you must start from a template in the Template Gallery of WebMatrix. Pay attention that the Empty Site template differs from the Empty Site option outside the Template Gallery because the first holds the files (binaries, packages and the web.config too) that are needed.
As the server error suggests, .cshtml files are not served, the reason for this is because they are server-side files that make up your application, they are just one piece of a much bigger picture.
If you launched your web application in debug mode and the URL in the browser was something like http://localhost:2932/Views/Home/Index.cshtml, just drop the /Views/Home/Index.cshtml part of the URL.

HTTP Error 404.3 - Not Found ... while downloading .dae files on ASP.Net

When I try to access a file extension .dae on IIS server... I get this error:
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
Looks like I am not able to configure something on my IIS Server. Can somebody please direct me to the right places. I am using Visual Express 2012 for web.
Since directory browsing is disabled for you, only few file types are accessible for the client,
like scripts and images.
In order to allow other file types, try this link. don't forget to replace the dmg with dae of course.

Setting up Content Delivery Webserver Root Locations for Tridion

Problem Description:
Publishing JSP pages work with the following for broker.config.
<Publications DefaultRootLocation="/apps/tridion/wwwroot"
DefaultRootDataLocation="/apps/tridion/wwwroot/data">
Publication pages and directories (based on structure groups) will publish under the wwwroot directory.
I changed the root location for for pages to the following (no longer using "/apps/tridion/wwwroot").
<Publications
DefaultRootLocation="/apps/ekibemobile/jboss-eap-5.1.0/jboss-eap-5.1/jboss-as/server/default/deploy/MobileTermsConditions.war/basic"
DefaultRootDataLocation="/apps/ekibemobile/jboss-eap-5.1.0/jboss-eap-5.1/jboss-as/server/default/deploy/MobileTermsConditions.war/basic/data"
>
Publishing now returns:
A processing error occurred processing a transport package Could not deploy page
[Page id=tcm:493-637128-64 Title=010. Privacy Policy],
IO error creating new page, No such file or directory, No such file or
directory, IO error creating new page, No such file or directory, No
such file or directory
I confirmed the required permission on the above folder on the Linux webserver. I also tried the following in the node of broker.config
<Publication Id="493"
DocumentRoot="/apps/ekibemobile/jboss-eap-5.1.0/jboss-eap-5.1/jboss-as/server/default/deploy/MobileTermsConditions.war/basic"
DataRoot="/apps/ekibemobile/jboss-eap-5.1.0/jboss-eap-5.1/jboss-as/server/default/deploy/MobileTermsConditions.war"
/>
I get the same error with this config. Please suggest what I'm missing!
Some suggestions:
Double check that the directories you've specified do exist.
Ensure that the user running the deployer process has access to write to the directory
Edit both the deployer and broker configs to enable debug logging. Restart everything and repeat your test, then check the logs.
Note that the locations you have specified are configured in the broker configuration, but the deployer process is the relevant one because it will instantiate a broker.
Your best bet would be to make the changes on the deployer.config (cd_deployer_config.xml) on the Tridion Presentation Server.

IIS 7.5 doesn't run *.inc as ASP Classic

I'm setting up an ASP Classic website on Win7 x64, I have done the usual trick (Add site as Application to enable global.asa, use Classic pipeline App Pool, Enable 32-bit Applications: True, Load User Profile: False, Enable Parent Paths: True, give Everyone full access to site files, use odbc 32), and the site is up and running for *.asp files. However, I have some files named as *.inc under Includes directory, and IIS doesn't seem to be able to process them.
When I try to access http://localhost//includes/myfile.inc, I got:
HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
I tried to add a script map in Handler Mapping, similar to the one for *.asp: Request Path = *.inc, Executable = %windir%\system32\inetsrv\asp.dll, Invoke handler only if request is mapped to File, and in the ordered list this new mapping is on top. Now I got this error when request .inc:
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
Any ideas?
Why are you trying to load .inc files in the browser? This is not normal behavior. Those files are meant to be included in other files, such as the ASPs.
Blocking those files from being requested is protecting you from revealing your source code, which is what would happen if IIS did serve those files; it would just output their contents verbatum.

Custom VirtualPathProvider unable to serve URLs ending with a directory

As part of a CMS, I have created a custom VirtualPathProvider which is designed to serve a single file in place of an actual file structure. I have it set up such that if a file actually exists on the server, that file will be served. If the file does not exist, the virtual content stored for that address will be served instead. This is similar to the concept of serving a website from files stored in a database, though in this case the content is stored in XML files on the server.
This setup works perfectly when a request is made to a specific page. For example, if I ask for "www.mysite.com/foobar.aspx", the content that is stored for "foobar.aspx" will be served. Further, if I ask for "www.mysite.com/subdir/foobar.aspx", the appropriate content will also be served.
The problem is this: If I ask for something like "www.mysite.com/foobar", things begin to fall apart. If the directory exists on disk (and doesn't have a configured default page in IIS, such as index.aspx), I will get a "Directory Listing Denied" error. If the directory does not exist, I'll simply get a 404 - Resource Not Found.
I've tried several things, and so far nothing I've done has made a bit of difference. It seems as though IIS is simply noting the nonexistence of a directory (or default file in an existing directory) and serving up its own error code, without ever asking my application what to do with the request. If it ever did get to the application, I would be able to solve the problem, but as it stands, I'm quite lost. Does anyone know if there is some setting in IIS that is causing this?
I've looked for every resource I can find on the subject, and am coming up empty. I know this should be possible, because I have read tutorials on serving content from both databases and ZIP files. HELP!
p.s., I am running IIS6 and .NET 3.5
IIS will only pass a request to the ASP.NET process if it is configured to do so for the particular extension. The default is aspx, ascx, etc. In other words, if you request a .html file, ASP.NET will never see that HTTP request. Likewise for empty extension.
To change this behavior, add a wildcard mapping to the ASP.NET process. Load IIS Manager, go to the Properties for your web site and look at the Home Directory tab. Click on "Configuration" and there you will see the extension-to-applicaiton mappings.

Resources