Showing posts with label IIS. Show all posts
Showing posts with label IIS. Show all posts
2
As of IIS 8 Application Initialization is part of the IIS feature set. For IIS 7 and 7.5 there's a separate download available via Web Platform Installer. Using IIS 8 Application Initialization is an optional install component in Windows or the Windows Server Role Manager:

This is an optional component so make sure you explicitly select it.
IIS Configuration for Application Initialization
Initialization needs to be applied on the Application Pool as well as the IIS Application level. As of IIS 8 these settings can be made through the IIS Administration console.
Start with the Application Pool:

Here you need to set both the Start Automatically which is always set, and the StartMode which should be set to AlwaysRunning. Both have to be set - the Start Automatically flag is set true by default and controls the starting of the application pool itself while Always Running flag is required in order to launch the application. Without the latter flag set the site settings have no effect.
Now on the Site/Application level you can specify whether the site should pre load:

At this point ASP.NET apps should auto-load. This is all that's needed to pre-load the site if all you want is to get your site launched automatically.
If you want a little more control over the load process you can add a few more settings to your web.config file that allow you to show a static page while the App is starting up. This can be useful if startup is really slow, so rather than displaying blank screen while the user is fiddling their thumbs you can display a static HTML page instead:
This allows you to specify a page to execute in a dry run. IIS basically fakes request and pushes it directly into the IIS pipeline without hitting the network. You specify a page and IIS will fake a request to that page in this case ping.ashx which just returns a simple OK string - ie. a fast pipeline request. This request is run immediately after Application Pool restart, and while this request is running and your app is warming up, IIS can display an alternate static page - Startup.htm above. So instead of showing users an empty loading page when clicking a link on your site you can optionally show some sort of static status page that says, "we'll be right back". I'm not sure if that's such a brilliant idea since this can be pretty disruptive in some cases. Personally I think I prefer letting people wait, but at least get the response they were supposed to get back rather than a random page. But it's there if you need it.
Note that the web.config stuff is optional. If you don't provide it IIS hits the default site link (/) and even if there's no matching request at the end of that request it'll still fire the request through the IIS pipeline. Ideally though you want to make sure that an ASP.NET endpoint is hit either with your default page, or by specify the initializationPage to ensure ASP.NET actually gets hit since it's possible for IIS fire unmanaged requests only for static pages (depending how your pipeline is configured).
https://weblogs.asp.net/scottgu/auto-start-asp-net-applications-vs-2010-and-net-4-0-series
Posted on 6:42 AM by Softminer and filed under
IIS
As of IIS 8 Application Initialization is part of the IIS feature set. For IIS 7 and 7.5 there's a separate download available via Web Platform Installer. Using IIS 8 Application Initialization is an optional install component in Windows or the Windows Server Role Manager:

This is an optional component so make sure you explicitly select it.
IIS Configuration for Application Initialization
Initialization needs to be applied on the Application Pool as well as the IIS Application level. As of IIS 8 these settings can be made through the IIS Administration console.
Start with the Application Pool:

Here you need to set both the Start Automatically which is always set, and the StartMode which should be set to AlwaysRunning. Both have to be set - the Start Automatically flag is set true by default and controls the starting of the application pool itself while Always Running flag is required in order to launch the application. Without the latter flag set the site settings have no effect.
Now on the Site/Application level you can specify whether the site should pre load:

At this point ASP.NET apps should auto-load. This is all that's needed to pre-load the site if all you want is to get your site launched automatically.
If you want a little more control over the load process you can add a few more settings to your web.config file that allow you to show a static page while the App is starting up. This can be useful if startup is really slow, so rather than displaying blank screen while the user is fiddling their thumbs you can display a static HTML page instead:
This allows you to specify a page to execute in a dry run. IIS basically fakes request and pushes it directly into the IIS pipeline without hitting the network. You specify a page and IIS will fake a request to that page in this case ping.ashx which just returns a simple OK string - ie. a fast pipeline request. This request is run immediately after Application Pool restart, and while this request is running and your app is warming up, IIS can display an alternate static page - Startup.htm above. So instead of showing users an empty loading page when clicking a link on your site you can optionally show some sort of static status page that says, "we'll be right back". I'm not sure if that's such a brilliant idea since this can be pretty disruptive in some cases. Personally I think I prefer letting people wait, but at least get the response they were supposed to get back rather than a random page. But it's there if you need it.
Note that the web.config stuff is optional. If you don't provide it IIS hits the default site link (/) and even if there's no matching request at the end of that request it'll still fire the request through the IIS pipeline. Ideally though you want to make sure that an ASP.NET endpoint is hit either with your default page, or by specify the initializationPage to ensure ASP.NET actually gets hit since it's possible for IIS fire unmanaged requests only for static pages (depending how your pipeline is configured).
https://weblogs.asp.net/scottgu/auto-start-asp-net-applications-vs-2010-and-net-4-0-series
92
This problem happens when your asp.net application runs on web farms
Adding enableViewStateMac="false" to webform may solve the problem but it's not recommended.
BY IIS 7

