Novell is now a part of Micro Focus

Apache Manager: A Directory-Based Approach to Managing Apache Web Servers

Articles and Tips: article

Dave Mitchell
Software Engineer
Novell, Inc.
dmitchell@novell.com

Brad Nicholes
Software Engineer
Novell, Inc.
bnicholes@novell.com

01 Aug 2003


With the release of NetWare 6.5, Novell provides a powerful new Apache management tool called the Apache Manager. It is a Web-based utility that leverages Novell eDirectory to manage one or many Apache Web servers running on NetWare, Linux, Solaris, IBM-AIX, or Windows. This AppNote explains the advantages associated with storing Apache's configuration files in a hierarchy of directory objects, which provides the underpinnings for a superior methodology for managing a Web farm environment.


Topics

Apache Web Servers, Web-based management, Web technologies

Products

Apache Manager, NetWare 6.5

Audience

network administrators, installers

Level

intermediate

Prerequisite Skills

familiarity with Apache Web Server configuration

Operating System

NetWare 6.5

Tools

none

Sample Code

none

Introduction

With the release of NetWare 6.5, Novell provides a powerful new Apache management tool called the Apache Manager. This Web-based utility leverages Novell eDirectory to manage one or many Apache web servers running on NetWare, Linux, Solaris, IBM-AIX, or Windows. This AppNote provides an overview of the Apache Manager and explains the advantages associated with storing Apache's configuration files in a hierarchy of directory objects. This concept provides the underpinnings for a superior methodology for managing the configuration of a Web farm environment.

There are a number of advantages to this approach. They include platform independence, a central point of management for all instances of Apache, and consolidation of common directives. Apache Manager consists of two separate pieces: the Apache Manager Web utility and the configuration daemon. These components are built on top of industry standards that are open and universally accepted. This allows them to fully interoperate insulated from the underlying demands of the operating system, which in turn satisfies the needs of a cross-platform world.

One of the truly powerful aspects of Apache Manager is its integration with Novell's highly scalable and distributed directory service. The directory not only acts as the database where the configuration directives are stored, it also provides an environment that allows configuration objects to be shared and inherited. The basic concept is that when identical directives exist for multiple Apache servers, these directives can be stored in a single directory object rather than duplicated in multiple configuration files.

Apache Manager provides the Web administrator with a powerful time saving tool that increases productivity, as each directory object holds a common set of directives that may be inherited by lower level objects in the eDirectory tree. The "Apache Group" is the highest object in the tree. It contains a set of directives that are common across all instances of the Apache web server regardless of the platform it is running on. The end result is that Apache Manager is not only capable of managing a large number of Apache web servers, it will also manage different versions of Apache running on different platforms. The specific requirement is that the platform provides a supported JVM and the ability to connect to a directory service through the LDAP protocol.

Overview of the Apache Web Server

The origins of the Web began with an information project known as CERN. Today, this is where the world's largest particle physics laboratory still operates. This project later developed into what is known as the World Wide Web Consortium (W3C). As Web technologies evolved, there emerged specific software, protocol sets, and conventions to govern them. At the root of this digital ancestral tree are browsers and HTTP servers. One of the dominant players in this Internet ecology is the Apache Web Server, the most widely deployed Web server on the Net. According to the most recent surveys from Netcraft, Apache Web Servers represent 62.5 percent of the total Web server deployments.

Until very recently, managing an Apache Web Server was a fairly primitive task, accomplished mainly through the editing of a text file known as the httpd.conf file. This file contains the key configuration directives for an Apache Web Server. Novell's Apache Manager helps to solve many of the problems that are associated with the current Apache administration methods and procedures. One of the most important is the ability to manage multiple Apache Web Servers as part of a centralized management system. Prior to this, managing multiple instances of Apache was tedious and time consuming.

Manually Configuring an Apache Server

The most commonly used method of managing the Apache web server is to manually edit the configuration file using a text editor. The Apache configuration file, called the httpd.conf file, is stored in the conf subdirectory under the Apache root directory. This simply constructed text file holds all of the directives necessary to successfully configure a Web server and any of its additional modules that may need to be loaded (see Figure 1).

