HTTP Error 503 with is Static compression is being disabled - iis

I'm show event log on windows log
The directory specified for caching compressed content C:\Users\Dat_PC\AppData\Local\Temp\iisexpress\IIS Temporary Compressed Files\Clr4IntegratedAppPool is invalid. Static compression is being disabled.
How to fix ? Thanks everyone :(((

Check RouteConfig.cs make sure your route controller name equal to your MVC Controller name is match

Usually it comes as a warning in event viewer. In IIS, static content compression can be enabled in two levels.
site level
IIS level
Site level you don't have an option to change path. But at the IIS level you can enable and change the path as you needed.
Enable/Disable : Click on the root node of IIS. > At the right content panel > Double click on the "Compression" option. > You may change as needed from the check boxes

Related

How do I increase the maximum size for failed request logs?

I am using the Failed Request Tracing component in IIS. One of the logs it has written ends with a LOG_FILE_MAX_SIZE_TRUNCATE error.
According to the documentation, this is controlled by the maxLogFileSizeKB settings:
If failed request tracing logs exceed this value, IIS will truncate the logs at the maximum file size and specify LOG_FILE_MAX_SIZE_TRUNCATE for the trace event.
The default value is 1024.
Apparently, I am supposed to be able to configure that value by clicking the Sites node, and then opening the website default dialog box. However, that maximum log size setting doesn't seem to be in there (German screenshot, but it should be analogous in other localized versions of IIS):
The docs also explain how to change the setting directly in Web.config, but instead of the depicted <traceFailedRequestsLogging> element, I only have a <traceFailedRequests> element in my Web.config files.
Curiously, I cannot even find any Web.config file on my entire disk that contains the general settings configured for the module (e.g. the target path for the log files):
What am I doing wrong?
The actual reason behind the error message was the FREB logs were too big. By default, IIS truncates the FREB log files at 512KB. for the FREB logs there was simply too much data for the log files to complete.
To resolve the issue you could run the following commands so the next time an HTTP error was triggered you will receive the full FREB log file and it pinpointed the exact problem:
cd /d "%windir%\system32\inetsrv"
appcmd set config /section:sites -siteDefaults.traceFailedRequestsLogging.maxLogFileSizeKB:1024
note: do not forget to run the command prompt as administrator.
you could also make these changes by using the iis Manager GUI:
1)open iis manager. select server node
2)double click on the configuration editor from the middle pane.
3)in configuration editor select section "system.applicationHost/sites".set the value for maxLogFileSizeKB.
4)apply the changes and restart the iis server.
you could refer the below link for more detail:
FREB: LOG_FILE_MAX_SIZE_TRUNCATE

HTTP Error 404.3 - Not Found in Azure with asp.net MVC and WebAPI core 2.1

Hi All I am getting below error, There is no publishing error. and also checked by deploying a MVC core 2.1 application which is generated by VS 2017 and the application also contains the font file. In that it does not produce any error and runs fine. But the project its giving below exception and the details are...
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.
Most likely causes:
It is possible that a handler mapping is missing. By default, the static file handler processes all content.
The feature you are trying to use may not be installed.
The appropriate MIME map is not enabled for the Web site or application. (Warning: Do not create a MIME map for content that users should not download, such as .ASPX pages or .config files.)
If ASP.NET is not installed.
Things you can try:
In system.webServer/handlers:
Ensure that the expected handler for the current page is mapped.
Pay extra attention to preconditions (for example, runtimeVersion, pipelineMode, bitness) and compare them to the settings for your application pool.
Pay extra attention to typographical errors in the expected handler line.
Please verify that the feature you are trying to use is installed.
Verify that the MIME map is enabled or add the MIME map for the Web site using the command-line tool appcmd.exe.
To set a MIME type, use the following syntax: %SystemRoot%\windows\system32\inetsrv\appcmd set config /section:staticContent /+[fileExtension='string',mimeType='string']
The variable fileExtension string is the file name extension and the variable mimeType string is the file type description.
For example, to add a MIME map for a file which has the extension ".xyz": appcmd set config /section:staticContent /+[fileExtension='.xyz',mimeType='text/plain']
Warning: Ensure that this MIME mapping is needed for your Web server before adding it to the list. Configuration files such as .CONFIG or dynamic scripting pages such as .ASP or .ASPX, should not be downloaded directly and should always be processed through a handler. Other files such as database files or those used to store configuration, like .XML or .MDF, are sometimes used to store configuration information. Determine if clients can download these file types before enabling them.
Install ASP.NET.
Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
Detailed Error Information:
Module StaticFileModule
Notification ExecuteRequestHandler
Handler StaticFile
Error Code 0x80070032
Requested URL https://~1GpsLearning:80/Content/fonts/glyphicons-halflings-regular.woff
Physical Path D:\Program Files (x86)\SiteExtensions\Kudu\79.20129.3767\Content\fonts\glyphicons-halflings-regular.woff
Logon Method Anonymous
Logon User Anonymous
It was the issue of up-gradation from 2.0 to 2.1, SO I created a fresh application in 2.1 core and just implemented my other code as it is and every thing worked fine and is running on azure very smoothly.

