Apache::MP3 version 2.0x This module takes a hierarchy of directories containing MP3 files and presents it as a browsable song library for streaming over the web. It requires the Apache web server, the mod_perl embedded Perl interpreter, and the MP3::Info module. MP3 files are displayed in a list that shows the MP3 title, artist, duration and bitrate. Subdirectories are displayed with "CD" icons. The user can download an MP3 file to disk by clicking on its title, stream it to an MP3 decoder by clicking on the "play" link. Users can also stream the entire contents of a directory, or select a subset of songs to play. A DEMO is available at http://www.modperl.com/Songs. In this demo, stream time is limited to 30 seconds in order to avoid copyright infringement. See the "screenshots" directory for some pictures of Apache::MP3 in action. See below for CHANGES. INSTALLATION 1. Prequisites This module requires mod_perl and MP3::Info, both of which are available on CPAN. 2. Configure MIME types Apache must be configured to recognize the mp3 and MP3 extensions as MIME type audio/mpeg. Add the following to httpd.conf or srm.conf: AddType audio/mpeg mp3 MP3 3. Install icons and stylesheet This module uses a set of icons and a cascading stylesheet to generate its song listings. By default, the module expects to find them at the url /apache_mp3. Create a directory named apache_mp3 in your document root, and copy into it the contents of the F directory from the Apache-MP3 distribution. You may change the location of this directory by setting the I configuration variable. See the I section for more details. 4. Set Apache::MP3 or Apache::MP3::Sorted as handler for MP3 directory In httpd.conf or access.conf, create a ELocationE or EDirectoryE section, and make Apache::MP3 the handler for this directory. This example assumes you are using the URL /Songs as the directory where you will be storing song files: SetHandler perl-script PerlHandler Apache::MP3 If you would prefer an MP3 file listing that allows the user to sort it in various ways, set the handler to use the Apache::MP3::Sorted subclass instead. This is recommended 5. Load MP3::Info in the Perl Startup file (optional) For the purposes of faster startup and memory efficiency, you may load the MP3::Info module at server startup time. 6. Set up MP3 directory Create a directory in the web server document tree that will contain the MP3 files to be served. The module recognizes and handles subdirectories appropriately. I suggest organizing directories by artist and or CD title. For directories containing multiple tracks from the same CD, proceed each mp3 file with the track number. This will ensure that the directory listing sorts in the right order. 7. Set up an information cache directory (optional) In order to generate its MP3 listing, Apache::MP3 must open each sound file, extract its header information, and close it. This is time consuming, particularly when recursively generating playlists across multiple directories. To speed up this process, Apache::MP3 has the ability cache MP3 file information in a separate directory area. To configure this, create a directory that the Web server sill have write access to, such as /usr/tmp/mp3_cache, and add this configuration variable to the directive: PerlSetVar CacheDir /usr/tmp/mp3_cache If the designated does not exist, Apache::MP3 will attempt to create it, limited of course by the Web server's privileges. Open up the MP3 URL in your favorite browser. If things don't seem to be working, checking the server error log for informative messages. Run "perldoc Apache::MP3" for more configuration information. CHANGES Revision history for Perl extension Apache::MP3. 2.05 Fri Aug 25 08:10:04 EDT 2000 Changed directory layout to get faster loading Now supports HTTP authentication (passwords) Supports directories with spaces and funny characters 2.04 Tue Aug 22 04:38:07 PDT 2000 Completely revamped to make more object oriented Apahce::MP3::Sorted subclass Added help page 2.02 Sun May 28 12:18:37 2000 More information on MP3::Info segfaults Added installation directions to README 2.01 Sat May 27 00:32:18 2000 Added information on a workaround for random segfaults related to MP3::Info 2.00 Sat May 27 00:00:09 2000 - original version; created by h2xs 1.20 with options -A -X -f -n Apache-MP3 1.00 February 2000 Old defunct version. AUTHOR Lincoln Stein,