EzDevInfo.com

iis-8 interview questions

Top iis-8 frequently asked interview questions

PHP Manager for IIS fails to install

I am trying to install PHP on IIS 8.

Every time I start the PHP installation, PHP installs but I get the following error:

enter image description here


Source: (StackOverflow)

Why are blank pages being served with "200 OK" for asp.net errors in IIS 8.5 (Win 2012 R2)?

I've set up a new Windows 2012 R2 server running IIS 8.5.

We noticed that when an error occurs (eg the ASP.NET State Service was not running) that instead of outputting a 500 status code error screen, the request actually returns a totally blank page (only headers - with no content). We obviously need to see the errors and serving 200 OK for an error could be very problematic for indexers like Google etc or any wesite monitoring tools (which would not notify us that the site had gone offline).

On our other servers (IIS 7) we see the "yellow error screen" with a message like "could not connect to state server" (or similar).

What could possibly be wrong here? Is there some setting to globablly disable all errors (but this would be stupid if it also serves the 200 status code) or could something else be getting in the way?

The only other thing which could be interfering is we've got ISAPI_Rewrite installed on the server (but this doesn't usually cause this problem).

Thanks!


Source: (StackOverflow)

Advertisements

Authentication-Protected nuget.server

I am trying to setup an instance of nuget.server which is password protected not only for pushing packages, but also for pulling/downloading packages.

I did not see a way to do this with nuget by default, so I password protected the folder in which the nuget.server is installed with IIS (authentication based on Windows login).

I am now able to access the packages with Visual Studio (2012) which prompts for my password; however, when I try to push, I get an Internal Server Error (500). It does not ask for my authentication information.

Is it possible to protect my nuget.server this way? If so, what have I done wrong? Also, I would appreciate suggestions of a better way to authenticate the getting of packages with nuget.server.


Source: (StackOverflow)

IIS UrlRewrite is not working for IIS 8

I have just moved my website to new computer which uses IIS 8 from one has IIS 7.5. All but URL rewriting is working well. there is no error message than "HTTP Error 404.0 - Not Found" which I got. What I've only recognized is, there is an entry like RewriteModule (%SystemRoot%\system32\inetsrv\rewrite.dll) in website>modules setting page but, IIS 8 one has no same module. Even though I added same module to IIS 8, It didn't work. I'll be glad if I can have some suggestion about how to solve the problem. More info could be provided upon request..

Hope I could expressed what i mean properly.!

Thanks in advance,

alper

ps: url rules work well..


Source: (StackOverflow)

304 not modified on static files

After moving the project to the production server, I found that static files, such as images, will not be returned with status "304 not modified", although there are cache headlines like "Last-Modified" and "Expires".

Request Headers

Accept:image/webp,image/*,*/*;q=0.8
Accept-Encoding:gzip, deflate, sdch
Accept-Language:ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4,uk;q=0.2
Cache-Control:max-age=0
Connection:keep-alive
Cookie:_LANG=ru
DNT:1
Host:test.com
If-Modified-Since:Mon, 07 Sep 2015 08:46:37 GMT
If-None-Match:"1D0E949B4DCD480"
Referer:http://test.com/ru/Some/Index/
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML,     like Gecko) Chrome/45.0.2454.85 Safari/537.36

Response headers

HTTP/1.1 200 OK
Cache-Control: public
Content-Type: image/png
Expires: Tue, 08 Sep 2015 14:33:06 GMT
Last-Modified: Mon, 07 Sep 2015 08:46:37 GMT
Accept-Ranges: bytes
ETag: "1D0E949B4DCD480"
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 07 Sep 2015 14:33:06 GMT
Content-Length: 5953

At the local "IIS express" everything works correctly.

Local response headers

HTTP/1.1 304 Not Modified
Cache-Control:public
Date:Mon, 07 Sep 2015 14:38:12 GMT
Etag:"1D04A9052E17E00"

Prompt, in what could be the reason?

Web.config files are identical.

Thanks!

UPD 1:

chrome network console chrome request

UPD 2:

Local machine cache snapshot returns images

C:\Users\dev>netsh http show cachestate

Snapshot cache responses HTTP::
--------------------------------

URL-address: http://dev2-pc:1437/Views/CustomMeme/byby/img/header.jpg
Status Code: 200
Команда HTTP: GET
Тип политики кэша: Срок жизни (TTL)
Срок жизни записи в кэше (сек): 86399
Время создания: 2015.9.8:12.14.41:0
Имя очереди запросов: Clr4IntegratedAppPool{737BCE3B-FD81-4AB4-B976-A3A8C8A-94D8}
Тип содержимого: image/jpeg
Кодировка содержимого: (null)
Длина заголовков: 415
Длина содержимого: 49017
Число обращений: 3
Принудительное отключение после обслуживания: FALSE

But remote (production) server cache snapshot is empty

C:\Users\Администратор>netsh http show cachestate

