Educational Consultancy in Apache and Information Technology

Education Consultancy in Apache and Open Source Technology

Apache Web Server UNIX and Linux Training Sitemap
Submit Apache Web Server Questions Knowledge Transfer Web Server Schedule
Definition of Service Delivery Medium

Web-based Training Services

 

Apache Web Server - OSS

Configuration and Scripting

Operational Challenge Apache Web Server on a Linux Base Operating System Apache and Tomcat in an IBM z/OS Mainframe Environment
Walkthroughs and Exercises Scripting and Development Platform Best Practices and Guidelines
Copyright Acknowledgement
 

Operational Challenge

Organizational enterprise is being challenged to utilize the Apache Web Server to streamline costs, lessen dependency on commercial software, and improve performance. Apache Web Server is available free for download and installation. It is HTTP/1.1 compliant and there are Apache modules for incorporating additional web server functionality. Apache Web Server open source code provides the capability to adjust and optimize code, fix errors, and tailor security. Apache Web Server can be installed and run on a variety of base operating systems:

Operating Systems
Open Source Commercial
Linux FreeBSD
Apple Mac OS MS Windows IBM Mainframe OS

The Apache Web Server provides CGI, SSL, virtual domains and a comprehensive featureset. Configuration files are in ASCII, have a simple format, and can be edited with a text editor. Servers are managed from the command line; this facilitates both cloning and remote administration.

Qualifying a Training Request

Apache Web Server on a Linux Base Operating System

Most Linux distributions have Apache Web Server bundled with the installation image; it is pre-configured and ready to run. Manual installation and configuration problems are resolved through web forums and voluntary documentation. Apache Web Server makes extensive use of command-line prompts and UNIX command sets. There are no setup wizards. Apache Web Server 2.4 has been upgraded to work in high traffic environments; there can be inefficiencies associated with scaling to meet different volume requirements.

The mod_status module can be used on the Apache Web Server system to monitor:

  • The number of worker serving requests.
  • The number of idle worker.
  • The number of starts and retarts.
  • The duration of time that Apache Web Server has been running.

The status module can be set to an extended mode for displaying additional information:

  • The status of each worker.
  • The number of requests that worker has performed and the total number of bytes served by the worker.
  • A total number of accesses and byte count served (*).
  • Averages number of requests per second, the number of bytes served per second and the average number of bytes per request.
  • The percentage of CPU used by each worker.
  • The total CPU used by Apache Web Server.

Apache Web Server is preconfigured with a selection of MPM: Multi-Processing Modules for binding to network ports on the machine, accepting requests, and dispatching children to handle the requests. Linux supports Apache Web Server with both threaded and non-threaded MPM.

Worker MPM utilizes multi-threaded child processes. Multi-threading occurs within child processes; each thread handles a single connection. Worker is efficient with a small memory footprint which scales well. It is well suited for multiple processors. Limitations include managing faulty modules and the cascading impact from a thread to all the threads in a child process.

Prefork MPM uses multiple child processes; each child handles one connection at a time. Prefork is well suited for single or double CPU systems, the processing efficiency will be comparable to the Worker MPM and fault tolerance is provided. However, the memory usage is high and this issue becomes more pronounced with increased traffic.


Apache and Tomcat in an IBM z/OS Mainframe Environment

The client utilizes Apache and Tomcat in a IBM z/OS mainframe and WebSphere web server operating environment. Open source Apache and Tomcat provide an application server for supporting lighter-weight applications. However, there needs to be subject matter specific to the configuration and management of large scale Apache and Tomcat deployments. Apache Web Server functionality and services such as security, EJB, messaging, and web services also will need to be compared to IBM WAS CE.


Walkthroughs and Exercises

The walkthroughs and exercises demonstrate and teach the Apache Web Server facilities.

Facility Explanation
UNIX Threading On UNIX systems with POSIX thread support, Apache Web Server can run in a hybrid multiprocess, multithreaded mode. This can improve scalability.
New Build System The build system has been rewritten and based on autoconf and libtool. This standardizes the Apache Web Server configuration.
Multiprotocol Support The infrastructure is in place for Apache Web Server to support multiple protocols.
Support for non-UNIX platforms Apache 2.x is faster and more stable on non-UNIX platforms. Platform-specific MPMs: Multi-processing Modules and the APR: Apache Portable Runtime, are implemented in the native API. This avoids the inferior performance of the POSIX-emulation layers.
New Apache API The API for modules has been changed. Module ordering and priority problems from 1.3 have been corrected. Apache 2.x is more automated with module ordering done per-hook to allow more flexibility. New calls provide additional module capabilities without patching the core Apache server.
IPv6 Support On systems where IPv6 is supported by the underlying Apache Portable Runtime library, the default is for Apache Web Server to receive IPv6 listening sockets.
Filtering Apache modules can be written as filters on the stream of content as it is delivered to or from the server.
Multilanguage Error Responses Error response messages to the browser are provided in several languages, using SSI documents.
Simplified Configuration Directives have been simplified. The Port and BindAddress directives have been removed; only the Listen directive is used for IP address binding. The ServerName directive specifies the server name and port number only for redirection and vhost recognition.
Regular Expression Library Updated Apache 2.x includes the PCRE: Perl Compatible Regular Expression Library. All regular expression evaluation now use the Perl 5 syntax.

Scripting and Application Development

There will be issues in coding scripts and developing applications with Apache Web Server. The increased use of handheld smartphone and tablets has been driving specialized changes to web sites. Mobile web browsers require different HTML and CSS presentation to accommodate the smaller screens used on handheld devices. Web redirect instructions can be used with CSS styles, web server URL rewriting, or a web programming language to detect the browser making the request and then return an alternate web page with a design specific to that application and device.

The Apache module mod_rewrite processes web server directives which can apply to all websites on a web server, websites by domain, or pages that match a search pattern. The directives can be modified based on search patterns found in the browser user agent string which identifies the browser for an incoming request. Cascading style sheets can be used to alter the presentation of a web page based upon detection of components from the incoming browser request. The "@media" CSS query returns a style based upon browser conditions associated with a property of the device that is viewing the site. JavaScript accesses information in the user agent string by referring to objects in the DOM: Document Object Model. The Screen object contains information about the hardware device, while the Navigator object contains information about the browser.

Open source content management systems and blogging software have been developed to integrate and interoperate with Apache Web Server. It also is a component in the LAMP technology stack: Linux, Apache, ySQL, and PHP/Python/Perl. LAMP to WAMP can be utilized to interoperate with the Microsoft Corporation scripting platform.


Best Practices and Guidelines

Controlling File Transmission

Three variables are used in Apache Web Server for controlling file transmission. The maximum upload size is limited by the "upload_max_filesize" variable; it is set to two megabytes by default. The maximum upload file size also is governed by the Apache Web Server's "memory_limit" and "post_max_size" variables. 

1.   Change the numerical portion of the "upload_max_filesize" variable to the number of megabytes to be uploaded.
2. Examine the "memory_limit" and "post_max_size" variables. If those variables have a value lower than the "upload_max_filesize" then they must be changed to a value equal to or greater than the specified "upload_max_filesize."
3. Restart the server, the new settings will be in effect.

Flushing the Cache

In addition to connection settings information, Apache Web Server upload limits and other connection settings are stored on the server in a file named php.ini. The file specifies values for all three variables associated with upload limits; Php.ini typically is located in the /user/local/etc folder.


File Caching

Apache Web Server uses a series of directories to cache files created and used by an application. The storage of temporary cache files reduces the frequency and resources used by a program for requesting data. As the cache becomes full, there will be a degradation of Apache Web Server operation and efficiency. Flushing caches can be used to improve performance.

1. Enter the command "htcacheclean -D," and then invoke the Enter key; this will perform a cache flush test. Performing a test is the recommended practice, it will safeguard from erroneously deleting cache directories which are used by other applications and appliances that are running on the Apache Web Server system.
2. Type the command "htcacheclean -r," and then invoke the Enter key by invoking the Enter key.

Copyright Acknowledgement

SYS-ED warrants no copyright or ownership of the software that it provides training on.