Figure 1: Apache's HTTPD.CONF file.

This simple list of directives and their associated values define how the Apache Web Server will handle requests. Because of the simplistic nature of this file, most administrators responsible for managing a single instance of Apache choose to manage the Web server manually rather than use a management tool that provides additional functionality.

An administrator of a typical Apache server manages the configuration by manually changing the contents of the configuration file. For a single instance of the Web server or even a small number of servers, this method of administering the server is tolerable. But it becomes much more tedious in a Web farm environment. If a directive needs to be changed or a new module loaded on all servers, each server's httpd.conf file will need to be opened, changed, and saved. Apache must then be restarted so that the changes can be applied.

Some alternatives to manual administration have been proposed and some have been implemented. But for the most part, these alternatives are platform-specific and can only be run on a machine that has direct file access to the httpd.conf file. Some of these solutions provide a simpler user interface and perform some simple tasks during configuration file management, but they only solve the problem for a single localized Apache server. The real problem of easily administering an Apache Web farm still exists. The answer to this problem is couched within a directory-based approach to configuration, as implemented by Apache Manager.

Advantages of Using the Apache Manager

Apache Manager provides a simple solution to the problem of managing an Apache Web farm. Some of the advantages provided by Apache Manager include platform independence, single Web-based location for managing all instances of Apache, and consolidation of common directives across Apache instances. Apache Manager eliminates the need for an administrator to have to edit and maintain a large number of configuration files, as many of the directives are common across each Apache Web Server instance.

Platform Independence

Apache Manager was designed and built specifically with platform independence in mind. The basic idea is that since Apache is a cross-platform Web server, managing Apache should also be a cross-platform activity. With this in mind, the runtime environment, as well as the implementation of the administration tool, had to be cross-platform.

There are few technologies that could be considered completely cross-platform. The most obvious was to build a Web-based management utility that implemented Java technology in tandem with LDAP as the protocol for accessing the directory. Apache Manager is composed of two separate pieces: the Apache Manager Web utility and the configuration daemon that runs alongside the Apache Web Server. Both of these pieces are built using Java and LDAP technologies, thus allowing the solution to run on all major operating systems.

The Apache Manager Configuration Daemon is built as a Java utility that utilizes the Java Naming and Directory Interface (JNDI) classes, along with an LDAP provider to access an LDAP-compliant directory. The Web pages are implemented as Java Server Pages (JSP) and take advantage of the same JNDI interfaces for reading and writing data in the directory.

The only platform requirements associated with the Apache Manager instance is a Web server, a JSP/servlet engine, an LDAP-compliant directory, and a Java Virtual Machine (JVM). All of these exist on all of the major operating system platforms. The Apache Web Server and the configuration daemon are the only pieces that must be running on any platform when managed through the Apache Manager instance. The Apache Web management interface need only run on one server in the network.

Single Web-Based Location

Apache Manager has the ability to manage the configuration for any number of Apache servers through a single interface. Administrators can log in to a single instance of Apache Manager to view and configure every instance of Apache running on their network. Once the configuration has been changed in the directory, the configuration daemon handles saving the new configuration to the httpd.conf file, as well as restarting Apache web server.

This solves the problem of having to physically access the configuration file of each individual Apache server just so the administrator can manually edit the configuration files and then restart each Web server. Apache Manager allows the administrator to do it all from one single location while leveraging the Web-based interface.

Common Directive Consolidation

Since the Apache Web Server is a cross-platform application, configuring Apache on different platforms is basically the same. For the most part, a configuration file used to configure Apache on one platform can easily be used to configure Apache on another platform. This means that most of the configuration directives themselves are completely common, regardless of the platform that the Web server is running on.

Apache Manager allows directives that are common across multiple Apache servers to be stored in a common location, while being inherited by each Apache server. For example, assume that the directive on every Apache server for "HostNameLookups" is set to "On". With Apache Manager, this directive can be stored in a Server Group object that is inherited by every Apache server. If the administrator wants to change the value of "HostNameLookups" to "Off", the change can be made in the Server Group object and all Apache servers would automatically inherit the configuration change.

