Apache::MP3

Apache::MP3 is a freely available Perl utility that generates web page listings for music files stored on a web server. With Apache::MP3, you can quickly set up a web site that lets viewers browse and listen to music hosted on the site.

Installing Apache::MP3

  • 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::MP3

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

  • Manually

    Download the Apache::MP3 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::MP3; run the following command as the same user that the web server was installed as:

    # make install

    The Apache::MP3 documentation lists dependencies that must be installed prior to installing Apache::MP3 - see the README file included in the distribution.

Configuring Apache::MP3

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 Apache::MP3 to generate music listings inside. This could be a subdirectory of the site (e.g. /music) or the main site itself (/). This should be the location where you have your music files stored. They can be in one big directory, or stored in subdirectories below this location.

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::MP3. In the 'handlers' section, select the stage 'Content generation' from the list, and type in 'Apache::MP3' into the box below. After doing this, click on the 'save' button or apply changes to set this configuration.

A few extra MIME types must also be added. Visit the 'MIME types' page, and add the following MIME types for these file extensions:

mp3 - audio/mpeg
m3u - audio/playlist
ogg - application/x-ogg

Apache::MP3 also uses a set of icons and a stylesheet to generate its song listings. By default, these are expected to be located at /apache_mp3 in the document root. Your will need to create this directory, and then copy in the defaults from the Apache::MP3 install (this will be from your CPAN build tree, which by default will be located in /root/.cpan/build/Apache-MP3-3.03 or similar).

Finally, restart your virtual server, and verify that you can retrieve pages from the web site. When you visit the configured part of the site, the Apache::MP3 module should generate listings of all the music files found in the directory. Clicking on the music files, or the playlists should let you play the music!

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 Bookmark with del.icio.us Post this article to Digg Post this article to reddit Post this article to Facebook Tweet this article  

Comments are closed for this post.

Recently...

Other Resources