Directory Permissions Windows (v3.6.3)

Directory Permissions Windows (v3.6.3)

by Yoni Wolovitz -
Number of replies: 2

Hi all,

Apologies if this is an ignorant question.

I am installing Moodle on a Windows machine and, while following the installation steps, the instructions indicate that I need to secure the Moodle files and ensure that "the files are not writable by the web server user". It then goes on to list the chmod commands.

As a Windows user, however, I am not familiar with those commands, and can only change the permissions for the following users:

  • Administrator (Currently set to Full Control)
  • System (Currently set to Full Control)
  • Creator Owner (Currently set to Full Control)
  • Users (Currently set to Read and Execute)

Are the above permissions sufficient or should I modify them? If so, how should they be modified?

Many thanks in advance,

Yoni

Average of ratings: -
In reply to Yoni Wolovitz

Re: Directory Permissions Windows (v3.6.3)

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

You don't say which web server you're using.

If you are using IIS this will use an IIS user unless you've set up integrated authentication (you'll know if you've done this). By default a folder won't be writable an IIS user unless you've added access for this so your Moodle files should already be set up correctly. But the Moodledata directory must be writable by the web server user. To achieve this I follow the steps from the PHP documentation:

Determine the IIS user for your site with %windir%\system32\inetsrv\appcmd.exe list config "Default Web Site" /section:anonymousAuthentication. Default Web Site is the name that appears for your site in the IIS Manager console, if you've used something else you should change this, e.g.:

C:\inetpub>%windir%\system32\inetsrv\appcmd.exe list config "Moodle site" ^
More? /section:anonymousAuthentication

      <anonymousAuthentication enabled="true" userName="IUSR" />

In the above example the IIS user is IUSR so we need to give this write access to the Moodledata folder. So, assuming this is C:\inetpub\moodledata the command would be icacls C:\inetpub\moodledata /grant IUSRsadOI)(CI)(M):

C:\inetpub>icacls C:\inetpub\moodledata /grant IUSR:(OI)(CI)(M)
processed file: C:\inetpub\moodledata
Successfully processed 1 files; Failed processing 0 files

If you're using Apache or XAMPP the best advice is to switch to IIS. Apache on Microsoft Windows is not suitable for production sites.

Lastly, don't apologise for asking questions, that's a good rule for these forums and probably a good rule for life too.

Average of ratings: Useful (2)
In reply to Leon Stringer

Re: Directory Permissions Windows (v3.6.3)

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Looks like I need to post a forum question asking how to stop characters being replaced with emoticons.

Those sad faces are supposed to be a ':' followed by '('.