How To: Stream Your Music Library to Any Computer

norman

Sometimes you just want to browse and listen to your album collection at the office without having to load it all into a portable music player. Pandora and Last.fm are great web services that can help you discover new music, but they won’t let you specify your own music playlist. Streaming music from within a home network is easy with iTunes and Windows Media Player; what’s trickier is getting access to your 100GB music library while away from home. We’ll teach you how to turn your library into an Internet radio station with Apache server software and a little-known program called netjukebox. You’ll be able to browse your collection via a gallery of album cover art, stream custom playlists, and even download entire albums as zip files.

Step 1: Set up an Apache Server

The first thing you need to do is turn your desktop into an Apache web server. This will let you run the netjukebox software and serve web content. Installing an Apache server can be a complicated process, so we recommend using XAMPP ( www.apachefriends.org ), a web server package, to streamline the setup. This package includes Apache HTTP, MySQL, PHP, and even FTP server support. Download the latest version of XAMPP for Windows (1.7 as of this writing) and run the installer.

Choose the default install location ( C:\xampp is recommended, especially for Vista) and choose your desired shortcut icons on the Install screen. You’re also given an option to install Apache as a service, as opposed to an application, which allows it to start even before you’re logged in to Windows.

After XAMPP finishes installing, launch its Control Panel. Click the Start button next to Apache and MySQL to enable the web server. The other options let you run a FileZilla FTP server and a Mercury email server, which we won’t be using here. If Apache and MySQL are activated properly, you’ll see their status as “Running,” highlighted by a green bar. Minimize this Control Panel to the system tray.

You might face a Windows Security Alertfor both Apache and Mysql notifying you that Windows Firewall has blocked these programs. Click "Unblock" for both.

Step 2: Install netjukebox

Head to the official netjukebox website ( www.netjukebox.nl/ ) and find you way to the downloads section. Download the netjukebox for PHP zip package —the current version is 5.10b—as well as the codec pack linked below it. Navigate to the “ htdocs ” subfolder of your XAMPP install direcotry and extract the contents of the netjukebox zip file into a folder called “ netjukebox .”

Open a web browser and type “ http://localhost/netjukebox/ ” into the address bar. If you extracted the files correctly, you should see a light-blue login page.netjukebox will indicate to you that your default administrator login and password are admin and admin, respectively.

Create a new folder called “ codecs ” within the netjukebox folder, then unzip the 14 files in the previously downloaded codec zip file into this new folder ( C:\xampp\htdocs\netjukebox\codecs ).

Step 3: Configure Your Security

Access the XAMPP settings page by directing your web browser to http://localhost/xampp/ . Choose your language (we're assuming English) to go through to the main XAMPP page. Click the Security link in the menu on the left side of the page.

If you are using Vista, you may encounter an error page that reads: "Access forbidden! You don't have permission to access the requested object. It it either read-protected or not readable by the server." To get around this,go to your "C:\xampp\apache\conf\extra" folder and open httpd-xampp.conf in Notepad. Find the two lines that read "Allow from localhost" and replace them with "Allow from 127.0.0.1". Next, go to your XAMPP control panel and STOP Apache before restarting it again. Flush your browser's cache and try accessing the security page again ( http://localhost/security/index.php ).

