Penn foster Graded Project 402082 Unix-Based Environments and Apache HTTP Server

$ 15

Penn foster Graded Project 402082 Unix-Based Environments and Apache HTTP Server

OVERVIEW
After installing Apache HTTP Server, you’re now ready to configure it for your website! Throughout this and future graded projects, you’ll be creating a fictional website, configuring it in various web server environments and then uploading it to the Penn Foster web server. There’s no better way to apply your knowledge than by completing a common real-world task!

PROJECT SCENARIO
You’re now asked to test the fan club website on a local Apache HTTP Server. You should have completed the previous graded assignment and have the following files:
• index.html—Contains the band name, current lineup, and a brief history of the band.
• music.html—Contains their music catalog and upcoming tour dates.
• fanclub.html—Contains a form to sign-up for the band’s fanclub.
If not, go back to the previous graded project and create the required files and folders. In addition to these pages, you’ll add the following Perl script in this graded project:
• signup.pl—This script will accept the form data from fanclub.html and display that data on a welcome page.

INSTRUCTIONS
In this graded project, you’ll need to have installed ActivePerl from the previous study unit and installed Apache HTTP Server as directed in the current study unit. In the first section, you’ll configure Apache for your website. In the second section, you’ll add a Perl script, modify the fanclub.html file and then test to see if the website works. To make configuration simpler, you may want to move the band_fan folder with all of its content to the C:\ drive to shorten its path. The location will now be C:\band_fan.

CONFIGURATION
1. Determine the location of the band_fan folder. You can do this through the GUI by right-clicking the folder and choosing the Properties option from the context menu (Figure 7). The folder in which it’s located is the value for the Location field. You can either copy-and-paste the location or write it down. Click the OK button to dismiss the dialog.

Open the Apache configuration file. This can be accessed from the Start menu. Start > All Programs > Apache HTTP Server 2.2 > Configure Apache Server > Edit the Apache httpd.conf Configuration (Figure 8).
2. A dialog may appear indicating that Windows can’t open the file. If so, select the Select a program from a list of installed programs radio button and click
the OK button. You can choose any text editor you prefer.
3. Find the DocumentRoot directive in the httpd.conf file. You can use the CTRL-F shortcut to search for the word without scrolling through the whole file.
# DocumentRoot: The directory out of which you’ll serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot “C:/Apache/htdocs”
4. Modify the DocumentRoot directive for the band_fan folder. Warning: You’ll need to change every backslash (\) in the path to a forward-slash (/). C:\foster\band_fan should now be C:/foster/band_fan.
DocumentRoot “C:/band_fan”
5. Find the second Directory tag in the httpd.conf file. You can use the CTRL-F shortcut to search for the phrase <Directory “C:/Apache/htdocs”> without scrolling through the whole file.
# This should be changed to whatever you set DocumentRoot to.
#
<Directory “C:/Apache/htdocs”>
6. Modify the Directory tag for the band_fan folder. Warning: You’ll need to change every backslash (\) in the path to a forward-slash (/).
<Directory “C:/band_fan”>
7. Find the Options directive immediately below the Directory tag.
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
Options Indexes FollowSymLinks
8. Modify the Options directive to support CGI scripts by adding the option ExecCGI.
Options Indexes FollowSymLinks ExecCGI
9. Find the ScriptAlias directive in the httpd.conf file. You can use the CTRL-F shortcut to search for the word without scrolling through the whole file.
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing “/” apply to ScriptAlias
# directives as to Alias.
ScriptAlias /cgi-bin/ “C:/Apache/cgi-bin/”
10. Modify the ScriptAlias directive for the band_fan folder, including the cgi-bin directory.
ScriptAlias /cgi-bin/”C:/band_fan/cgi-bin/”
11. Find the next Directory tag in the httpd.conf file. You can use the CTRL-F shortcut to search for the phrase <Directory “C:/Apache/cgi-bin”> without scrolling through the whole file.
# “C:/Apache/cgi-bin” should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
<Directory “C:/Apache/cgi-bin”>
12. Modify the Directory tag for the band_fan folder, including the cgi-bin directory.
<Directory “C:/band_fan/cgi-bin”>
13. Save and close the configuration file.
14. If Apache is running, close the command-line window in which you ran httpd.exe. Otherwise, the configuration file changes won’t affect the web service.
CGI Scripting and Testing
15. Open a text editor of your choice and type the following
Perl script:
#/perl/bin/perl
use strict;
use warnings;
use CGI;
my $cgi = CGI->new();
print
$cgi->header(‘text/html’),
$cgi->start_html(‘Fanclub Signup’),
$cgi->h1(‘You are now signed up.’),
$cgi->p(‘Thank you for signing up,’ ,
$cgi->strong($cgi->param(‘name’)), ‘.’),
$cgi->p(‘The following comment has been submitted:’),
$cgi->blockquote($cgi->param(‘comments’)),
$cgi->end_html;
16. Create a new folder named cgi_bin in the band_fan folder and save the script with the filename signup.pl.
17. Open the fanclub.html file in text or HTML editor and modify the opening form tag as follows:
<form method=’post’ action=’cgi-bin/signup.pl’>
18. Start the Apache web service. Launch the Windows command line and type the following at the commandline prompt:
C:\Apache\bin\httpd.exe
19. Type the URL http://localhost:8080 in your browser. You should see the homepage index.html for the band fan club. Click on the links for the other two pages and verify they work.
20. Test the fanclub.html page by typing in values for the HTML form controls and then clicking the Join button.
21. You should get a resulting page that displays as follows:

