Added two bash scripts
This commit is contained in:
parent
c82ddcbdac
commit
f03eaeb585
11
Bash/linuxUpdate.sh
Normal file
11
Bash/linuxUpdate.sh
Normal file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Bash script for updating Linux
|
||||
# Author: Floris van Enter
|
||||
# Date: 2018-01-30
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get -y upgrade
|
||||
sudo apt-get -y dist-upgrade
|
||||
sudo apt-get -y autoremove
|
||||
sudo reboot
|
31
Bash/set_wordpress_rights.sh
Executable file
31
Bash/set_wordpress_rights.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This script configures WordPress file permissions based on recommendations
|
||||
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
|
||||
#
|
||||
# Author: Michael Conigliaro
|
||||
# Original script: https://gist.github.com/macbleser/9136424
|
||||
#
|
||||
WP_OWNER=users. # <-- wordpress owner
|
||||
WP_GROUP=www-data # <-- wordpress group
|
||||
WP_ROOT=/var/www/wordpress # <-- wordpress root directory
|
||||
WS_GROUP=www-data # <-- webserver group
|
||||
|
||||
# reset to safe defaults
|
||||
find ${WP_ROOT} -exec chown ${WP_OWNER}:${WP_GROUP} {} \;
|
||||
find ${WP_ROOT} -type d -exec chmod 755 {} \;
|
||||
find ${WP_ROOT} -type f -exec chmod 644 {} \;
|
||||
|
||||
# allow wordpress to manage wp-config.php (but prevent world access)
|
||||
chgrp ${WS_GROUP} ${WP_ROOT}/wp-config.php
|
||||
chmod 660 ${WP_ROOT}/wp-config.php
|
||||
|
||||
# allow wordpress to manage .htaccess
|
||||
touch ${WP_ROOT}/.htaccess
|
||||
chgrp ${WS_GROUP} ${WP_ROOT}/.htaccess
|
||||
chmod 664 ${WP_ROOT}/.htaccess
|
||||
|
||||
# allow wordpress to manage wp-content
|
||||
find ${WP_ROOT}/wp-content -exec chgrp ${WS_GROUP} {} \;
|
||||
find ${WP_ROOT}/wp-content -type d -exec chmod 775 {} \;
|
||||
find ${WP_ROOT}/wp-content -type f -exec chmod 664 {} \;
|
Loading…
x
Reference in New Issue
Block a user