Apache::Motd

Apache::Motd is a freely available Perl program that provides a 'message of the day' alert to visitors of your web site.

Installing Apache::Motd

  • Using the CPAN shell

    Perform the installation as the same user that the web server was installed as. (Be sure to set the environment variable ZEUSHOME to the location where Zeus is installed).

    # $ZEUSHOME/zperl/bin/perl -MCPAN -e shell
    cpan> install Apache::Motd
    

    The CPAN shell will prompt to install all the necessary dependencies for you.

  • Manually

    Download the Apache::Motd package and untar it. Run the following commands in the directory that is created.

    $ $ZEUSHOME/zperl/bin/perl Makefile.PL
    
    $ make
    $ make test
    

    Now, install Apache::Motd; run the following command as the same user that the web server was installed as:

    # make install
    

    Apache::Motd is a small utility that does not have any other dependencies, so you should not need to install any further software to get it working.

Configuring Apache::Motd

Create a virtual server, or edit an existing virtual server. Enable Perl Extensions (API Support: Perl). On the Perl configuration page, you must enter the location on the site that you would like the message of the day to be displayed on. Typically, this would be '/' so that your whole site will get the message. You can of course configure multiple messages, for different sections of your site. The following example assumes that you are using the path '/'.

Enter this path in the section of the page entitled 'Add a new URL prefix' and apply changes. Now, you can specify additional configuration to tell Zeus to use Apache::Motd for the path '/'. In the 'Handlers' section, select the stage 'Header Parser' from the list, and type in 'Apache::Motd' into the box below.

You must also configure Apache::Motd with the file that will be shown when viewers first visit your site. This is specified by setting the Perl variable 'MessageFile'. To do this, find the section of the GUI page entitled 'Adding a Perl Configuration Variable', type in the variable name 'MessageFile' and in the value box, enter the path to the message of the day file on the web server. (This is expected to be a full path, not relative to the document root).

After entering this first variable, you will need to click the 'apply changes' button. The page will be updated, showing the new content generator perl module, and the configuration key that you just added. Finally, remember to commit the changes to the virtual server by clicking on the link at the top of the page.

Testing Apache::Motd

Now, Apache::Motd should be running. When you visit your web site, you will be temporarily redirected to the message page. Your browser should then automatically take you back to the original page that you requested. By default, Apache::Motd will store cookies on clients to make sure that viewers only see the message of the day once.

Apache::Motd has many other configuration settings, letting you control the behaviour of the module, such as how long to redirect users for, how often to re-show the message, and so on. Please read the README file that comes with the software distribution for further documentation. Additional configuration parameters can be set in exactly the same way as described above.

Troubleshooting

Error messages are logged to the file $ZEUSHOME/web/log/errors. Review this file if you encounter any problems.

Content Manager [Administrator] 14 December 2005  Permalink  
Leave a comment ...
Your email address will not be displayed.
Your URL will be displayed.
This public messageboard is not a forum for technical support. To report technical support problems, please contact our dedicated Support team using the instructions at the bottom of this page.
Options:
 
(Line breaks become <br />)
(Set cookies for name, email & url)
Download Free Trial

Recent Articles

Other Resources



www.zeus.com