PROJECT SUBMISSION
GUIDELINES
To submit your project, you must provide the signup.pl file and modified fanclub.html and httpd.conf files. You should copy the fanclub.html file from the band_fan folder and the signup.pl file from the cgi-bin folder in the band_fan folder. The httpd.conf file should be copied (do not move) from the default location C:\Apache\conf. Move all files to your desktop or another common folder and then select them together by holding down the CTRL key while clicking them. To combine them into a single file for submission, you should right-click on one of the selected files and choose the Send to > Compressed (zipped) folder option in the context menu.
The resulting file should be named apache.zip. Submit this file for grading.

85 in stock

SKU: PENNFOSTER402082 Category:

Description

Penn foster Graded Project 402082 Unix-Based Environments and Apache HTTP Server

OVERVIEW
After installing Apache HTTP Server, you’re now ready to configure it for your website! Throughout this and future graded projects, you’ll be creating a fictional website, configuring it in various web server environments and then uploading it to the Penn Foster web server. There’s no better way to apply your knowledge than by completing a common real-world task!

PROJECT SCENARIO
You’re now asked to test the fan club website on a local Apache HTTP Server. You should have completed the previous graded assignment and have the following files:
• index.html—Contains the band name, current lineup, and a brief history of the band.
• music.html—Contains their music catalog and upcoming tour dates.
• fanclub.html—Contains a form to sign-up for the band’s fanclub.
If not, go back to the previous graded project and create the required files and folders. In addition to these pages, you’ll add the following Perl script in this graded project:
• signup.pl—This script will accept the form data from fanclub.html and display that data on a welcome page.

INSTRUCTIONS
In this graded project, you’ll need to have installed ActivePerl from the previous study unit and installed Apache HTTP Server as directed in the current study unit. In the first section, you’ll configure Apache for your website. In the second section, you’ll add a Perl script, modify the fanclub.html file and then test to see if the website works. To make configuration simpler, you may want to move the band_fan folder with all of its content to the C:\ drive to shorten its path. The location will now be C:\band_fan.

CONFIGURATION
1. Determine the location of the band_fan folder. You can do this through the GUI by right-clicking the folder and choosing the Properties option from the context menu (Figure 7). The folder in which it’s located is the value for the Location field. You can either copy-and-paste the location or write it down. Click the OK button to dismiss the dialog.