How to sort the files by "Data Modified" in IIS Server 7.5?

I have enabled 'Directory Browsing' for only "logs" folder of my Web Application hosted via IIS 7.5
Whenever I type www.domain.name//logs in my Browser, I could see the log files listed.
I would like to see the files sorted by 'Date Modified',i.e, the latest log must come at top and the oldest log must be present at the bottom.
How to go about this?
Is this possible in IIS 7.5 in first place?
As far as I know there is no out of box setting/configuration available with which you can sort directory/file list displayed in browser. Of course that doesn't stop you writing your own custom HTTP module. Here is broad idea.
Intercept directory requests to your application.
In Http module handle OnPreRequestHandlerExecute event.
In even handler get directory/file list.
Create nicely formatted page which will display list from step 3. Here you can format/sort way you like it.

Reference to JS file prompts logon

I want to reference a javascript file at the bottom of a page template.
I added the .js file under cmssitemanager / development / javascript files and then added the following to the master template (portal engine):
<script src="/CMSScripts/Custom/FOO/BAR.js"></script>
When I open the page in any browser, the javascript in the file isn't executing.
When try to access the file directly in the browser at domain.com/CMSScripts/Custom/FOO/BAR.js I get redirected to the Kentico logon page.
I don't see how/where I can specify security for the CMSScripts directory, but the user should not have to be logged in to access this file.
Any suggestions?
Update with info from first answer:
We are not currently using Windows Authentication, and I verified that the application pool user account has file-system permissions. I also verified that the application can add/delete/modify files using the cmssitemanager > administration > system > files > "test files" utility which resulted in OK status for creating/deleting/modifying folders and files.
I do have Check files permission checked in cmssitemanager > settings > system > files > security. Unchecking this option does not change the behavior, including after restarting both the application and the windows services.
The site is valid and has the correct license however there was NOT a domain alias defined. I added one however this did not change the behavior.
We have not made any changes to the web.config save for connection string information. If you are referring to this documentation on CMSUseTrailingSlashOnlyForExtensionLess in the web.config, this was not previously in there however adding it did not change anything. To that end, I wasn't seeing the site trying to redirect to domain.com/CMSScripts/Custom/FOO/BAR.js/ so I truly think it's tied to some kind of security ACL that is out of order.
Here is the solution provided by user FroggEye on the Kentico DevNet forum thread on this same issue:
You're best bet is to use the syntax below. Kentico does URL processing on all directories unless excluded and you'd have to exclude the CMSScripts directory from processing which isn't hard but the code below is a better solution.
<script src="/CMSPages/GetResource.ashx?scriptfile=/CMSScripts/Custom/FOO/BAR.js" type="text/javascript"></script>
This will do 2 things:
give you a standard place to call resources from (you can get stylesheets here as well)
allow you to use the build-in minimization functions.
Charles,
This is a strange behavior, it does not normally do that.
Do you have any windows auth going on ? where you possibly removed anonymous access (in IIS) to directories in the website folder ?
Do you have Check Files permissions turned on as a Kentico Site setting? (even though I'm fairly sure that won't affect requests to the JavaScript files in JS module)
Is it a valid site (enabled and running in CMSSiteManager) and domain name with a correct license and alias ?
Any custom modifications to web.config file that possibly changed httpHandlers or modules ? And are you running the correct extensionless URL settings in web.config ?

Compress and Etag web pages - IIS7

can dynamic pages be compressed and given an etag too?
Any ideas? I'm missing Apache quite a lot. Hope someone can help! :)
To enable dynamic compression, use Microsoft Web Platform Installer to ensure that "IIS: Dynamic Content Compression" is installed. Then open up IIS Manager and click on the server (or to a site if you only want to enable this for an individual site, gets stored in web.config under site root so be careful not to overwrite), and go to Compression and ensure "Enable dynamic content compression" is ticked. This is for IIS7, let me know if you want this for IIS6.
For etags on aspx pages add to Page_PreInit (or Page_Init if Master page):
if (Request.Headers["If-None-Match"] == "somekey")
{
Response.StatusCode = (int)System.Net.HttpStatusCode.NotModified;
Response.End();
}
And to Page_Load:
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetETag("somekey");
Where somekey could be the last modified date stored in the database for the page if it's some content management system.

Resources