Description
ALL attached in document
Unformatted Attachment Preview
Purchase answer to see full attachment
Explanation & Answer
Attached.
#!/bin/sh
#Create By Chrisclan17
##First we'll need to install tree. This will enable us to view the folder
structure. The tree command enables one to recursively view a directory
### listing or structure
yum -y install tree
##
###### Directories subdirectories creation
##Create parent directory or install directory
##we'll began creating the directories and subdirectories using the mkdir
command for each directory name.
##The main directories are apache and www which are the parent directories
indicated by +-. The subdirectories for apache are bin, conf, and lib. The
subdirectories ##for www are html, cgi-bin and ftp.
INSTALL_DIRECTORY='/home'
#we will ensure that we are starting in our individual Home directory:
cd ~
#We will then need to Print all files and folders in current Working Directory
with their respective permissions
ls -la
slash='/'
#Here we will be creating apache and www as the parent directory followed by
their respective sub directories
apacheDir='apache'
apacheDir=$INSTALL_DIRECTORY$slash$apacheDir
#Creating path for www
wwwDir='www'
wwwDir=$INSTALL_DIRECTORY$slash$wwwDir
#echo $apache
if [ ! -d "$apacheDir" ]; then
mkdir "$apacheDir"
fi
if [ ! -d "$wwwDir" ]; then
mkdir "$wwwDir"
fi
bin='bin'
bin=$apacheDir$slash$bin
conf='conf'
conf=$apacheDir$slash$conf
lib='lib'
lib=$apacheDir$slash$lib
if [ ! -d "$bin" ]; then
mkdir "$bin"
fi
if [ ! -d "$conf" ]; then
mkdir "$conf"
fi
if [ ! -d "$lib" ]; then
mkdir "$lib"
fi
html='html'
html=$wwwDir$slash$html
cgiBin='cgi-bin'
cgiBin=$wwwDir$slash$cgiBin
ftp='ftp'
ftp=$wwwDir$slash$ftp
if [ ! -d "$html" ]; then
mkdir "$html"
fi
if [ ! -d "$cgiBin" ]; then
mkdir "$cgiBin"
fi
if [ ! -d "$ftp" ]; then
mkdir "$ftp"
fi
###########Assigning the respective permissions###########
#Assigning of Read,Write and Execute Permissions to User
chmod u=rwx $apacheDir
chmod u=rwx $html
chmod u=rwx $cgiBin
chmod ...