+- apache/ | |- bin/ | |- conf/ | |- lib/ | +- www/ | | - html/ | | - cgi-bin/ |
ID: 666469 • Letter: #
Question
+- apache/
|
|- bin/
|
|- conf/
|
|- lib/
|
+- www/
|
| - html/
|
| - cgi-bin/
|
| - ftp/
The following file permission should be enabled for the directories:
The owner can read, write and execute All.
The group can read and execute All Directories.
Everyone else can only read and execute the files in Apache only (and no permissions in www).
Change the www/ftp directory to allow the User and group to read, write, and execute, but everyone else to only write to the directory.
In addition, create the following empty files and set the following file permissions:
apache/bin/httpd - 755
www/html/index.html - 644
www/cgi-bin/process.pl - 711
Finally, create a file called apache/conf/httpd.conf, and add the following lines to the file:
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# Do not add a slash at the end of the directory path.
#
ServerRoot "/usr"
#
# DocumentRoot: The directory out of which you will serve your documents.
#
DocumentRoot "/Library/WebServer/Documents"
Save the file and exit the editor. Set the file permission for this file to be: 664.
Show the command used to show content of the file and the content of the file.
Using the grep command, write comment to find the line containing the word(s) ServerRoot and DocumentRoot in the httpd.conf file.
Write a sed command that will change the ServerRoot value from /usr to the absolute directory patch for your apache directory.
Write a sed command that will change the Document value from /Library/WebServer/Documents to the absolute directory patch for your www directory.
Write an awk command that will print only the comment field and the login id of all users in the /etc/passwd file in this format: <Comment Field> - <login id>.
Your submission should include the following, as well as a description about each step (what you did and why you are performing each command):
All commands to create the above structure
Changing to your Home directory
Creating the directories
Creating the empty files
Changing all file permissions
Show the directory list of the new structure, including a list of permissions
A grep, sed, and awk command
Explanation / Answer
to set the permissions you can use this command
chmod -R 777 *
apache/bin/httpd - 755
chmod -R 755 apache/bin/httpd
www/html/index.html - 644
chmod -R 644 www/html/index.htm
www/cgi-bin/process.pl - 711
chmod -R 711 www/cgi-bin/process.pl
chmod 664 apache/conf/httpd.conf
cat apache/conf/httpd.conf
sed `s/ServerRoot/$PWD/g' httpd.conf
sed `s/Document/$PWD/g' /Library/WebServer/Documents
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.