apache > ws.apache

## Apache Muse - Apache HTTP Server Sample Project

This sample project provides a real WSRF interface for the Apache HTTP Server, better known as httpd. The WSRF interface for httpd exposes the WSRP, WSRL, and some custom properties and operations that are defined in an HttpServer capability. The WSRF and HttpServer capabilities are aggregated together to provide a single WS-resource interface for the server.

The custom properties defined by the HttpServer capability are:

- Name - a unique identifier that differentiates one instance of the server from another.
- Port - any positive integer, describes the port opened by the server.
- SupportedLanguage - complex type describing language codes and files supported by the server.

The implementation of these properties is in the HttpServer interface's getter methods. Our implementation uses the product's own httpd.config file is used to find the appropriate property values.

The custom operations defined by the HttpServer capability are:

- Start - starts the server by running /bin/httpd.
- Stop - stops the server by killing the httpd processes.

It is important to realize that the lifecycle of the WSRF interface and the lifecycle of the server process(es) are mutually exclusive. The WS-resource is alive even when the server is not running, because a server that is not running still exists, it is just in a state that is not useful to its clients. Components that are managing or inspecting the server through WSRF will still be interested in a stopped server.

To configure the WS-resource interface for httpd on your machine, you must first install Apache HTTP Server 2.2. The HttpServer capability is programmed to use an initialization parameter in muse.xml to discover the install directory of httpd. For Windows users, the default location is specified like so in muse.xml:

> `<init-param>
> <param-name>httpd-install-dir</param-name>
> <param-value>C:\Program Files\Apache Software Foundation\Apache2.2</param-value>
> </init-param>
> `

If you installed httpd in another directory, you should put that value in the <param-value/> tag in muse.xml.

Running the HttpServerTestApp program will start the server, read all of its properties, print the values, and then stop the server.