Posts

Showing posts with the label iis

c# : programatically disable IIS AppPool Recycling

using System; using System.Text; using Microsoft.Web.Administration; using System.Linq; internal static class Sample {     private static void Main( string [] args)     {         using ( ServerManager serverManager = new ServerManager ())         {             foreach ( var ap in serverManager.ApplicationPools)             {                ap.Recycling.PeriodicRestart.Time = TimeSpan .Zero;             }             serverManager.CommitChanges();         }     } }

Resolve bad gateway error on nginx configured as reverse proxy with HTTPs support (front and back end)

If you get the message "502 Bad Gateway" from your nginx reverse proxy but you've checked that your IIS server is reachable and the website is working fine, check that at least one of the websites binded on IIS with HTTPS support is NOT configured with SNI, even if this is not one website that should be accessible from your proxy. Long story short : the following command should return SSL certificate information, even if it is not from the certificate you expect to get in order to get nginx connection to IIS to work: openssl s_client -connect myserver.mynetwork.local:443

Update Environment Variable in IIS Process

If you've updated your environment variables and want to reflect your changes in an IIS process or app pool, e.g. the php process, use the command iisreset.  Using the GUI to restart the process wont work as expected. #1

Resolve error 404 when using Web Deploy feature on IIS

Image
If you get an error 404 with the following message: Error Code: ERROR_DESTINATION_NOT_REACHABLE More Information: Could not connect to the remote computer. On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started. Learn more at http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE. Error: The remote server returned an error: (404) Not Found. Error count: 1. when trying to deploy your application using web deploy but the web deploy component has already been installed using the web platform in IIS , download the full installer HERE, choose the [Change] option and on the root of the tree select the option to install the entire feature: