Simple Streaming Music Server Using Apache musicindex
While there is subsonic and what not for streaming music from your home machine to your work machine. I just came across this no non-sense (free) super easy to setup and use, personal Jukebox tool called musicindex. It is an Apache module so if you are already running Apache then setting this up would not take you more than 5 minutes.
This approach should work for any platform that supports Apache (so practically all). But this tutorial would focus on the setup on Linux machine, especially Ubuntu.
If you haven’t installed Apache yet, do so by running this command:
sudo apt-get install apache
After which you should point your browser to http://localhost to check if the default Apache page saying It Works! is visible. Next, install musicindex module for Apache.
apt-get install libapache2-mod-musicindex
Then enable the module by creating a symbolic link for the same in enabled modules folder
cd /etc/apache2/mods-enabled/
ln -s ../mods-available/musicindex.load
Then, open /etc/apache2/httpd.conf
with your favorite text editor, say
gksudo gedit /etc/apache2/httpd.conf
and add the following and save it. You must the change the path denoted in red to point to the root directory of your music collection.
Alias /music “/absolute_path_to/my/music/folder”
<Directory “/absolute_path_to/my/music/folder“>
Options Indexes MultiViews FollowSymlinks
AllowOverride Indexes
# Can be overriden in .htaccess
MusicIndex On +Stream +Download +Search -Rss -Tarball
MusicSortOrder album disc track artist title length bitrate freq filetype filename uri
MusicFields track title artist length bitrate freq filetype
MusicPageTitle Sangeet…
MusicDefaultCss musicindex.css
# Can only be set in apache configuration
MusicDefaultDisplay HTML
MusicIndexCache /tmp/musicindex
# MusicIceServer [ice.domain.my]:8000
# MusicCookieLife 300
MusicDirPerLine 3
</Directory>Alias /musicindex “/usr/share/mod_musicindex”
<Directory /usr/share/mod_musicindex”>
Order allow,deny
Allow from all
</Directory>
Basically this code above would tell Apache to create two aliases, first one is the alias “/music” pointing to your music collection. So, when you point your browser to http://ip_address_of_server_machine/music it would take you to the main directory of your music collection. musicindex supports streaming of mp3 as well as ogg files. You would also like to keep the Alias for /musicindex as it is to get the default styling for the webpage to work. More configuration options can be found at the readme file for musicindex.
To get the aliases to work you need to restart the Apache2 server first by:
/etc/init.d/apache2 restart
Thats it now you should have your online jukebox ready to serve you music on demand. It even allows you to stream music to your iPhone, iPad etc., however only one song at a time.
Currently it can be accessed by anybody on your network, if you want to have only selective access, then wait for my post on enabling password protection.
You might also like
Access or Stream Windows 7 Multimedia Share to Linux Windows 7 samba... | Subtunes: Itunes like UI for subsonic music player If you like... | Beginning of An Affair Between Ubuntu One & iOS With the launch... | Setup Subsonic on Ubuntu to Stream / Access Your Video Collection Subsonic is... |
About the Author
One Comment on “Simple Streaming Music Server Using Apache musicindex”
Write a Comment
Gravatars are small images that can show your personality. You can get your gravatar for free today!
I cannot get apache to open music folder? Below are extract from apache2.conf, /var/syslog and web page error:
Alias /music “/home/pi/Music”
Options Indexes MultiViews FollowSymlinks
AllowOverride Indexes
# Can be overriden in .htaccess
MusicIndex On +Stream +Download +Search -Rss -Tarball
MusicSortOrder album disc track artist title length bitrate freq filetype filename uri
MusicFields track title artist length bitrate freq filetype
MusicPageTitle Sangeet.
MusicDefaultCss musicindex.css
# Can only be set in apache configuration
MusicDefaultDisplay HTML
MusicIndexCache /tmp/musicindex
# MusicIceServer [ice.domain.my]:8000
# MusicCookieLife 300
MusicDirPerLine 3
Alias /musicindex “/usr/share/mod_musicindex”
Order allow,deny
Allow from all
sudo /etc/init.d/apache2 restart
Aug 12 20:00:30 raspberrypi systemd[1]: Expecting device dev-disk-by\x2duuid-6010\x2dA0D1.device…
Aug 12 20:00:30 raspberrypi systemd[1]: Stopping LSB: Apache2 web server…
Aug 12 20:00:31 raspberrypi apache2[4847]: Stopping web server: apache2.
Aug 12 20:00:31 raspberrypi systemd[1]: Starting LSB: Apache2 web server…
Aug 12 20:00:31 raspberrypi apache2[4872]: Starting web server: apache2[Fri Aug 12 20:00:31.974652 2016] [alias:warn] [pid 4889] AH00671: The Alias directive in /etc/apache2/apache2.conf at line 244 will probably never match because it overlaps an earlier Alias.
Aug 12 20:00:33 raspberrypi apache2[4872]: .
Aug 12 20:00:33 raspberrypi systemd[1]: Started LSB: Apache2 web server.
Forbidden
You don’t have permission to access /music on this server.
Apache/2.4.10 (Raspbian) Server at 10.0.0.12 Port 80
Like or Dislike:
0
0
[Reply]