In this penultimate section of this article, I'll introduce some offbeat Apache Web server modules.
Let me start with the "mod_usertrack" module that allows you to track the navigation of the user across the website by setting a "cookie" on the client. Note that you have to compile this module into Apache by specifying the "--enable-usertrack" option at compilation time.
Now, let me outline the directives that govern the behavior of this module:
For starters, the "CookieTracking" directive must be set to "On" in order to activate the module, because compiling the "mod_usertrack" module into the binary does not activate this feature. The following directives control the creation of cookies on the client:
Next, you have the "mod_speling" module - yes, I've typed the name of the module correctly here - that allows the Apache Web server to correct any spelling mistakes (only one per request) in the URL. Once again, the "--enable-speling" option ensures that this module is compiled into Apache, statically.
There is only important directive that you need to keep in mind:
Note that the server will attempt to locate file with only a single misspelling. If there is more than one result that match the required criteria, the following output is displayed in the browser:
Finally, there is the "mod_info" module that allows you to learn more about the configuration of the Web server. Once again, you'll have to include the "mod_info" module in the Apache executable by specifying the "--enable-info" option to the "configure" command.
Next, you must update the "httpd.conf" file with the following entries:
Restart the Web server and try to access the following URL: "http://www.mysite.com/server-info".
Note that access is restricted to the computer, whose IP address is "192.168.0.1", as a security precaution.
A counterpart of the "mod_info" module is the "mod_status" module - compiled into Apache by default. You can learn more about this module at the following URL: http://httpd.apache.org/docs-2.0/mod/mod_status.html.
In fact, you can read up on all modules explained during the course of this three part series by pointing your browser to the following URL: http://httpd.apache.org/docs-2.0/mod/.
That's about it for this series on "Getting Started with Apache 2.0." If you're interested in learning more about latest (and most stable) incarnation of Apache, take a look at the following links:
The Apache Group Website: http://www.apache.org
The Apache Project Website: http://httpd.apache.org
Apache HTTP Server 2.0 Online Documentation: http://httpd.apache.org/docs-2.0/
New features with Apache 2.0: http://httpd.apache.org/docs-2.0/new_features_2_0.html
Listing of binary distributions: http://apache.gr-linux.com/httpd/binaries/
Apache 2.0: The Internals of the New, Improved - http://www.linuxjournal.com/article/4559
An Amble Through Apache Configuration - http://www.onlamp.com/pub/a/apache/2000/03/02/
Till next time, have fun!
Note: All examples in this article have been tested on Linux/i586 with Apache 2.0.52, MySQL 3.23 and PHP 5.0.3. Examples are illustrative only, and are definitely NOT meant for a production environment.
blog comments powered by Disqus