Snapshot cache HTTP responses:
--------------------------------
The cache contains entries that match the specified URL-address

Source: (StackOverflow)

Windows Authentication for .net MVC 4 - how it works, how to test it

I have never used Windows Authentication for ASP.NET MVC web applications before, but Forms Authentication. Recently, I have had an ASP.NET MVC 4 web application that requires Windows Authentication implementation for users who are granted to log in my company web server. So, I have some questions regarding Windows Authentication. I am using VS 2012.

  • How does Windows Authentication work?

  • How do I implement Windows Authentication correctly in the web.config file?

  • How do I test if the Windows Authentication really works for my ASP.NET MVC 4 web site? In other words, how do I test it on my local development PC with local IIS (version 8), and on my company real web server with IIS version 7?

Thanks in advance.


Source: (StackOverflow)

How to configure Web Deploy publishing feature on IIS so developer can publish?

I control a server running IIS 8 on Windows Server 2012. I want to publish a few basic asp.net websites with the Publish option in Visual Studio 2012. There are no good/current Microsoft articles on the server configuration steps.

1) What exactly do I need to do on the server? I don't see any "web deploy" role option under the various IIS roles. I have read of some people downloading and installing "Web Deploy 3.0" from Microsoft but that file is one year old and it seems strange that I would have to download another file to use a promoted IIS file deployment option. If you are using IIS7 or IIS7.5 instead of IIS8 like me, please feel free to reply what YOU do, but let me know what version you are using.

2) Is the authentication process encrypted? For example, FTP would send passwords in plain text. FTP over SSL doesn't but setting up even a self-issued SSL cert is annoying just to get secure authentication. So what about Web Deploy? Is it safe or no?

3) Must I open port 8172 on the server's firewall? Microsoft's documentation says I "might need to".

4) On the Visual Studio side, it wants an account for authentication. Is this a Windows account on the server? Should I then right click the IIS website folder on the server and add this user there or is there some other preferred way of mapping users to websites? If so, what rights are required?

Please answer any or all of the above but please focus on the server side configuration and not the client (visual studio). Please don't suggest FTP as I am truly wanting to try Web Deploy. I am adding an IIS 7.5 tag too since some of the answers may be the same as for IIS 8.


Source: (StackOverflow)

ASP.NET Web Api 2 / EF6 first call initialization performance

The first call to our API is always extremely slow. For example, below demonstrates the CPU usage and time it takes for the first call to complete:

CPU usage

The first call can take up to 30 seconds and eats almost 100% CPU. Call 2 and 3 take 200ms (as they should). After recycling the application pool, it will do the same thing with the first call.

I've read a bit about IIS "warm-up" and done the following, but nothing has changed:

IIS 8 Application Initialization is installed:

IIS 8 Application Initialization

I have the following set in IIS:

  • Set Start Mode to AlwaysRunning:

AlwaysRunning

  • Set the Recycling Timeout to 0:

Recycling Timeout

  • Set the Idle Time-out to 0:

Idle Time-out

  • Set Preload Enabled to true on the site:

Preload Enabled

I am actually setting these in code in RoleEntryPoint.OnStart().

using (var serverManager = new ServerManager())
{
    serverManager.ApplicationPoolDefaults.ProcessModel.IdleTimeout = TimeSpan.Zero;

    foreach (var application in serverManager.Sites.SelectMany(x => x.Applications))
    {
        application["preloadEnabled"] = true;

    }

    foreach (var applicationPool in serverManager.ApplicationPools)
    {
        applicationPool.AutoStart = true;
        applicationPool["startMode"] = "AlwaysRunning";
        applicationPool.ProcessModel.IdleTimeout = TimeSpan.Zero;
        applicationPool.Recycling.PeriodicRestart.Time = TimeSpan.Zero;

    }

    serverManager.CommitChanges();
}

I am almost certain that Entity Framework could be the culprit:

  • We are generating models from around 100 tables in a EDMX model "designer".

  • We are generating precompiled views generated by EF Power Tools.

  • The following initialization is running in Application_Start():

    using (var context = new MyContext())
    {
        context.Database.Initialize(false);
    }
    

I don't have these "initialization" problems when debugging.

The following tech is being used:

  • .NET 4.5.1
  • ASP.NET Web Api 2
  • Entity Framework 6.1.1
  • IIS 8 (Azure Web Role)
  • Unity 3.5

Can anyone provide me with any other ideas or suggestions?


Source: (StackOverflow)

How to enable SMTP for IIS 8?

I can't find where to enable the SMTP on Windows 8 Pro. Surprisingly enough I didn't even find answers online. Has anyone figured this out yet?

As usual I checked that all necessary IIS components were installed:

enter image description here

Still no SMTP configuration on inetmgr:

enter image description here


Source: (StackOverflow)

Web Deploy from Visual Studio 2012 to a remote IIS 8 server

