25 pts - Operating Systems Q&A V
Visit this course in D2L and complete Quiz05 by the due date / time for this assignment.
(25 pts) MIME types & web downloads
Ref: (Video) MIME types & web downloads on Linux Server / Apache
Ref: (Video) MIME types & web downloads on Windows Server / IIS
Begin a Word document MIME.docx which will contain screen caps as identified in the instructions below.
Linux version
TP05.II.A Errata: In TP04.II where we set up
Basic Authentication in Linux for the BASite directory, changes we
made in the apache2.conf configuration file also
required that web directories contain a .htaccess file to control
authentication for the directory. To avoid a 403 Forbidden error accessing your root web
directory (i.e., /var/www/html accessed via http as
http://localhost) you will need to add
the following .htaccess file in the root folder which says any access
is allowed. Before beginning TP05.II.A usesudo nano /var/www/html/.htaccess
from
a terminal and enter / save the following lines:
AuthType None
Require all granted
In your local VMware Linux VM create the following files in the /var/www/html
folder (default location for internet files); note that you may need
sudo authority to create / place files in this folder:
noext
with content this file has no extension
putty.exe
which can be downloaded
from hereprevent.this
with content this file should not download
tstscript.ps1
with content # A PowerShell file
Work with MIME types and .htaccess as necessary so that
http://localhost/noext
to your document;http://localhost/putty.exe
to your document;
http://localhost/prevent.this
to your document; Note:
I could not get this to work using .htaccess but changing
/etc/apache2/apache2.conf [example]
didhttp://localhost/tstscript.ps1
to your
document.Windows version
In your local VMware Windows Server VM recreate the setting from Linux
version but in C:\inetpub\wwwroot
(you may need admin authority
to save / put files in this folder). Adjust settings so the same
download behaviors occur. Make a similar set of four screen caps which you add to
your document.
Attach your completed MIME.docx (it should have 8 screen caps, 4 from Linux, 4 from Windows) to this assignment in D2L.
(25 pts) Establish Linux directory and access control structure
Ref: (Video) Video
Ref: (Notes) Linux file and directory access control
Hint: Create a group with auser and buser, set this as the owner group for GammaDir and its files with appropriate group permissions. Similarly for auser, cuser, and AlphaDir.
date > ./LinPerms.txt
whoami >> ./LinPerms.txt
hostname >> ./LinPerms.txt
ls -l >> ./LinPerms.txt
ls -l AlphaDir >> ./LinPerms.txt
G=$(stat -c "%G" AlphaDir) >> ./LinPerms.txt
getent group $G >> ./LinPerms.txt
ls -l BetaDir >> ./LinPerms.txt
G=$(stat -c "%G" BetaDir) >> ./LinPerms.txt
getent group $G >> ./LinPerms.txt
ls -l GammaDir >> ./LinPerms.txt
G=$(stat -c "%G" GammaDir) >> ./LinPerms.txt
getent group $G >> ./LinPerms.txt
Attach the resulting LinPerms.txt file to this assignment in D2L.
(25 pts) Establish Windows directory and access control structure
Ref: (Video) Windows groups and file permissions
.\ListACL -RootPath AlphaDir | Out-File .\WinPerms.txt;
.\ListACL -RootPath BetaDir | Out-File .\WinPerms.txt -Append;
.\ListACL -RootPath GammaDir | Out-File .\WinPerms.txt -Append;
Attach the resulting WinPerms.txt file to this assignment in
D2L.(25 pts) Utilizing Python
Background
This task does not have specific, detailed guidance. It should be accessible given your background in Linux / Windows as well as Python.
A simple algorithm* for finding the greatest common divisor (or GCD) of two positive integers is below. *This algorithm is pseudo-code to show the solution process; it is not Python or any particular implementable language. Converting it to a specific language (e.g., Python) is a task for the student.
Accept two positive integers A and B
while A != B
if (A < B)
B = B - A
else
A = A - B
endif
endwhile
A (or B since they are the same) is the GCD and can be reported as output.
In the tasks below use Python to implement this algorithm (i.e., do not use a different algorithm or built in GCD function even if it exists in your Python version).
Linux version
Based on your background with Python, experience with Ubuntu, and research (e.g., How to Run Python Scripts in Linux Command Line (linuxhandbook.com) implement the GCD algorithm using Python in your xxxxLs1 VM. Create a screen cap named LinPython.jpg (or other image format) of a terminal which shows
Attach a copy of the LinPython screen capture to this assignment in D2L.
Windows version
Repeat the previous exercise in your xxxxWS1 VM (e.g., see Get started using Python on Windows for beginners), naming the screen cap WinPython.jpg (or other image format). Attach a copy of the screen capture to this assignment in D2L.