Topic on Project:Support desk

After migrating a wiki to a new server, my subdirectory permissions are essentially all 777...

7
Drewsaur (talkcontribs)

I manually fixed the top-level subdirectory permissions to match those of a fresh install, but is there a script somewhere that can re-establish the expected permissions of the subdirectories recursively for the sub-sub directories and elements? FWIW, I am on MediaWiki 1.35.5. Thanks!

Bawolff (talkcontribs)
Drewsaur (talkcontribs)

Yes I am quite aware of that flag, but not all of the permissions for each file are supposed to be the same, I could see from the new install. So that won't work...!

Bawolff (talkcontribs)

There is no one right answer for permissions and ownership of mediawiki files - it depends on how your system is setup.

but generally speaking, images subdirectory needs to be readable and writable by the webserver, LocalSettings.php should be readable by webserver but not other users (contains db pass) and should not be writable by webserver, everything else should be readable by webserver but not writable by webserver.

$wgCacheDirectoty, if set, must be readable and writable by webserver, generally it should be outside of web root. For best security ensure php is disabled in images directory.

Drewsaur (talkcontribs)

Understood. I am only referring to the permissions for the standard install directories and their subcontents, which are standard for a given release, such as docs, includes, languages, maintenance, resources, skins, vendor, etc. There are canonical permissions for those that are defined at install time. Other systems I have worked with have permissions-fixings scripts to fix things like this, and I am hoping something similar exists, or that there is at least a document from mediawiki that details the default install permissions for those directories and their contents. Thanks again!

Bawolff (talkcontribs)

If you are looking for a specific number, you probably want 644 on files 755 on directories. There is no mediawiki specific script

Drewsaur (talkcontribs)

Thank you - very helpful!

Reply to "After migrating a wiki to a new server, my subdirectory permissions are essentially all 777..."