Koozali.org: home of the SME Server

Netjuke HOWTO updated for 5.6UE

Michael Smith

Netjuke HOWTO updated for 5.6UE
« on: January 22, 2003, 11:03:16 PM »
Original HOWTO for 5.5 is here:
http://forums.contribs.org/index.php?topic=5061.msg17805#msg17805

Netjuke HOWTO for SME Server v. 5.6 Unsupported Developer Edition

DISCLAIMER:  I've made every effort to be thorough and careful, even doing a special SME install on a test box just for this, BUT if you ruin your SME server I'm not responsible!  If you spot any errors or have any comments please send to me at nunayer@aol.com

Why Netjuke?  Netjuke uses a real, live MySQL database to store music info, so you can access your entire music collection by artist, track title, album title, genre -- or a random selection from any and all of the above.  It's a really, really good set of PHP scripts and has breathed new life into my CD collection.  My wife loves it -- I set up a virtually silent PC in our entertainment center with a TV-out, linked into our home network and with a wireless keyboard/mouse combo, and she'd probably throw me out of the house if I told her she couldn't have her Netjuke.  A big "thank you" goes out to developer Stephane Daury for this wonderful code.

Further note on Christmas 2002 -- how nice it was to give my Christmas-themed MP3s a special Christmas ID tag, then ask Netjuke for 50 Christmas songs and enjoy ...

The Netjuke home page:
http://netjuke.sourceforge.net

Install documentation:
http://netjuke.sourceforge.net/docs/INSTALL.txt

Read it!  Stephane Daury has done a good job of providing a quick guide and a more in-depth discussion, as well.  Of course, he didn't use SME.

Discussion forum:
http://sourceforge.net/forum/?group_id=42076