Posted on 2:02 AM by Softminer and filed under
IIS
This problem happens when your asp.net application runs on web farms
Adding enableViewStateMac="false" to webform may solve the problem but it's not recommended.
BY IIS 7
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.web> <machineKey decryptionKey="xx,IsolateApps" validationKey="xxx,IsolateApps" /> </system.web> </configuration>To generate using Power shell use this instruction http://support.microsoft.com/kb/2915218 Copy and paster powershell script into file, while running you may get security error. To remove security try x86 Open C:\Windows\system32\cmd.exe Run the command powershell Set-ExecutionPolicy RemoteSigned x64 Open C:\Windows\SysWOW64\cmd.exe Run the command powershell Set-ExecutionPolicy RemoteSigned and to set back to default powershell Set-ExecutionPolicy Restricted Power shell Execution Policies
0
IIS logs can be setup from IIS\Website\Logging
and the default path is %SystemDrive%\inetpub\logs\LogFiles
for debugging an ASP.net application performance also from VS 2012 / Analyze / Start Performance Analysis
Process Monitor is also advance monitoring tools form microsoft
http://technet.microsoft.com/en-us/sysinternals/bb896645
Debug Diagnostic Tool can be used for monitoring application pool usage.
http://www.microsoft.com/en-us/download/details.aspx?id=26798
How to user diagnostic tool
+
Every Application pool has its own w3wp.exe which is running on application pool identity.
From Features View of IIS Click on "Worker Processes", the request can be seen for each process of application pool.
IIS logs can be setup from IIS\Website\Logging
and the default path is %SystemDrive%\inetpub\logs\LogFiles
for debugging an ASP.net application performance also from VS 2012 / Analyze / Start Performance Analysis
Process Monitor is also advance monitoring tools form microsoft
http://technet.microsoft.com/en-us/sysinternals/bb896645
Debug Diagnostic Tool can be used for monitoring application pool usage.
http://www.microsoft.com/en-us/download/details.aspx?id=26798
How to user diagnostic tool
+
Every Application pool has its own w3wp.exe which is running on application pool identity.
From Features View of IIS Click on "Worker Processes", the request can be seen for each process of application pool.
0
This is PHP file to print date time
This is PHP file to print date time
<?php print date('D, d M Y H:i:s T'); ?>Browser to: http://localhost/date.php ---------------------------------------------------------------------------------- you see that page is cached after 3 calls, if you setup cache rules in web.config CACHING INTRICACIES Even if you enable Output Caching, IIS does not immediately cache a request. It must be requested a few times before IIS considers a request to be "cache worthy". Cache worthiness can be configured via the ServerRuntime section described in this MSDN article. http://msdn.microsoft.com/en-us/library/ms690574 By default, when you create a cache rule a page is cached when it is requested 2 times within a 10 second time period. You can change these default values by first making a change to your applicationHost.config file and then updating your web.config file. Your applicationHost.config file is typically in the c:\Windows\System32\inetsrv\config directory and is most easily opened with Notepad from a command prompt with administrator privileges. In that file, find the following entry (a child of theelement): . Change Deny to Allow and save the file. and finally to view the files in cache following command should be run netsh http show cachestate Refrence<sectionGroup name="system.webServer"> <section name="serverRuntime" overrideModeDefault="Allow" /> </sectionGroup>---------------------------------------------------------------------------------- Then in web.config Refrence <configuration> <system.webServer> <serverRuntime frequentHitThreshold="3" frequentHitTimePeriod="00:00:20" /> <caching> <profiles> <add extension=".php" policy="DontCache" kernelCachePolicy="CacheForTimePeriod" duration="00:05:30" /> </profiles> </caching> </system.webServer> </configuration>
0
Usually when you install .net framework 4 you have following application pool:
ASP.NET v4.0
ASP.NET v4.0 Classic
if you have already .net framework 4 and you don't see application pool do the following steps:
Open your command prompt as administrator
Type cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\ and press ENTER.
Type aspnet_regiis.exe -ir and press ENTER again.
If this is a fresh version of IIS (no other sites running on it) or you're not worried about the hosted sites breaking with a framework change you can use -i instead of -ir.
You should now see ASP.NET v4.0 listed
+
Posted on 1:49 AM by Softminer and filed under
IIS
Usually when you install .net framework 4 you have following application pool:
ASP.NET v4.0
ASP.NET v4.0 Classic
if you have already .net framework 4 and you don't see application pool do the following steps:
Open your command prompt as administrator
Type cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\ and press ENTER.
Type aspnet_regiis.exe -ir and press ENTER again.
If this is a fresh version of IIS (no other sites running on it) or you're not worried about the hosted sites breaking with a framework change you can use -i instead of -ir.
You should now see ASP.NET v4.0 listed
+
0
Every folder could have different cache (different web.config)
In the Home pane, double-click HTTP Response Headers.
In the HTTP Response Headers pane, click Set Common Headers... in the Actions pane.
In the Set Common HTTP Response Headers dialog box, check the box to expire Web content, select the option to expire after a specific interval or at a specific time, and then click OK.
More Info (Client Cache)
Every folder could have different cache (different web.config)
In the Home pane, double-click HTTP Response Headers.
In the HTTP Response Headers pane, click Set Common Headers... in the Actions pane.
In the Set Common HTTP Response Headers dialog box, check the box to expire Web content, select the option to expire after a specific interval or at a specific time, and then click OK.
More Info (Client Cache)
0
To increase fastCGI PHP_FCGI_MAX_REQUESTS,
On the server level, double-click FastCGI Settings.
Select the FastCGI application that you want to configure. In the Actions pane, click Edit....
In the Edit FastCGI Application dialog box, set the InstanceMaxRequests to 10000. Next to the EnvironmentVariables setting, click the Browse (...) button.
In the EnvironmentVariables Collection Editor dialog box, add the PHP_FCGI_MAX_REQUESTS environment variable and set its value to 10000.
Note: If you do not configure these settings, the following default settings will be used: instanceMaxRequests = 200, PHP_FCGI_MAX_REQUESTS = 500 (on most PHP builds).
To increase fastCGI PHP_FCGI_MAX_REQUESTS,
On the server level, double-click FastCGI Settings.
Select the FastCGI application that you want to configure. In the Actions pane, click Edit....
In the Edit FastCGI Application dialog box, set the InstanceMaxRequests to 10000. Next to the EnvironmentVariables setting, click the Browse (...) button.
In the EnvironmentVariables Collection Editor dialog box, add the PHP_FCGI_MAX_REQUESTS environment variable and set its value to 10000.
Note: If you do not configure these settings, the following default settings will be used: instanceMaxRequests = 200, PHP_FCGI_MAX_REQUESTS = 500 (on most PHP builds).
2
Open IIS Manager, and then move to the server level.
Double-click Handler Mappings.
In the Actions pane, click Add Module Mapping.
In the Add Module Mapping dialog box, specify the configuration settings as follows:
Request path: *.php
Module: FastCgiModule
Executable: C:\[Path to your PHP installation]\php-cgi.exe
Name: PHPviaFastCGI
Click OK.
In the dialog box that asks you to confirm that you want to create a FastCGI application for the executable, click Yes.
To verify that the handler mapping works correctly, create a Phpinfo.php file in the C:\inetpub\wwwroot folder that contains the following:
Open a Web browser, and then navigate to http://localhost/phpinfo.php. If everything was set up correctly, you will see the standard PHP information page.
+
+
PS: if you get "Error Code 0c8007010b" it because of application pool which is different in Plesk
another solution:
Granted Read & execute, List folder contents for Everyone on folder
C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5
and now php is up and running for every Application Pool. The main problem with plesk was, only sites running with Application Pool Identity of a user which is member of psacln.
Open IIS Manager, and then move to the server level.
Double-click Handler Mappings.
In the Actions pane, click Add Module Mapping.
In the Add Module Mapping dialog box, specify the configuration settings as follows:
Request path: *.php
Module: FastCgiModule
Executable: C:\[Path to your PHP installation]\php-cgi.exe
Name: PHPviaFastCGI
Click OK.
In the dialog box that asks you to confirm that you want to create a FastCGI application for the executable, click Yes.
To verify that the handler mapping works correctly, create a Phpinfo.php file in the C:\inetpub\wwwroot folder that contains the following:
Open a Web browser, and then navigate to http://localhost/phpinfo.php. If everything was set up correctly, you will see the standard PHP information page.
+
+
PS: if you get "Error Code 0c8007010b" it because of application pool which is different in Plesk
another solution:
Granted Read & execute, List folder contents for Everyone on folder
C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5
and now php is up and running for every Application Pool. The main problem with plesk was, only sites running with Application Pool Identity of a user which is member of psacln.
0
First you have to enable CGI
WINDOWS SERVER 2008
Go to Server Manager -> Roles -> Add Role Services. On the Select Role Services page, select the CGI check box. This enables both the CGI and FastCGI services.
Windows Visa/7
Go to Control Panel -> Programs and Features -> Turn Windows features on or off. In the Windows Features dialog box, select the CGI check box. This enables both the CGI and FastCGI services.
Then from Web Platform installer install "PHP Manager for IIS"
First you have to enable CGI
WINDOWS SERVER 2008
Go to Server Manager -> Roles -> Add Role Services. On the Select Role Services page, select the CGI check box. This enables both the CGI and FastCGI services.
Windows Visa/7
Go to Control Panel -> Programs and Features -> Turn Windows features on or off. In the Windows Features dialog box, select the CGI check box. This enables both the CGI and FastCGI services.
Then from Web Platform installer install "PHP Manager for IIS"
1
To connect to remote IIS in the network from your local IIS you can use
IIS Manager for Remote administration.
It can also be installed from webplatform installer
To connect to remote IIS in the network from your local IIS you can use
IIS Manager for Remote administration.
It can also be installed from webplatform installer


