Exemple #1
0
        static void Main(string[] args)
        {
            var logger = new ConsoleLogger();
            var serverConfig = new WebServerConfig(logger);

            if (!serverConfig.IsIis7OrAbove)
            {
                logger.LogHeading("IIS7 is not installed on this machine. IIS configuration setup terminated.");
                return;
            }

            var envConfig = new Config();

            try
            {
                serverConfig
                    .AddAppPool(envConfig.SiteName, "v4.0", ManagedPipelineMode.Integrated, ProcessModelIdentityType.LocalService)
                    .WithProcessModel(envConfig.IdleTimeout, envConfig.PingingEnabled)
                    .Commit();

                serverConfig
                    .AddSite(envConfig.SiteName, envConfig.PortNumber, envConfig.PortNumber)
                    .AddApplication("/", envConfig.WebRoot, envConfig.SiteName)
                    .WithLogging(false)
                    .Commit();
            }
            catch (Exception e)
            {
                logger.LogError(e);
            }
        }
Exemple #2
0
        public void should_set_private_memory_limit()
        {
            var webServerConfig = new WebServerConfig(new LoggerStub());

            webServerConfig
            .AddAppPool(TestAppPoolName, "v2.0", ManagedPipelineMode.Integrated, ProcessModelIdentityType.LocalService, 666)
            .Commit();

            var serverManger = new ServerManager();
            var appPool      = serverManger.ApplicationPools[TestAppPoolName];

            Assert.That(appPool.Recycling.PeriodicRestart.PrivateMemory, Is.EqualTo(666));
        }
Exemple #3
0
        public void should_create_apppool_with_timeout_and_pinging_not_enabled()
        {
            var webServerConfig = new WebServerConfig(new LoggerStub());

            webServerConfig
            .AddAppPool(TestAppPoolName, "v2.0", ManagedPipelineMode.Integrated, ProcessModelIdentityType.LocalService)
            .WithProcessModel(TimeSpan.FromDays(1), false)
            .Commit();

            var serverManger = new ServerManager();
            var appPool      = serverManger.ApplicationPools[TestAppPoolName];

            Assert.That(appPool.ProcessModel.PingingEnabled, Is.False);
            Assert.That(appPool.ProcessModel.IdleTimeout, Is.EqualTo(TimeSpan.FromDays(1)));
        }
Exemple #4
0
        public void should_create_app_pool()
        {
            var webServerConfig = new WebServerConfig(new LoggerStub());

            webServerConfig
            .AddAppPool(TestAppPoolName, "v2.0", ManagedPipelineMode.Integrated, ProcessModelIdentityType.LocalService)
            .Commit();

            var serverManger = new ServerManager();
            var appPool      = serverManger.ApplicationPools[TestAppPoolName];

            Assert.That(appPool.ManagedRuntimeVersion, Is.EqualTo("v2.0"));
            Assert.That(appPool.ManagedPipelineMode, Is.EqualTo(ManagedPipelineMode.Integrated));
            Assert.That(appPool.ProcessModel.IdentityType, Is.EqualTo(ProcessModelIdentityType.LocalService));
        }
Exemple #5
0
        public void should_create_apppool_with_apppool_queuelength_and_rapid_fail_protection()
        {
            var webServerConfig = new WebServerConfig(new LoggerStub());

            webServerConfig
            .AddAppPool(TestAppPoolName, "v2.0", ManagedPipelineMode.Integrated, ProcessModelIdentityType.LocalService)
            .WithAppPoolQueueLength(10)
            .WithRapidFailProtection(true)
            .Commit();

            var serverManger = new ServerManager();
            var appPool      = serverManger.ApplicationPools[TestAppPoolName];

            Assert.That(appPool.QueueLength, Is.EqualTo(10));
            Assert.That(appPool.Failure["RapidFailProtection"].ToString(), Is.EqualTo("True"));
        }
Exemple #6
0
		public void Start()
		{
			var logger = new ConsoleLogger();
			var serverConfig = new WebServerConfig(logger);

			// Current directory: src\Roadkill.Tests\bin\Debug
			string webRoot = Environment.CurrentDirectory + @"..\..\..\..\Roadkill.Web";
			var dirInfo = new DirectoryInfo(webRoot);

			serverConfig
				.AddAppPool(_siteName, "v4.0", ManagedPipelineMode.Integrated, ProcessModelIdentityType.LocalService)
				.WithProcessModel(TimeSpan.FromMinutes(60), false)
				.Commit();

			serverConfig
				.AddSite(_siteName, _webPort, _webPort)
				.AddApplication("/", dirInfo.FullName, _siteName)
				.WithLogging(false)
				.Commit();
		}