This saves the administrator from the tedious task of manually changing each server's configuration file. It also provides the administrator with a much easier way of adding new Apache servers to the Web server farm. All that is needed is to add a single Server object to the directory with just a few specific directives. The remainder of the configuration file can be constructed by inheriting the common set of directives that were already established in the directory. This eliminates having to duplicate directives that have already been defined in another configuration file.

How the Apache Manager Functions

Apache Manager has three basic parts: the directory service, the configuration daemon, and the Web interface. The directory service not only acts as the database where the configuration directives are stored, it also provides an environment that allows configuration objects to be shared and inherited. The configuration daemon is a small Java application that runs in parallel with the actual Apache server software. It extracts the configuration directive out of the directory server objects, and assembles them to create the httpd.conf file. In addition to creating the configuration file, it is also able to restart the Apache Web Server when specific flags have been set in an Apache Server object within the directory. The Web interface presents the Apache configuration in an easy-to-manage format, enabling changes to be made quickly to one or many Apache servers through a Web browser.

Apache Manager uses a directory-based, hierarchical object model to simplify the management of and share configuration directive within a Web farm. The basic idea is that when an identical directive exists for multiple Apache servers, that directive can be stored in a single directory object rather than duplicated in multiple configuration files. This allows the directive to be shared among multiple Apache server configurations and provide a way for the administrator to modify the directive once and apply the modification across multiple servers. The implementation of this idea is more complex, but Apache Manager masks the complexity and presents the administrator with a simple solution to managing the Web farm.

The Directory

Apache Manager divides the Apache configuration file into a hierarchy of configuration objects and then stores them in a directory service. By storing directives in a hierarchy of objects, those directives can be applied to a single server, a group of servers, or to an entire Web farm.

An HTTPD.CONF file can be broken up into a set of parts that can be represented by five different object classes. These object classes are:

  • Server Group

  • Server

  • Virtual Host

  • Module

  • Block

By defining a server object within the directory service and combining the object with one or more virtual host, module, and block objects, an entire configuration for an Apache Web Server can be stored, manipulated, and shared through the directory service. Each object class contains a set of attributes that can store the data required to produce a portion of the configuration in a complete httpd.conf file. Additionally, each object class may store any number of specific directives that the administrator wants defined at that location of the object hierarchy.

The definitions of the five object classes are as follows:

Server Group

The Server Group is a representation of a set of Apache configuration directives common to all server objects contained in the group. A server group may contain any number of server groups, servers, modules, and blocks.

Sever

The Server object is a representation of a single Apache server. It contains standard attributes such as Server Name. It is used as a definition of any single server and is an anchor point for its configuration. It may contain any number of virtual hosts, modules, and blocks.

Virtual Host

The virtual host object is a representation of a virtual host within an instance of an Apache server. The object contains the necessary attributes to create a <VirtualHost . . .> block in the Apache configuration file. A virtual host object must be contained by a server object and can contain any number of block objects.

Module

The module object is a representation of an Apache module. The module object defines the "LoadModule" directive and the <IfModule > tag within a configuration file. A module can be defined at any level of the hierarchy so that it can be inherited by one or more server configurations. This allows the module to be loaded and configured in exactly the same way by multiple web servers without having to redefine the module for each server. It can contain any number of block objects.

Block

The block object is a representation of a Directory, Location or File block or any of their derivatives. It defines the <Directory | Location | File > tag within a configuration file. A block can be defined at any level of the hierarchy so that one or more server configurations can inherit it. This allows the block definition to be applied in exactly the same way by multiple web servers without having to redefine the block for each instance. A block cannot contain any other objects.

Configuration Daemon

As explained in the object hierarchy section, the configuration for any given Apache Web Server is stored in a series of objects in the directory. The information in the directory is extracted by a configuration builder service known as the Apache Manager Configuration Daemon. The daemon runs in parallel with each instance of Apache and knows how to extract the objects from the directory and order them to construct the httpd.conf file.

Therefore, each Apache server on the network should also have a Configuration Daemon running with it. The configuration daemon is the conduit between the physical configuration file stored for each Apache Web Server instance and the directory service that holds the configuration objects (see Figure 2).

