Sitecore folder & IIS permissions

耗尽温柔 提交于 2019-12-11 01:54:48

问题


When setting up or moving a Sitecore solution, you have to remember to setup the correct folder permissions and IIS permissions.

It something like sections 3.3.3.2 - 3.3.3.9 here: http://sdn.sitecore.net/Products/Sitecore%20V5/Sitecore%20CMS%205,-d-,3/Installation/EXE%20Installation.aspx

The folder permissions are usually setup when using the installer, but not when using the Zip or just moving an existing solution.

You could use the guides (for Sitecore 6) here: http://sdn.sitecore.net/Products/Sitecore%20V5/Sitecore%20CMS%206/Installation.aspx

But going through steps 3.5 to 3.6.5 is bothersome.

Anyone made any scripts or programs that could do this more or less automatically?

It will be greatly appreciated.


回答1:


Assuming you are playing around with a non-production instance:

in non-production environments, it‘s generally easiest to grant the ASP.NET account and the anonymous Internet user account Full Control of the Website and Data folders as well as all their descendants and grant the NETWORK SERVICE user full control of D:\Sitecore\Databases folder.

So (The permissions are set recursively):

ASP.NET account (IUSR in IIS 7) & Anonymous user: FULL CONTROL OVER:

  • /Website
  • /Data

NETWORK SERVICE (default SQL Server account): FULL CONTROL OVER:

  • /Databases

Alternatively you could Cacls to set permissions to a file/folder from the commandline.

For example you could use the following statement to grant the Administrator user Write AND Delete permissions on c:\file

icacls c:\file /grant Administrator:(D,WDAC)



回答2:


I am using this script

Option Explicit

Dim fso, path

' get current directory
set fso = createobject("Scripting.FileSystemObject")
path = fso.GetFolder(".").Path

WScript.StdErr.WriteLine "Setting up rights"
WScript.StdOut.WriteLine "Path:" &  path

Dim appname

appname = InputBox("Name of the App Pool", , "AppPool")

If appname = "" Then
    Wscript.Quit
End If

Dim wsShell

Set wsShell = WScript.CreateObject ("WSCript.Shell")

'wsShell.run "icacls """+ path + """ /inheritance:r"
wsShell.run "icacls """+ path + """ /inheritance:e /grant ""IIS AppPool\" + appname + """:(RX)"
wsShell.run "icacls """+ path + "\App_Data"" /inheritance:e /grant ""IIS AppPool\" + appname + """:(F)"
wsShell.run "icacls """+ path + "\sitecore\shell"" /inheritance:e /grant ""IIS AppPool\" + appname + """:(F)"
wsShell.run "icacls """+ path + "\temp"" /inheritance:e /grant ""IIS AppPool\" + appname + """:(F)"
wsShell.run "icacls """+ path + "\upload"" /inheritance:e /grant ""IIS AppPool\" + appname + """:(F)"

set wsShell = Nothing


来源:https://stackoverflow.com/questions/5156374/sitecore-folder-iis-permissions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!