Right now, the status of your XAMPP pages and MySQL admin user root should be unsecure. Click the link in the middle of the page ( http://localhost/security/xamppsecurity.php ) to set up your server passwords.

Choose a strong password in the required field under the MySQL section, confirm it, and select “cookie” as the PhpMyAdmin authentification setting. Leave the “Safe plain password in text filed” box unchecked. Click the "Password Changing" button to submit the new password.

Enter and confirm a username and password for the XAMPP Directory Protection (.htaccess) section as well. Click Submit to save your changes. You should receive a confirmation that your XAMPP directory is now secure, and the security page will reflect the new security status. From now on, you'll have to enter your new XAMPP login and password if you want to access the XAMPP browser page.

Step 4: Configure netjukebox

Navigate to the “ include ” subfolder under netjukebox (C:\xampp\htdocs\netjukebox\include) and open the config.inc.php file with Notepad (drag the file into the Notepad app). You’ll have to edit a few lines in this configuration file to direct netjukebox to your music library and set up an administrator password.

Search for the line that begins with $cfg[‘media_dir’]. You’ll see that the default location where netjukebox searches for your music collection is D:\Media. Replace that with the location of your music files. We directed netjukebox to C:/Music/ . Note that you must use forward slashes AND a trailing slash in this field.

Next, search for the line in this config file that begins with $cfg[‘codec_dir’]. This is where netjukebox looks for the audio codecs to play or transcode your MP3s. Replace the default address with C:\xampp\htdocs\netjukebox\codecs\\ . It’s important to note that we use backslashes in this field, plus we end the line with an extra backslash (double backslash).

Finally, find the section that starts with the MySQLi Configuration header in this same file. Under the line $cfg[‘mysqli_password’], replace the blank password field with the MySQL password you entered in the previous security step. Note that this is the MySQL password and not the XAMPP Directory protection password, though you may have entered the same code for both. Save and close the configuration file.

Step 5: Import Your Music

Using your web browser, go to your netjukebox administrator page ( http://localhost/netjukebox/users.php ). Enter “admin” as both the default username and password. Click the admin username on the left and change the password. The admin account lets you create new user accounts, as well as restrict what users can do on your netjukebox. You'll have to relog back in after you do this.

Go to the main netjukebox configuration panel by clicking the config tab at the top of the page. If this is your first time using netjukebox, click the Update link under the Configuration window. Netjukebox will scour your music library and index all your albums. This may take a while, depending on how many songs you have in your collection and the speed of your system.

Netjukebox also has a really cool feature that automatically searches for album art for all of your CDs. In the Configuration menu, click the Update Image link, and the system will cycle through all of your albums, searching online databases for album covers based on folder names, and let you approve each piece of cover art. Alternatively, you can just click the "Update images from the Internet" link that shows up after your album collection is updated (see below).

This is the most tedious step in this tutorial, but the effort is worth it. If the auto search can't find the right album cover, you can edit the artist and album search strings or even manually upload your own album cover.

Step 6: Broadcast Your Jukebox

To remotely stream or download your music, find your IP with a service like www.whatismyip.com . From any web browser, type in your IP and add the /netjukebox/ extension. If you’re not behind any firewalls, you’ll get access to the netjukebox login page and be able to browse through all of your music files!

You can also set up a dynamic DNS to access your music server without memorizing your IP.  To do so, go to www.dyndns.com and create an account. Authenticate the account via email and log into the dyndns website. Click the "Services" tab and go to "Dynamic DNS" option. Follow through the "Get Started" link to continue.

Enter a custom subdomain (we used our name) and select from one of the 88 available domains. Enter your IP address that you found with whatismyip.com under the "IP Address" field or click the auto-detect option if you're on your localhost machine. Leave all the other settings as their default and click "Create Host".

From now on, if you want to access your netjukebox from anywhere, just type your dynamic DNS address and add "/netjukebox" into the browser address field. For example, our address would be "http://norman.dnydnsdomain.net/netjukebox"

If you're set up behind a home router, you will need to use port forwarding to access your netjukebox server. Go into your router settings (run ipconfig in the command prompt to find your router/gateway address) and find the Port forwarding section.

Add a new port forwarding rule set with both TCP and UDP, using 8088 as the external port and 80 as the internal port. Enter your system's network IP address (also found with the ipconfig command) and insert it in the appropriate field. Refer to our screenshot below for an example.

With port forwarding in place, you have to add the external port (we chose 8088) to your dynamic dns address to be routed to netjukebox. Using our previous sample domain, our new netjukebox address would be "http://norman.dnydnsdomain.net:8088/netjukebox"

And that's it! Be sure to mess around with your netjukebox settings to discover its awesome features. Remember that all of your streams will be limited by your home internet connection (upload speeds), so don't give out your private netjukebox account to anyone!

Around the web

by CPMStar (Sponsored) Free to play

Comments