terça-feira, 9 de abril de 2013

Dicas de gerenciamento do IIS pelo prompt de comandos

Associate an application pool to site with appcmd
http://stackoverflow.com/questions/4470671/associate-an-

application-pool-to-site-with-appcmd
appcmd add site /name:"prova" bindings:http://localhost:8080

/physicalPath:c:\sites\prova
APPCMD.exe set app "prova/" /applicationPool:""

---------------

How do I add a new website in IIS 7 using a script?
http://serverfault.com/questions/44598/how-do-i-add-a-new-website-

in-iis-7-using-a-script
appcmd add site /name:contoso /id:2 /physicalPath:c:\contoso

/bindings:http/*:80: marketing.contoso.com


---------------

Configuring IIS 7 from the command line using Appcmd.exe (Part 1)
http://www.windowsnetworking.com/articles-tutorials/windows-server-

2008/Configuring-IIS-7-command-line-Appcmdexe-Part1.html
How do I use AppCmd.exe?

There are a couple things you need to know about using AppCmd, even

before you execute your first AppCmd.exe command.
 1.You have to have IIS 7.x installed to get the AppCmd.exe command.
2.You need to know where the AppCmd.exe command is located as it is

not in the default PATH. In order to run AppCmd.exe, you will either

need to change directory into %windir%\system32\inetsrv\ or add that

directory to your PATH variable. On my Windows 2008 server with a

default installation, AppCmd.exe was located in C:\Windows

\System32\inetsrv.

Just like other Windows commands, you can get the basics of how to

use the command by typing AppCmd.exe /?

You will find that the general command layout is:

APPCMD (command) (object-type) < /parameter1:value1 ...

>*

Note:
Do not let the slightly complex command layout scare you –

AppCmd.exe is very easy to use. Let me show you how.

The basic commands used with AppCmd.exe are start, stop, list, add,

delete, and set. Typically, each of these commands would be used

with an object type that you are asking AppCmd.exe to perform the

requested function on.

Possibilities of the object type are:
 •Site – IIS virtual site
•App – IIS application
•Vdir – IIS virtual directory
•Apppool – IIS application pool
•Config – IIS general configuration
•Backup – IIS server configuration backups (and the restore command

is also available)
•Wp – IIS worker processes
•Request – active HTTP requests
•Module – IIS server administration modules
•Trace – IIS server trace logs

As you can see, there is a lot you can do with AppCmd.exe but it

does not have to be difficult it you use help along the way.

---------------

Application Pool Defaults
http://www.iis.net/configreference/system.applicationhost/applicationpools/applicationpooldefaults

---------------

How do I change the physical path of web site in IIS7 with APPCMD?
http://stackoverflow.com/questions/1619308/how-do-i-change-the-physical-path-of-web-site-in-iis7-with-appcmd
C:\Windows\System32\inetsrv>appcmd set vdir "MySite/" -physicalPath:"C:\inetpub\temp"
Even more specifically, if you want to know what settings you can change for the specific virtual directory type:appcmd set vdir "MySite/" /?


---------------

Nenhum comentário: