getting changes from cakelampvm
[feisty_meow.git] / scripts / customize / fred / scripts / cakelampvm / revamp_web_permissions.sh
1 #!/bin/bash
2
3 # fixes the cakelampvm permissions according to the way.
4
5 ##############
6
7 if [[ $EUID != 0 ]]; then
8   echo "This script must be run as root or sudo."
9   exit 1
10 fi
11
12 ##############
13
14 export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
15 export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../../../../.." && \pwd )"
16
17 source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh"
18
19 ##############
20
21 # make sure we have the appropriate access on a few key folders.
22 normal_perm /var/www
23
24 ##############
25
26 # change the owner for the web roots to the apache user, www-data.
27 chown -R www-data:www-data /var/www
28
29 # put a couple specific ownerships into play so the appropriate user has full access.
30 chown -R developer:developer /home/developer /opt/feistymeow.org /etc/apache2 /etc/bind
31
32 chown -R fred:fred /home/fred /home/archives/stuffing 
33
34 ##############
35
36 # these directories will be given group permissons that enable web server access.
37 group_perm /var/www /etc/apache2 /etc/bind
38
39 ##############
40