Code Monkey home page Code Monkey logo

iisposh's Introduction

Description

Manage websites, application pools, web applications, and virtual directories in IIS 7.0,7.5,8.0

Requirements

Platforms

  • Windows Server 2008 (R1, R2)
  • Windows Server 2012 (R1, R2) (Testing In Progress)

Resource/Provider

iisposh_pool

Manage application pools in IIS

Actions

  • :create: - creates an application pool
  • :config: - configure an application pool
  • :delete: - delete an existing application pool
  • :start: - start an application pool
  • :stop: - stop an application pool
  • :restart: - restart an application pool

Attribute Parameters

  • name: name of application pool
  • properties: List of all properties to be set for application pool

Examples

# Create an application pool named TestPool with the following properties set
# recycling.periodicRestart.privatememory" = 4, processmodel.maxprocesses = 3, managedPipeLineMode = Integrated, managedRunTimeVersion = v4.0
# processModel.IdentityType = SpecificUser, Autostart = True, processmodel.username = mydomain\username, processmodel.password = mypassword, recycling.logEventOnRecycle = Time,Requests,IsapiUnhealthy,OnDemand,ConfigChange

iisposh_pool 'pool' do 
	name "TestPool"
	properties(
			"recycling.periodicRestart.privatememory" => 4,
			"processmodel.maxprocesses" => 3,
			"managedPipeLineMode" => "Integrated",
			"managedRunTimeVersion" => "v2.0",
			"processModel.IdentityType" => "SpecificUser",
			"autostart" => "True",
			"processmodel.username" => "mydomain\\username",
			"processmodel.password"	=> "mypassword",
			"recycling.logEventOnRecycle" => "Time,Requests,IsapiUnhealthy,OnDemand,ConfigChange"	
	)
	action :create
end

# Delete the TestPool Application Pool

iisposh_pool 'pool' do 
	name "TestPool"
	action :delete
end

iisposh_website

Allows easy management of IIS Websites

Actions

  • :create: - creates a new website
  • :config: - configure a website
  • :delete: - delete an existing website
  • :start: - start a website
  • :stop: - stop a website
  • :restart: - restart a website

Attribute Parameters

  • name: name of website
  • path: Physical path of website files
  • pool: Application pool of the website
  • properties: List of all properties to be set for website
  • bindings: Set website web bindings [["protocol", "port#","hostheader", "IPAddress"]]
  • powershell_code: String used to convert ruby hashtable to powershell hashtable
  • binding_string: String used to convert ruby array into format usable by powersehll

Examples

create a new website at the location C:\inetpub\wwwroot\testsite with default binding of port 80

iisposh_website 'website' do 
	name "TestSite"
	action :create
end

# create a new website at the location C:\inetpub\wwwroot\testsite with the following properties set
# name = TestSite, applicationPool = TestPool, ServerAutoStart = True, logFile.logFormat = W3C, logfile.deirectory = c:\weblogs, logfile.logExtFileFalgs = Date,Time,ClientIP,ServerIP,Method,UriStem,UriQuery,HttpStatus,BytesSent,TimeTaken,UserAgent
# bindings = http,3030

iisposh_website 'website' do 
	name "TestSite"
	bindings [["http", "3030", "", ""]]
	properties(
			"applicationPool" => "TestPool",
			"physicalPath"	=> "c:\\inetpub\\wwwroot\\testsite",
			"ServerAutoStart" => "True",
			"logfile.logformat" => "W3C",
			"logfile.directory" => "c:\\weblogs",
			"logfile.logExtFileFlags" => "Date,Time,ClientIP,ServerIP,Method,UriStem,UriQuery,HttpStatus,BytesSent,TimeTaken,UserAgent"
	)
	action :create
end

# Delete the TestSite website

	iisposh_website 'website' do 
		name "TestSite"
		action :delete
	end
	
# configure a website with the following properties
# name = TestSite, applicationPool = TestPool, ServerAutoStart = True, logFile.logFormat = W3C, logfile.deirectory = c:\weblogs, logfile.logExtFileFalgs = Date,Time,ClientIP,ServerIP,Method,UriStem,UriQuery,HttpStatus,BytesSent,TimeTaken,UserAgent
# bindings = http,3030	
	
