wk2 apache Flashcards
To find the port that Apache is listening on, you should first check …
“Apache non-SSL IP/port” and “ Apache SSL Port” options in WHM Home»_space; Server Configuration»_space; Tweak Settings.
SSP (a script that runs) will tell you if Apache is listening on an alternate port. If neither tweak settings nor SSP can find the alternative port, then what?
use lsof or netstat
What are the two ways apache can extend its basic functionality
It can either use compiled-in extra modules, or it can hand tasks off to external programs using the Common Gateway Interface (CGI).
How are compiled-in modules run?
Compiled in modules are run inside Apache as the Apache user (usually the user “nobody”) and can be configured using the Apache configuration files (including .htaccess files).
How to see what modules are installed?
httpd -M
Give an example of a module used to extend basic php functionality
An example of a module used to extend basic Apache functionality is when PHP is compiled in with Apache as a dynamic shared object (when you use the DSO handler for PHP).
Other examples include items that we think of as being part of Apache, like mod_userdir and helper extensions like mod_speling.
When is the CGI (Common Gateway Interface) used?
The Common Gateway Interface is used when Apache hands off to external programs.
How is the mod_lsapi module unique?
The mod_lsapi module hands off the work to lsphp processes. While these processes are spawned as needed by Apache, they are not Apache children.
Additionally, each user’s lsphp processes are kept in their own LVE/CageFS, so users cannot interfere with each other. If there are no requests for sites from that user in lsapi_backend_pgrp_max_idle seconds, the process will be terminated and need to be respawned when the next request comes in.
Note:
mod_lsapi is only available with CloudLinux.
The Apache binary file.
/usr/sbin/httpd —
This directory contains all the logs for the apache2 file and all the access logs.
/var/log/apache2/ —
This directory contains the configuration directory for Apache and contains all directories for Apache includes, modules, and configuration files. This directory does not contain log files.
/etc/apache2/ —
The primary Apache configuration file.
/etc/apache2/conf/httpd.conf —
This directory contains an alias to the /var/log/apache2/ directory.
/etc/apache2/logs/ —
This directory contains all of the dynamic modules for Apache.
/usr/lib64/apache2/modules/ —
This file contains HTTP requests that the server received and that did not go to a domain.
/etc/apache2/logs/access_log/ —
The primary Apache configuration file directory.
/etc/apache2/conf.d/ —
The directory that contains the include files that add content to the httpd.conf file. You can modify these configuration files via the command line interface (CLI) or WHM’s Include Editor interface (WHM»_space; Home»_space; Service Configuration»_space; Apache Configuration»_space; Include Editor).
/etc/apache2/conf.d/includes/ —
This file contains error information.
/etc/apache2/logs/error_log/ —
This directory contains an alias to the /usr/lib64/apache2/modules/ directory.
/etc/apache2/modules/ —
Break down this log
[Thu Sep 25 17:34:34.185015 2014] [mpm_prefork:notice] [pid 25070] AH00169: caught SIGTERM, shutting down
This entry contains two additional details - what module and pid generated the message:
timestamp = [Thu Sep 25 17:34:34.185015 2014]
module severity level = [mpm_prefork:notice]
process id: [pid 25070]
message: AH00169: caught SIGTERM, shutting down
note: The Apache error log contains all messages from Apache itself that are not logs of requests, so you may see many logs that are not actually errors at all. There are other logs, such as the suexec and suPHP logs, that have their own logs with their own formats.
Describe the categories of error codes that apache sends to the web browser
1xx Informational codes. We never see these.
2xx Success codes. It’s working, no problem to process.
3xx Redirection. You’ll see these referenced in .htaccess files, but they are not a source of issues.
4xx Client Errors
404 File not found. Most commonly seen when there are tomcat issues, mod_userdir issues, or document root issues.
5xx Server Errors
500 Internal Server Error. Most commonly seen when there are permission or script issues. Check the error logs for more information. Sometimes seen with CloudLinux when a site reaches a memory or processor limit part way through processing a request.
503 Service Unavailable. Most commonly seen with CloudLinux when a site reaches one of its limits at an expected juncture.
Describe the different sections of apache documentation: The parts of the Apache documentation you’re most likely to need are the Syntax, Defaults, and Context.
Syntax tells you what the directive should look like, Default tells you what happens when the directive is not explicitly set, and Context tells you where you can set it. Note that the full description (under the short box) does contain valuable information.
What user do apache children run as?
Apache children run as nobody (or the user if using mod_ruid2)
What user do apache children run as?
Apache children run as nobody (or the user if using mod_ruid2)