Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Archive > Main Support Categories > Server Platforms
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.
Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

Server Platforms
Discussion regarding any server based ubuntu release.

 
Thread Tools Display Modes
Old May 14th, 2005   #1
tornamodo
First Cup of Ubuntu
 
Join Date: May 2005
Beans: 3
Send a message via Yahoo to tornamodo
Lightbulb HowTo stream mp3,ogg,mp4 files with Apache2 (libapache2-mod-musicindex)

Hope you like this: How-To make Apache2 Stream Music.
We use libapache2-mod-musicindex; it works with MP3, FLAC, Ogg Vorbis or MP4/AAC files.

We start off with installing mod and codecs:
Code:
apt-get install libapache2-mod-musicindex libogg-dev 
apt-get install libvorbis-dev libid3tag0-dev libmad0-dev libflac-dev
Add the mod_musicindex.so Module
Add this line to /etc/apache2/httpd.conf
Code:
LoadModule musicindex_module /usr/lib/apache2/modules/mod_musicindex.so
Finally, edit the <Directory> you want to
I use the /etc/apache2/conf.d/alias file

Assuming your music is in /home/foo/music the settings should look like these:
Code:
Alias /music /home/foo/music/
<Directory /home/foo/music/>
    Options Indexes MultiViews FollowSymlinks
    AllowOverride       Indexes
    MusicLister         On
    MusicSortOrder      album disc track artist title length bitrate freq filet$
    MusicFields         title artist length bitrate
    MusicAllowDownload  Off
    MusicAllowStream    On
    MusicAllowSearch    On
#    MusicRssItems       Off
    MusicPageTitle      home
    MusicCssDefault     musicindex.css
    MusicCachePath      /tmp/musicindex
#    MusicIceServer     [ice.domain.my]:8000
#    MusicCookieLife    300
</Directory>
I'd recommend adding password protection: http://httpd.apache.org/docs-2.0/howto/auth.html

Restart Apache
Code:
/etc/init.d/apache2 restart
Finished!
Your Server is now ready to stream!
This example you'd access @ http://localhost/music/


Weblinks:
http://www.parisc-linux.org/~varenet/musicindex/
http://httpd.apache.org/docs-2.0/


Simple Cosmetics
The interface doesn't look so good out of the box I think.
A simple way to change it a bit is the file /var/www/musicindex/musicindex.css.

For example the a.rss tag:
Code:
table#directories div > a.rss {
  font-size: 10pt;
}
If you change it like this:
Code:
table#directories div > a.rss {
  font-size: 10pt;
  margin-left:200px;
}
you'll have much more overview because of space between the directories

Enjoy your music streams
tornamodo is offline   Reply With Quote
Old May 15th, 2005   #2
rwabel
Dipped in Ubuntu
 
Join Date: Nov 2004
Location: Bern, Switzerland
Beans: 570
Send a message via ICQ to rwabel
Re: HowTo stream mp3,ogg,mp4 files with Apache2 (libapache2-mod-musicindex)

Quote:
Originally Posted by tornamodo
Hope you like this: How-To make Apache2 Stream Music.
We use libapache2-mod-musicindex; it works with MP3, FLAC, Ogg Vorbis or MP4/AAC files.

We start off with installing mod and codecs:
Code:
apt-get install libapache2-mod-musicindex libogg-dev 
apt-get install libvorbis-dev libid3tag0-dev libmad0-dev libflac-dev
Add the mod_musicindex.so Module
Add this line to /etc/apache2/httpd.conf
Code:
LoadModule musicindex_module /usr/lib/apache2/modules/mod_musicindex.so
Finally, edit the <Directory> you want to
I use the /etc/apache2/conf.d/alias file

Assuming your music is in /home/foo/music the settings should look like these:
Code:
Alias /music /home/foo/music/
<Directory /home/foo/music/>
    Options Indexes MultiViews FollowSymlinks
    AllowOverride       Indexes
    MusicLister         On
    MusicSortOrder      album disc track artist title length bitrate freq filet$
    MusicFields         title artist length bitrate
    MusicAllowDownload  Off
    MusicAllowStream    On
    MusicAllowSearch    On
#    MusicRssItems       Off
    MusicPageTitle      home
    MusicCssDefault     musicindex.css
    MusicCachePath      /tmp/musicindex
#    MusicIceServer     [ice.domain.my]:8000
#    MusicCookieLife    300
</Directory>
I'd recommend adding password protection: http://httpd.apache.org/docs-2.0/howto/auth.html

Restart Apache
Code:
/etc/init.d/apache2 restart
Finished!
Your Server is now ready to stream!
This example you'd access @ http://localhost/music/


Weblinks:
http://www.parisc-linux.org/~varenet/musicindex/
http://httpd.apache.org/docs-2.0/


Simple Cosmetics
The interface doesn't look so good out of the box I think.
A simple way to change it a bit is the file /var/www/musicindex/musicindex.css.

For example the a.rss tag:
Code:
table#directories div > a.rss {
  font-size: 10pt;
}
If you change it like this:
Code:
table#directories div > a.rss {
  font-size: 10pt;
  margin-left:200px;
}
you'll have much more overview because of space between the directories

Enjoy your music streams
thanks for the howto. it's really a sweet thing
does shuffle and stream work for you?
rwabel is offline   Reply With Quote
Old May 16th, 2005   #3
tornamodo
First Cup of Ubuntu
 
Join Date: May 2005
Beans: 3
Send a message via Yahoo to tornamodo
Re: HowTo stream music with Apache2 (libapache2-mod-musicindex)

Yes, shuffle & stream - everything works fine!