Figure 2: The Apache Manager Configuration daemon.

After the daemon is started, it monitors the directory for any changes made to a particular server. If a change is detected, it updates the configuration file and notifies the Apache Server that it is time to reload its configuration file.

Additionally, if an Apache server's configuration has not been stored in the directory, the daemon has the ability to import the current configuration file into the directory. For example, the first time the daemon runs in conjunction with a specific instance of the Apache Web Server, it will create a Server object in the object hierarchy to ensure that the configuration stored in the directory matches the current configuration file of the Apache server.

In addition to importing a new configuration, the daemon also has the ability to detect when a physical configuration file has been changed. If an administrator makes a change directly to the Apache configuration file stored on disk, the daemon can detect the change and import it into the server configuration previously stored in the directory. One purpose of the configuration daemon is to make sure that the configuration file used to configure a specific instance of Apache remains synchronized with the shared configuration objects in the directory.

Web Interface

The Apache Manager Web interface is a browser-based administration utility that allows administrators to view and configure the entire Web farm from a single location on the Internet. The Web interface simply displays the current configuration for each Apache server as it is stored in the directory and allows the administrator to manipulate the configuration objects.

Object Frame

The interface is simple (see Figure 3). The "Objects" frame gives a view of the Apache configuration objects that are currently stored in the directory and gives the user the ability to navigate the hierarchy. The object hierarchy begins with a server group, generally called "Apache Group." The top group contains other groups that define an organization that will make sense for the administrator. Apache groups may be organized according to platform, deployment, or some other configuration model.

Figure 3: The Objects frame.

Each object in the directory holds a common set of directives that may be inherited by lower level objects in the tree. The "Apache Group" object or the highest object in the tree contains the set of directives that are common across all instances of the Apache web server regardless of the platform that it is running on. Objects that appear at lower levels in the tree, define directives that are specific to particular configurations. The lower the object sits in the tree, the more specific or unique the directives are to a particular Apache web server configuration. The complete configuration for a particular Web server is a combination of the directives contained by the server object along with the directives contained by each object within its hierarchical path.

Directives Frame

The "Directives" frame is the central view which displays the configuration contents held by the currently selected object. This frame gives the administrator the ability to manage the directives that are contained in the object, add child objects or alter the attribute values of the object itself. Additionally, for server objects, the "Directives" frame allows the administrator to view the server's configuration file as it would be created by the configuration daemon. In the configuration file view, all directives are linked back to the object where they were defined. This makes it easy to navigate to an object that holds a specific directive without having to know where the directive came from (see Figure 4).

The Directives frame.

The Apache Manager interface also allows the administrator to restart each Apache Web Server that is administered through this interface. If the configuration file for a specific server has been changed manually, this will be communicated back to the directory by the configuration daemon and displayed in the web interface. It gives the administrator the option of importing the changes or rejecting them in order to maintain synchronization between the physical server and the directory. It displays the current status of each Apache server indicating whether the server is currently running or not.

Whenever a change is made in the directory, a flag within the Apache server object can be set that directs the configuration daemon to rebuild the physical configuration file for a particular Apache server and restart it. Through the Web interface, the administrator has a view of all of their servers within a Web farm and the ability to manage those servers.

Conclusion

Apache Manager is a platform-independent administration solution that allows an administrator to manage multiple Apache Web Server configurations from a single Web interface. By taking advantage of the directory, it provides the necessary tools to consolidate common configuration directives into a hierarchy of objects, stored in a single location so that all Apache servers may be easily managed from the Internet.

Apache Manager is an excellent solution for administrators that are responsible for managing multiple Apache Web Servers. Apache Manager is not only capable of managing a large number of Apache Web Servers, it will also manage different versions of Apache running on different platforms. The only real requirement is that the platform supports a JVM and the ability to connect to a directory service through the LDAP protocol. Apache Manager removes the complexity and overhead common to managing multiple Apache Web Servers.

* Originally published in Novell AppNotes


Disclaimer

The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

© Copyright Micro Focus or one of its affiliates