The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Php security
By Guest on 17th July 2024 07:00:58 AM | Syntax: TEXT | Views: 43



New paste | Download | Show/Hide line no. | Copy text to clipboard
  1. When you setup WP you (the webserver) may need write access to the files. So the access rights may need to be loose.
  2.  
  3. chown www-data:www-data  -R * # Let Apache be owner
  4. find . -type d -exec chmod 755 {} \;  # Change directory permissions rwxr-xr-x
  5. find . -type f -exec chmod 644 {} \;  # Change file permissions rw-r--r--
  6. After the setup you should tighten the access rights, according to Hardening WordPress all files except for wp-content should be writable by your user account only. wp-content must be writable by www-data too.
  7.  
  8. chown root:root  -R * # Let your useraccount be owner
  9. chown www-data:www-data wp-content # Let apache be owner of wp-content
  10.  
  11. Maybe you want to change the contents in wp-content later on. In this case you could
  12.  
  13. temporarily change to the user to www-data with su,
  14. give wp-content group write access 775 and join the group www-data or
  15. give your user the access rights to the folder using ACLs.
  16. Whatever you do, make sure the files have rw permissions for www-data.




Best VPS Cloud & Hosting

  • Recent Pastes

Best VPS Cloud & Hosting