Skip to content

Instantly share code, notes, and snippets.

@davebeach
Last active October 14, 2016 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davebeach/a62f0351adab9cb45638af01b9bf91c7 to your computer and use it in GitHub Desktop.
Save davebeach/a62f0351adab9cb45638af01b9bf91c7 to your computer and use it in GitHub Desktop.
Create settings.php and the files directory Drupal 8 - To Reinstall Site

Drupal Important Permission Settings Pre-Install and Post-Install.

Pre-Install or Already Installed but Dumping Database to Reinstall

Create settings.php and the files directory for install.

chmod 644 sites/default/settings.php
chmod -r 755 sites/default
chmod 755 sites/default/files 

To Reinstall: Do above steps and Goto phpmyadmin web application and click on databses. Select the database from the prior install, and click on DROP.

After Install Set Security To

chmod 555 sites/default 
chmod 444 sites/default/settings.php 
File Section Octal Unix Permissions
Core modules folders 750 RWXR-X---
Core modules files 640 RW-R-----
Core themes folders 750 RWXR-X---
Core themes files 640 RW-R-----
Contrib modules folders 750 RWXR-X---
Contrib modules files 640 RW-R-----
Contrib themes folders 750 RWXR-X---
Contrib themes files 640 RW-R-----
Files folders 770 RWXRWX---
Files files 660 RW-RW----
Temporary folder 770 RWXRWX---
Settings file 440 R--R-----
Settings folder 750 RWXR-X---

Important also to make sure that in the sites/default/files directory that you set a group to be the apache user that is used to access the files.

chgrp -Rv www-data sites/default/files

Then

chmod 2775 sites/default/files

Where the 2 in 2775 says to preserve the group id when creating new files etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment