Getting Your Message Across with Apache
Carlos Ramirez
Have you ever posted an important message that went unnoticed on your Web site? Or put a critical shutdown announcement on your home page that was never visited? Unfortunately, this is a common occurrence that many Web administrators face. All too often admins post important system status information affecting the computing environment, yet Web users will still be oblivious to why the server is down. It turns out that the majority of users do not access Web sites through the main home page. Instead, they access sections of a Web site through their bookmarks, or other external links. Despite efforts to train Web users to frequently visit our home page for pertinent news items they forget to do so. In this article, I present an Apache module that I created to tackle this specific problem. It provides a way to push your important messages to your user community so that anyone accessing any Web page on your server will get the message.
The Solution
The module is called Apache::Motd. As the name implies, this module works on Apache Web servers and is based on the "Message Of The Day" (or motd) utility found on UNIX systems. This module equips a Web server with the same functionality provided by motd. Once the module is installed, the administrator can configure the Web server to display the message of the day to every user accessing any Web page on the server. It momentarily intercepts the initial request and displays the contents of the motd file, then the user is redirected to the originally requested document. The initial request also sets a cookie so that subsequent visits are not directed to the message of the day. Several parameters allow administrators to customize this process, such as the contents of the message of the day, the length of time the message is displayed before it redirects the user, and cookie expiration. Before describing these options in more detail, I will give a brief overview of mod_perl and how it can be used to customize the stages of individual HTTP transactions.<>
|