Install Windows IIS
This article applies to: Managed Servers
Installing IIS
- On the Start menu, select , and then select . You can also right-click Computer, and then select .
- Click
, and then click . - Click
. - On the Before You Begin screen, click .
- Select
, and then click . Depending on your set up, you may see a box asking if you want to Add features required for Web Server (IIS). Click . - On the Select Role Services screen, either accept the defaults or make other selections if required based on your vendor's documentation.
- Click .
- Click
. When the installation is finished, the new role service is available in the Server Manager.
Set Location to Store Log Files
IIS creates log files. You should set a location on the e:/ drive to store the log files.
The step-by-step information about how to set this location is available on the Microsoft site here: http://technet.microsoft.com/en-us/library/cc732826(v=ws.10).aspx.
Purge Log Files
Best practice: Periodically purge log files.
Note: The following script is provided as a sample. The Systems Support group does not offer support for this script. Be sure you understand its function before implementing it.
#------ Script File---- Put into a file called "purger.ps1"
param ($source_folder, $days_to_delete)
function purge-folder ($sourcedir, [int]$days) {
if (-not (test-path $sourcedir)) {
write-output "Path does not exist"
quit
}
$lastwrite = (get-date).AddDays(-$days)
Foreach ($file in (gci $sourcedir -recurse | where {$_.lastwritetime -le $lastwrite})) {
write-output "Deleting $($file.fullname)"
remove-item $file.fullname
}
}
purge-folder $source_folder $days_to_delete
#------ End Script File
- Create a new text file with the script information, called “purger.ps1”. Copy the purger.ps1 file to the system you will be using.
- Run it with the following parameters:
- Source_folder - The full path of the folder to purge. Put folder path with spaces in quotes
- days_to_delete - The number of days a file has to be old before it will be deleted. (Anything older than the current date/time - (24 hours * days_to_delete) will be deleted)
Ex: .\purger.ps1 c:\windows\system32\logfiles\ 30
Comments?
To share feedback about this page or request support, log in with your NetID