Only the RSS is not working. I disabled the option anyway by adding "color: white;" to the a.rss tag in /var/www/musicindex/musicindex.css.
Code:
table#directories div > a.rss {
  font-size: 10pt;
  margin-left:200px;
  color: white;
}
The only problem i have with "Badly Drawn Boy - About A Boy". The tracks stop at about 3/4 of the length...
All other files are working perfect - even over the net (200kb/50kb connection)

Shuffle and Stream works really nice
tornamodo is offline   Reply With Quote
Old May 16th, 2005   #4
Sniffer
Gee! These Aren't Roasted!
 
Sniffer's Avatar
 
Join Date: Nov 2004
Location: Anywhere
My beans are hidden!
Re: HowTo stream mp3,ogg,mp4 files with Apache2 (libapache2-mod-musicindex)

Thks for this one, will come very in handy.
Sniffer is offline   Reply With Quote
Old September 16th, 2006   #5
tomski
Way Too Much Ubuntu
 
tomski's Avatar
 
Join Date: Sep 2005
Location: Surrey, ENGLAND
Beans: 260
Ubuntu 9.04 Jaunty Jackalope
Send a message via AIM to tomski Send a message via MSN to tomski
Re: HowTo stream mp3,ogg,mp4 files with Apache2 (libapache2-mod-musicindex)

Thanks for the HowTo

I tried various embedded players and gave up when i spotted this!!
This is what i origanlly wanted

Cheers
__________________
If everything in life was easy, we would learn nothing!!
Ubuntu/Win XP pro(Ubuntu primaryOS Gnome/FluxBox[(1600x1200/1440x1050)Nv9400GT(1Gb),3.3ghz,3GB
|My site=|=Hosted by|
tomski is offline   Reply With Quote
Old December 1st, 2006   #6
Tragos
First Cup of Ubuntu
 
Tragos's Avatar
 
Join Date: May 2006
Location: Helsinki, Finland
Beans: 6
Kubuntu 7.10 Gutsy Gibbon
Re: HowTo stream mp3,ogg,mp4 files with Apache2 (libapache2-mod-musicindex)

Cheers, mate!

Nice how-to, now I can easily listen to music from my server with my Nokia 770. However, you did the configurations to Apache in a bit old-fashioned way.

Quote:
Originally Posted by tornamodo View Post
Add the mod_musicindex.so Module
Add this line to /etc/apache2/httpd.conf
In Apache2 each LoadModule row is written to its own file in /etc/apache2/mods-available/. In fact a file called musicindex.load is already created in Dapper when installing the libapache2-mod-musicindex deb package. Modules are enabled by symlinking the .load file to directory /etc/apache2/mods-enabled/.
Code:
sudo ln -s /etc/apache2/mods-available/musicindex.load /etc/apache2/mods-enabled/
Quote:
Originally Posted by tornamodo View Post
Finally, edit the <Directory> you want to
I use the /etc/apache2/conf.d/alias file
Directories can be created in a similar way. Instead of using apache1-style /etc/apache2/conf.d/alias, we create configuration files for each directory in /etc/apache2/sites-available/. Then we symlink it to /etc/apache2/sites-enabled/.

Code:
sudo ln -s /etc/apache2/sites-available/music /etc/apache2/sites-enabled/.
Now we can easily disable modules and directories we don't need just by deleting the symlinks. No need to search for huge configuration files for the right rows to be commented out.
Tragos is offline   Reply With Quote
Old December 24th, 2006   #7
BatteryCell
A Carafe of Ubuntu
 
BatteryCell's Avatar
 
Join Date: Feb 2006
Beans: 151
Kubuntu 7.10 Gutsy Gibbon
Re: HowTo stream mp3,ogg,mp4 files with Apache2 (libapache2-mod-musicindex)

Hey thanks a lot I've been looking for something like this for a while

Oh but when I installed it there wasnt a default musicindex.css or musicindex folder, I can make my own and I did, but I was just wondering if anyone had a default .css file they could post ?
__________________
Never let your sense of morals prevent you from doing what's right.
Isaac Asimov
BatteryCell is offline   Reply With Quote
Old December 25th, 2006   #8
envis
Just Give Me the Beans!
 
envis's Avatar
 
Join Date: Jun 2006
Location: montreal
Beans: 79
Ubuntu 6.06 Dapper
Re: HowTo stream mp3,ogg,mp4 files with Apache2 (libapache2-mod-musicindex)

is this more like an automatically created index type of page that posts your music library automatically or is it more like a streaming component that would make apache stream audio any better?

i host somekind of "interactive radio station" already.. just wondering if that module could be of any use to me...

im a newbie in server admin ....

if it just builds an index from your music library, i've already sweated on a script that builds a whole freaking website from my audio libraby... but if it can somehow make apache transmit mp3 or ogg better... then i might need it!....
envis is offline   Reply With Quote
Old January 20th, 2007   #9
ronlybonly
Just Give Me the Beans!
 
Join Date: May 2006
Location: The beautiful mountains of Colorado
Beans: 57
Ubuntu 6.06
Send a message via AIM to ronlybonly Send a message via MSN to ronlybonly Send a message via Yahoo to ronlybonly
Re: HowTo stream mp3,ogg,mp4 files with Apache2 (libapache2-mod-musicindex)

Thanks for the HOWTO! I can't wait to try this out!
ronlybonly is offline   Reply With Quote
Old April 5th, 2007   #10
robert@debian
5 Cups of Ubuntu
 
robert@debian's Avatar
 
Join Date: Apr 2006
Location: /Germany/Munich
Beans: 31
Ubuntu 7.10 Gutsy Gibbon
Send a message via ICQ to robert@debian
Re: HowTo stream mp3,ogg,mp4 files with Apache2 (libapache2-mod-musicindex)

Thanks for this fabulous HowTo! This one helped me alot.

This is the most comfortable way to listen to my music @ work

__________________
Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it
robert@debian is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:11 PM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry