“Event ID 5″ error on “DefaultAppPool”
by Subachad on May.02, 2009, under Automotive
The Template Persistent Cache initialization failed for Application Pool ‘DefaultAppPool’ because of the following error: Could not create a Disk Cache Sub-directory for the Application Pool. The data may have additional error codes.
UPDATE: I have a better fix for this after finding the Microsoft IIS Diagnostic Tool Kit. Install this tool and it will tell you what group needs to have permissions to the different folders and registry keys which will help find a solution to this issue much quicker. I’ll post my updated batch file at the end of this post.
Reviewing the logs, I ran aross this error on quite a few webservers. A closer look shows that it’s a permissions issue which can be fixed by doing the following.
Add the NT AUTHORITY\NETWORK SERVICE account to C:\WINDOWS\Help\iisHelp\common with “Read and Execute,” “List Folder Contents” and “Read”.
Add the NT AUTHORITY\NETWORK SERVICE account to C:\WINDOWS\system32\inetsrv\ASP Compiled Templates with Full Control.
Add the NT AUTHORITY\NETWORK SERVICE account to C:\WINDOWS\IIS Temporary Compressed Files with Full Control.
Seems like a lot of work when there are so many machines to make these changes to. That said, I did a little digging and found the following Command.
U:\>cacls /?
Displays or modifies access control lists (ACLs) of files
CACLS filename [/T] [/E] [/C] [/G user:perm] [/R user [...]]
[/P user:perm [...]] [/D user [...]]
filename Displays ACLs.
/T Changes ACLs of specified files in the current directory and all subdirectories.
/E Edit ACL instead of replacing it.
/C Continue on access denied errors.
/G user:perm Grant specified user access rights.
Perm can be: R Read
W Write
C Change (write)
F Full control
/R user Revoke specified user’s access rights (only valid with /E).
/P user:perm Replace specified user’s access rights.
Perm can be: N None
R Read
W Write
C Change (write)
F Full control
/D user Deny specified user access.
Wildcards can be used to specify more that one file in a command.
You can specify more than one user in a command.
Abbreviations:
CI – Container Inherit.
The ACE will be inherited by directories.
OI – Object Inherit.
The ACE will be inherited by files.
IO – Inherit Only.
The ACE does not apply to the current file/directory.
With this info, here is the batch file I ended up with.
@ECHO ~~~ Setting Network User Permissions ~~~
ECHO Y|CACLS C:\windows\help\iishelp\common /T /E /G “Network Service”:F
ECHO Y|CACLS “C:\WINDOWS\system32\inetsrv\ASP Compiled Templates” /T /E /G “Network Service”:F
ECHO Y|CACLS “C:\windows\IIS Temporary Compressed Files” /T /E /G “Network Service”:F
I was unable to get “:RWL to work, so I just set it to full.
Update: Here is the new batch file.
@ECHO ~~~ Setting Network User Permissions ~~~
ECHO Y|CACLS “%windir%\Help\iisHelp\common” /T /E /G %computername%\IIS_WPG:F
ECHO Y|CACLS “%windir%\IIS Temporary Compressed Files” /T /E /G %computername%\IIS_WPG:R
ECHO Y|CACLS “%windir%\IIS Temporary Compressed Files” /T /E /G %computername%\IIS_WPG:W
ECHO Y|CACLS “%windir%\IIS Temporary Compressed Files” /T /E /P “Creator Owner”:F
ECHO Y|CACLS “%windir%\system32\inetsrv\asp compiled templates” /T /E /G %computername%\IIS_WPG:R
ECHO Y|CACLS “%windir%\system32\inetsrv” /T /E /P “users”:F
Here is a little bonus batch file to help reinstall ASP V2
REM ~~~ Reinstalling ASP Version 2 ~~~
CD %windir%\Microsoft.NET\Framework\v2.0.50727\
aspnet_regiis -ua
REM ~~~ Low Budget Timer ~~~
ping 127.0.0.1
aspnet_regiis -i
Related Posts
- Install UVNC From Command Line or Remote Desktop
- Fixing Multiple File Extentions Using the Rename Command
- Install XP Powertoys on Windows Server 2003
Related posts brought to you by Yet Another Related Posts Plugin.