First, you must prepare your database.  I recommend using PHPMyAdmin to do your database dirty work.
Install PHPMyAdmin (no, I'm not going to do a mini-HOWTO for that!) from:

http://myezserver.com/downloads/mitel/contrib/phpmyadmin/    (thanks very much Darrell May!)

Create a database for netjuke:

Database:   netjuke
Username:   netjuke
Password:   (MAKE UP YOUR OWN PASSWORD PLEASE!!!!)

Give the user all SQL privileges. (Anyone care to comment on what privileges are actually necessary?)  At this point I reloaded SQL just to be on the safe side.

Then create an ibay from the server manager:

Information bay name:   netjuke
Description:      networked jukebox
Group:         everyone
User access:      Write=group, Read=everyone
Public access:   (As you like it; I use "Local network, no password required" for my LAN)
Execution of dynamic content:   enabled

I recommend not setting a password on this ibay.

The next steps require either console or shell access.  Personally, I use SSH Secure Shell for my non-commercial work and PuTTY when I need to do something for a client  You can, of course, do it from a keyboard directly attached to your SME server.

SSH Secure Shell:   http://www.ssh.com/support/downloads/secureshellwks/non-commercial.html
PuTTY:      http://www.chiark.greenend.org.uk/~sgtatham/putty/

From the console or shell prompt (note that you should be able to copy & paste the commands if using SSH or PuTTY):

cd /home/e-smith/files/ibays/netjuke
wget http://unc.dl.sourceforge.net/sourceforge/netjuke/netjuke-1.0b16-php4.1+.tar.gz
tar -xvzf netjuke-1.0b16-php4.1+.tar.gz

This will unzip all files into a subfolder called "netjuke".  What we have to do now is move the contents of THAT folder into the ibay's "html" folder.  Note that the "mv" command is "mv (space)(STAR)(space)(DOT)(DOT)(SLASH)html(SLASH)" which translates to "move everything, including subfolders, from the current folder into the html folder, one level down from the parent folder of the current folder (thus the "dot dot").

cd /home/e-smith/files/ibays/netjuke/netjuke
mv * ../html/

Check to see that you can access the "netjuke" ibay from your network.  If you cannot, you have a login name/password problem or you haven't correctly configured the ibay.  

Now we're ready to run the scripts.  The next step is from a web browser:

http://(IP ADDRESS of YOUR SME SERVER)/netjuke/installer/installer.php

Click "Accept & Install" if you understand the license & wish to proceed.

Read the documentation.  Read the documentation.  Reread any parts you don't understand.  Then click "Install Form" to continue.

You will be asked for the name of the netjuke database you created, user, and password.  You must also set up an admin login & password.  Note that DBHost is typically 127.0.0.1 (the localhost).

This will generate & offer to download a file named "inc-prefs.php", which you should save to a file.  For a reason I don't know, I was unable to save it directly into the location it needs to be in, namely, the "etc" folder under the "html" folder in the netjuke ibay.  So I saved it into the "html" folder, which I was able to access easily via My Network Places, then used the Linux "mv" command from the console/shell to move inc-prefs.php to the etc. folder, like so:

cd /home/e-smith/files/ibays/netjuke/html
mv inc-prefs.php ./etc/

(Note the SINGLE dot in that command, rather than the double dot.)

You can also use a file transfer, such as that offered in SSH Secure Shell, to move the file into place.

If you run into trouble saving the inc-prefs file, the installer will have already populated the Netjuke database, and you must go into phpMyAdmin and drop all the tables in the Netjuke database to rerun the install.  Otherwise Netjuke thinks it's already installed and refuses to proceed with a fresh install.

According to Daury's install documentation (which, again, you definitely should read) you must now change permissions on the inc-prefs.php file and /home/e-smith/files/ibays/netjuke/html/var/data folder, making them either owned by the web server user, or world-writable (less secure.)  I chose to make them world-writable because for some reason using "chown" didn't work for me.  I also changed the permissions on the "music" folder, because otherwise I couldn't copy files to it!

cd /home/e-smith/files/ibays/netjuke/html/var
chmod -R 777 data
chmod -R 777 music

(I welcome comments, horrified or otherwise, on why this is a bad idea & how I should do it better.  Help me make this a better HOWTO!)

cd /home/e-smith/files/ibays/netjuke/html/etc
chmod 777 inc-prefs.php

I also deleted the index.html file from the netjuke ibay, so I wouldn't get the default SME page if I neglected to specify "index.php" when logging in to the jukebox.  And per Daury's documentation, I also deleted the "installer" directory for better security.   WATCH OUT here as the "rm -rf" command is a good candidate for the most destructive command in Linux!  If you were to do "rm -rf *" from the root of your filesystem you would destroy everything!

cd /home/e-smith/files/ibays/netjuke/html
rm -rf index.html
rm -rf installer

Now you should be able to return to your web browser and access your new Netjuke setup with the following URL:

http://(IP ADDRESS of YOUR SME SERVER)/netjuke

Use the Admin function to customize.  I set my Security Mode to 0.1 so I could login from anywhere but no one could create a user.  I DID specify a security key.  To make my Netjuke accessible to the Internet, I changed the "Web Path" and "Music Server" values to reflect my dyndns.org name, i.e. I replaced "http://192.168.1.21:80/netjuke" with "http://(MYDYNDNS).dyndns.org:80:netjuke" in the Web Path and did likewise for the "Music Server".  If you do this, you must also change the properties of the ibay to reflect that you want it accessible outside your local network.

Now load some music:  everything goes in /home/e-smith/files/ibays/netjuke/html/var/music

The great thing about Netjuke is that, in contrast to the MP3 Jukebox blade, you don't need to concern yourself with organizing your music.  Just dump it into the music directory in any way that makes sense to you.  Want to create subdirectories by artist?  Fine.  By album?  Fine.  One giant directory?  Fine.  Netjuke will sort everything out for you.  Daury himself says he creates subdirectories with generic names such as MP3001, MP3002, etc. and fills them just full enough to fit on a CD-R, so it's easy for him to make backups of his music.  That made sense to me but I've been too lazy to rework my subfolders from when I was using the MP3 Jukebox blade.

Once you've loaded some music, it's time to tell Netjuke to sort it out.  Use the "Recursive File Finder" from Admin; it will go through all your music files and extract whatever information it can from ID3 tags on MP3 files.

Go back to "Browse" and enjoy.

One final note:  I found that even though I used ExactAudioCopy to rip my CDs, and accessed the FreeDB database to get track names, the tags didn't really suit me.  I ended up using the Dapyx MP3 Explorer to "groom" my music tags, setting genre IDs to my taste and fixing artist/title on compilation CDs, which for some reason don't usually come out right.

http://www.dapyx-soft.com

After I was finished grooming my tags, I told Netjuke to drop & reload all music info, from Admin/Music Database Maintenance/Clear All Music-Related Data.  Then I re-ran the Recursive File Finder and everything was much nicer -- genres, artists, albums all cleaned up.

Thanks for paying attention all this way!  I hope it worked out OK for you.  Again, please send comments/flames, etc. to nunayer@aol.com (don't hold it against me that I'm using AOL email -- it comes in handy to have an email address I don't mind publicizing to the world!  I get >50 pieces of spam a day at this address and <2 at my primary email).

Regards to all and happy Netjuking,
Michael Smith

Upaboveit

Re: Netjuke HOWTO updated for 5.6UE
« Reply #1 on: March 03, 2003, 11:31:57 AM »
Thanks for the destructions. All installs well and it's up and running. However, I'm not sure where the problem in the code lies but indexing a large collection of MP3s for the first time results in a failure on my machine. The status page hits 1000 and then stalls. The indexing never completes. I have a fair amount of directories and MP3s for it to run through (about 20,000 files) but not enough to think the hardware is at fault (ServerWorks, dual 667, 256MB RAM and 10K SCSI).

I can only assume that some part of the software chain, be it SME, MySql or php is at fault. A pity, as I was looking forward to a sql driven collection. Back on ApacheMP3 now.

Michael Smith

Re: Netjuke HOWTO updated for 5.6UE
« Reply #2 on: April 28, 2003, 05:55:18 AM »
You have to increase the amount of time a PHP script can run.  I can't remember exactly what to change in the php.ini file, but poke around in there or search the forum for that.  (Sorry, I'm a bit rushed for time or I'd do it meself.)

Tom Carroll

Re: Netjuke HOWTO updated for 5.6UE
« Reply #3 on: May 05, 2003, 09:58:09 AM »
Upaboveit, did Michael's idea help concerning the PHP script time?

Tom

g7pkf

Re: Netjuke HOWTO updated for 5.6UE works on 6.0 developer a
« Reply #4 on: July 10, 2003, 08:21:35 PM »
Thanks for the how to

it works on sme 6.0 developer as well!!!!  yippee

no probs just user errors

i am not a mysql or php or linux user and am present playing with sme

But i love my music!!

Regards Dean

Geoff S.

Re: Netjuke HOWTO updated for 5.6UE
« Reply #5 on: October 16, 2003, 02:01:57 PM »
Just want to point out that I have the latest version of netjuke running on my esmith 6b3 box. It is a handy program, although I had my mp3's organized in directories based on album. I don't like how netjuke rearranges things.

Also note that it takes a long time for netjuke to populate the db when you have a lot of mp3 files.