I have a remote Windows 2012 server running IIS 8 from which I am hosting a web application. My local development box is running Visual Studio 2012. Currently I am publishing my app as a web deployment package (.zip), RDP'ing to the production server, copy + pasting to a folder and deploying the application from within IIS. My question is, what changes do I need to make to deploy directly to IIS from Visual Studio 2012 using the web deploy option?

I have tried to follow this guide but it refers to a service URL which I must obtain from my hosting company. I don't have a hosting company, my server is co-located.

I am presented with the following options:

Web deploy options

Is the username and password the one I use for the RDP account? I already have Web Deploy 3.0 installed on IIS do I need to enable further settings?


Source: (StackOverflow)

aspnet_regiis.exe -ir does not work on windows 8

I am trying to deploy an ASP.NET MVC3 app to my Windows 8 box with IIS8. When I try to route to the site I get the following error:

HTTP Error 403.14 - Forbidden

Pretty much everything I can find on this issue says to run:

aspnet_regiis.exe -ir

When I run this on my Windows 8 box, I get the following message:

Microsoft Windows [Version 6.2.9200]
(c) 2012 Microsoft Corporation. All rights reserved.

C:\Users\Justin>C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe
-ir
Microsoft (R) ASP.NET RegIIS version 4.0.30319.17929
Administration utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation.  All rights reserved.
Start installing ASP.NET (4.0.30319.17929) without changing existing web 
applications to use this version of ASP.Net.  This option is not supported on 
this version of the operating system.  Administrators should instead install / 
uninstall ASP.NET 4.5 with IIS8 using the "Turn Windows Features On/Off" dialog, 
the Server Manager management tool, or the dism.exe command line tool.  For more 
details please see http://go.microsoft.com/fwlink/?LinkID=216771.
Finished installing ASP.NET (4.0.30319.17929) without changing existing web 
applications to use this version of ASP.Net.

ASP.NET 4.5 is already installed on my system.

Windows Features

My application runs correctly in Visual Studio, but I can not deploy it to save my life. I am completely at a loss on where to go from here. I have tried both integrated and classic pipeline modes for this site as well.


Source: (StackOverflow)

Visual Studio 2013 gives "Cannot add duplicate collection entry of type ‘mimeMap’"

I have a site that was built using Visual Studio 2010. When I upgraded to Visual Studio 2013, on some pages I would get an error that said:

Cannot add duplicate collection entry of type 'mimeMap' with unique key attribute 'fileExtension' set to '.mp4'.

After some searching, I found a helpful post on a blog, but since the issue was a little different and I didn't find it on stackoverflow, I thought I'd post the question and answer here.


Source: (StackOverflow)

What's the optimal "Dynamic IP Restriction Settings" in IIS8

So I have turned this on in my Azure cloud service site to try mitigate spiders and bots hitting us an absurd amount of times.

Has anyone had any experience with these settings?

Deny IP address based on the number of concurrent request: Maximum number of concurrent requests?

Deny IP address based on the number of requests over a period of time: Maximum number of request? Time period (in milliseconds)?


Source: (StackOverflow)

ASP.NET MVC 5 Web.config: "FormsAuthenticationModule" or "FormsAuthentication"

Ok so this not a big deal, but it's bugging me and I can't let it go.

So I'm using MVC 5.1 with .NET 4.5.1 and OWIN authentication. So when you create a new MVC 5 project, the following is automatically added to the Web.config to get rid of the forms authentication http module because it is no longer needed when using OWIN middleware:

<system.webServer>
    <modules>
        <remove name="FormsAuthenticationModule" />
    </modules>
</system.webServer>

Now since we are removing the module, that means it was previously added, so here is the entry registering this http module in C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config:

<httpModules>
    <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
</httpModules>

And here is the entry in C:\Windows\System32\inetsrv\config\applicationHost.config for IIS 8.5 that tells my application to use the module:

<system.webServer>
    <modules>
        <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" preCondition="managedHandler" />
    </modules>
</system.webServer>

So what is automatically added to my web config at the application level has a name attribute of "FormsAuthenticationModule" while the entries in the two server level/asp.net level config files use name attribute "FormsAuthentication". So what is going on here? It seems to me that the module won't be removed since the name attribute doesn't match. I would simply think this was a typo, but after searching online, everyone seems to be using "FormsAuthenticationModule" in the application web.config. Was this a recent change in the newer version of asp.net / iis or am I missing something?


Source: (StackOverflow)

The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security

I am getting error:

The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security

When I run below code to capture errors on Win 2K12 R2 server IIS 8.5

EventLog elog = new EventLog();
EventLog.CreateEventSource("MyApp", "Application");
EventLog.WriteEntry(Source, swError.ToString(), EventLogEntryType.Error);

I've given full access to HKLM\SYSTEM\CurrentControlSet\services\eventlog but it is not working still. What shall I do to fix it?


Source: (StackOverflow)