iisposh_website 'website' do 
	name "TestSite"
	bindings [["http", "3030", "", ""]]
	properties(
			"applicationPool" => "TestPool",
			"physicalPath"	=> "c:\\inetpub\\wwwroot\\testsite",
			"ServerAutoStart" => "True",
			"logfile.logformat" => "W3C",
			"logfile.directory" => "c:\\weblogs",
			"logfile.logExtFileFlags" => "Date,Time,ClientIP,ServerIP,Method,UriStem,UriQuery,HttpStatus,BytesSent,TimeTaken,UserAgent"
	)
	action :config
end	

# configure a website with the following properties
# name = TestSite, applicationPool = TestPool, ServerAutoStart = True, logFile.logFormat = W3C, logfile.deirectory = c:\weblogs, logfile.logExtFileFalgs = Date,Time,ClientIP,ServerIP,Method,UriStem,UriQuery,HttpStatus,BytesSent,TimeTaken,UserAgent
	
iisposh_website 'website' do 
	name "TestSite"
	properties(
			"applicationPool" => "TestPool",
			"physicalPath"	=> "c:\\inetpub\\wwwroot\\testsite",
			"ServerAutoStart" => "True",
			"logfile.logformat" => "W3C",
			"logfile.directory" => "c:\\weblogs",
			"logfile.logExtFileFlags" => "Date,Time,ClientIP,ServerIP,Method,UriStem,UriQuery,HttpStatus,BytesSent,TimeTaken,UserAgent"
	)
	action :config
end	

# restart the TestSite website

iisposh_website 'website' do 
	name "TestSite"
	action :resetart
end

iisposh_webapp

Manage web applications in IIS

Actions

  • :create: - create a web application
  • :config: - configure a web application
  • :delete: - delete a web application

Attribute Parameters

  • name: Name of web application
  • path: Physical Path of web application files
  • site: Name of the website in which the web application belongs to
  • pool: Name of the Application Pool the web application runs under
  • properties: List of properties to be set for the application pool

Examples

# Create a web application named "TestApp" located at "c:\temp" under the "TestSite" running under the "TestPool" application pool

iisposh_webapp 'webapp' do 
	name "TestApp"
	pool "TestPool"
	site "TestSite"
	path "c:\\temp"
	properties(
		"username" => "",   # example:  domain\\username
		"password" => ""
	)
	action :create 
end

# Delete the "TestApp" web application under the "TestSite" website

iisposh_webapp 'webapp' do 
	name "TestApp"
	site "TestSite"
	action :delete 
end

iisposh_vdir

Manage Virtual Directories in IIS

Actions

  • :create: - create a virtual directory
  • :config: - configure a virtual directory
  • :delete: - delete a virtual directory

Attribute Parameters

  • name: Name of virtual directory
  • path: Physical Path of virtual directory files
  • site: Name of the website in which the virtual directory belongs to
  • properties: List of properties to be set for the virutal directory

Examples

# Create a virtual directory named "TestDir" under the "TestSite" website with a path of c:\Temp with the following properties set
# logonMetohod = ClearText, AllowSubDir Config = True

iisposh_vdir 'vdir' do 
	name "Testdir"
	site "TestSite"
	path "c:\\temp"
	properties(
		"logonMethod" => "ClearText",
		"allowSubDirConfig" => "True"
		
	)
	
	action :create
end

# Delete the "TestDir" Virtual Director in the "TestSite" website

iisposh_vdir 'vdir' do 
	name "Testdir"
	site "TestSite"
	action :delete
end

Helpers

  • See powershell folder
    • Wrote a powershell script to help discover settings of currently deployed components in IIS. Pools, WebApps, Sites etc
  • files\default\test.ps1
    • To aid in testing of powershell outside of chef and LWRPs, test.ps1 was created to help test the different function calls.

Author

iisposh's People

Contributors

dljohnson300 avatar carpnick avatar

Stargazers

 avatar Joseph Chiocchi avatar Karsten Müller avatar

Watchers

Ryan B Leach avatar James Cloos avatar Michelle Milton avatar  avatar Jacob avatar

iisposh's Issues

Unable to set net.tcp binding for website

Within the code it is using New-WebBinding commandlet to setup bindings. The New-WebBinding has a defect where it does not set net.tcp binding properly. It will set to

*:808:

when

808:*

is needed.

https://github.com/ebsco/iisposh/blob/master/files/default/websites.ps1#L252

Threads that show issue with commandlet

Workaround:
Run the following using Powershell Resource
Set-ItemProperty "IIS:\\Sites\\YOURWEBSITE" -name bindings -value (@{protocol="net.tcp";bindingInformation="808*"},@{protocol="http";bindingInformation="*:80:"})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.