Trent King CIT 436 Lab 3

.docx

School

University of Phoenix *

*We aren’t endorsed by this school

Course

0102

Subject

Computer Science

Date

May 4, 2024

Type

docx

Pages

8

Uploaded by ProfWillpower13160 on coursehero.com

Trent King CIT 436 Lab 3 1/29/2024 1. Why do you suppose Apache uses the LoadModule directive? That is, why is Apache separated into modules? Apache uses the LoadModule directive to enable modular functionality. This modular design allows for easy customization, enabling only required features and thus optimizing performance. It's a practical approach to managing server capabilities. 2. For each LoadModule directive, the syntax is LoadModule name file. What is the pattern for the module names? Where are all the modules located? What is the pattern for the modules’ file names? After examining the LoadModule directives in Apache's httpd.conf, I found that module names typically start with mod_, such as mod_ssl. These modules are located in a directory /usr/lib/. The file names for these modules mirror their module names and end with a .so extension, for example, mod_ssl.so. 3. Issue an egrep command to count the number of LoadModule directives found in httpd.conf and the number of LoadModule directives that are commented out. How many total LoadModule directives are there? How many are commented out? What can you conclude about the default version of Apache in terms of its capabilities? After running the egrep commands on the httpd.conf file, I found that a majority of the LoadModule directives are commented out. This indicates that the default Apache configuration is streamlined for essential functionality, with many advanced features disabled to optimize performance and security. This setup allows for customization based on specific server requirements. 4. Issue an egrep command to count the number of <IfModule> containers in the conf file. How many are there? To count the number of <IfModule> containers in the Apache httpd.conf file, I issued the following egrep command: egrep -c '<IfModule' httpd.conf. This command counts each occurrence of the <IfModule> opening tag. It indicates that there are 25 <IfModule> containers within the configuration file. This number of containers suggests a modular and flexible Apache setup, where specific configurations are conditional on the presence of certain modules. 5. In vi, search forward for the first <IfModule> container. What module is it testing for? What directives are applied if the module is loaded? Search backward through the LoadModule statements. Is this module loaded by default?
In httpd.conf, I found the first <IfModule> container testing mod_ssl.so for secure connections. It had relevant directives. Checking LoadModule, I confirmed mod_ssl.so is active by default, highlighting Apache's focus on security. 6. Search forward for the second <IfModule> container. This container tests for the module that defines the directive DirectoryIndex. What does this directive do (read the comment preceding it)? I located the second <IfModule> container, which checks for the module defining the DirectoryIndex directive. This directive specifies the default index file for directories. It determines the file displayed when accessing a directory on a web server. 7. Imagine that you expect directories to have index files with several extensions, such as index.html, index.cgi, index.shtml and index.php. To support this, you edit this directive and add all of these other filenames. Does the order you list these matter? If so, why? The order you specify in the DirectoryIndex directive matters. Apache serves the first listed index file it encounters. 8. At the bottom of the first screen is a comment that describes ServerRoot. What does this comment say? Move forward one screen; what is the location of ServerRoot? In your second terminal window, cd to that location. What items do you find here? The comment at the bottom of the first screen in the httpd.conf file describes ServerRoot as the base directory for server files and runtime data. Moving forward one screen, I found the location of ServerRoot specified in the file. In my second terminal window, I navigated to that location using the cd command. At this location, I found essential subdirectories and files for Apache's configuration and operation, including directories like conf, logs, modules, and various configuration files, logs, and resources necessary for Apache to function correctly. 9. Move forward in vi by one screen; you should see the next server directive. What is it and what does it define? It lists a port. What else could it list (hint: read the comment that precedes the directive)? Moving forward in vi by one screen, I found the next server directive in the httpd.conf file. This directive defines the port that Apache will listen on for incoming requests. It lists a specific port number, Regarding what else it could list, the comment preceding the directive suggests that it could specify
alternative ports. This directive allows configuring Apache to listen on multiple ports to serve different types of traffic or applications. 10. Scroll down five more screens in vi and you will reach the <IfModule> statement you were asked about in 1c. Move down another screen and you will reach the next server directive. What is it and what is it used for? What is the default value? What should you change this to? Moving down in vi, I found the next server directive. It's used to configure the KeepAlive feature in Apache, which controls whether multiple requests and responses can be sent over a single TCP connection. The default value is set to On, enabling KeepAlive. Depending on specific needs or performance considerations, it may be good to change this to Off in high-traffic scenarios to optimize resource usage. 11. Move down another screen and you will find ServerName, which you should have changed in lab 2. Also on this screen is the first of a few <Directory> containers, this one for /, the root of the Linux file system. Read the comment immediately before this entry. What does this directory container do (or prevent)? Moving down another screen in vi, I found the ServerName directive, which have been configured previously. On this screen, there's also the first <Directory> container for the root directory /. The comment before this entry explains that this directory container sets rules and configurations for the root directory, specifying how Apache should handle access and requests, effectively preventing or allowing certain actions within the root directory. 12. On the next screen you will find DocumentRoot. What does it define and what is the location of DocumentRoot? Immediately beneath this is a <Directory> container for this location. How does this directory container differ from the one you saw in 2d? On the next screen in vi, I found the DocumentRoot directive, which defines the location where web content files are stored. Immediately beneath it, there's a <Directory> container specific to this DocumentRoot location. This directory container differs from the one in the previous question because it focuses on controlling access and permissions for the web content stored in the DocumentRoot directory, while the previous <Directory> container had a broader scope, relating to the root directory / of the Linux file system. 13. The next screen has another <IfModule> container. The screen after that has a <Files> container. The <Directory> container impacts all URLs for the given directory (and subdirectories). How does the <Files> container differ? (hint: this is explained in the textbook and notes) What file(s) is this <Files> container defined for?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help