Open the Apache configuration file. This can be accessed from the Start menu. Start > All Programs > Apache HTTP Server 2.2 > Configure Apache Server > Edit the Apache httpd.conf Configuration (Figure 8).
2. A dialog may appear indicating that Windows can’t open the file. If so, select the Select a program from a list of installed programs radio button and click
the OK button. You can choose any text editor you prefer.
3. Find the DocumentRoot directive in the httpd.conf file. You can use the CTRL-F shortcut to search for the word without scrolling through the whole file.
# DocumentRoot: The directory out of which you’ll serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot “C:/Apache/htdocs”
4. Modify the DocumentRoot directive for the band_fan folder. Warning: You’ll need to change every backslash (\) in the path to a forward-slash (/). C:\foster\band_fan should now be C:/foster/band_fan.
DocumentRoot “C:/band_fan”
5. Find the second Directory tag in the httpd.conf file. You can use the CTRL-F shortcut to search for the phrase without scrolling through the whole file.
# This should be changed to whatever you set DocumentRoot to.
#

6. Modify the Directory tag for the band_fan folder. Warning: You’ll need to change every backslash (\) in the path to a forward-slash (/).

7. Find the Options directive immediately below the Directory tag.
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
Options Indexes FollowSymLinks
8. Modify the Options directive to support CGI scripts by adding the option ExecCGI.
Options Indexes FollowSymLinks ExecCGI
9. Find the ScriptAlias directive in the httpd.conf file. You can use the CTRL-F shortcut to search for the word without scrolling through the whole file.
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing “/” apply to ScriptAlias
# directives as to Alias.
ScriptAlias /cgi-bin/ “C:/Apache/cgi-bin/”
10. Modify the ScriptAlias directive for the band_fan folder, including the cgi-bin directory.
ScriptAlias /cgi-bin/”C:/band_fan/cgi-bin/”
11. Find the next Directory tag in the httpd.conf file. You can use the CTRL-F shortcut to search for the phrase without scrolling through the whole file.
# “C:/Apache/cgi-bin” should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.

12. Modify the Directory tag for the band_fan folder, including the cgi-bin directory.

13. Save and close the configuration file.
14. If Apache is running, close the command-line window in which you ran httpd.exe. Otherwise, the configuration file changes won’t affect the web service.
CGI Scripting and Testing
15. Open a text editor of your choice and type the following
Perl script:
#/perl/bin/perl
use strict;
use warnings;
use CGI;
my $cgi = CGI->new();
print
$cgi->header(‘text/html’),
$cgi->start_html(‘Fanclub Signup’),
$cgi->h1(‘You are now signed up.’),
$cgi->p(‘Thank you for signing up,’ ,
$cgi->strong($cgi->param(‘name’)), ‘.’),
$cgi->p(‘The following comment has been submitted:’),
$cgi->blockquote($cgi->param(‘comments’)),
$cgi->end_html;
16. Create a new folder named cgi_bin in the band_fan folder and save the script with the filename signup.pl.
17. Open the fanclub.html file in text or HTML editor and modify the opening form tag as follows:

18. Start the Apache web service. Launch the Windows command line and type the following at the commandline prompt:
C:\Apache\bin\httpd.exe
19. Type the URL http://localhost:8080 in your browser. You should see the homepage index.html for the band fan club. Click on the links for the other two pages and verify they work.
20. Test the fanclub.html page by typing in values for the HTML form controls and then clicking the Join button.
21. You should get a resulting page that displays as follows:

PROJECT SUBMISSION
GUIDELINES
To submit your project, you must provide the signup.pl file and modified fanclub.html and httpd.conf files. You should copy the fanclub.html file from the band_fan folder and the signup.pl file from the cgi-bin folder in the band_fan folder. The httpd.conf file should be copied (do not move) from the default location C:\Apache\conf. Move all files to your desktop or another common folder and then select them together by holding down the CTRL key while clicking them. To combine them into a single file for submission, you should right-click on one of the selected files and choose the Send to > Compressed (zipped) folder option in the context menu.
The resulting file should be named apache.zip. Submit this file for grading.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.