Wednesday, September 3, 2003

netjuke from source on debian

The debian/sarge package for netjuke didn't quite work out of the box and it was a little dated so I decided to install netjuke from source.

Dependancies -- apt-get the debian packages for mysql-client, mysql-server and make sure php4 and php4-mysql are installed.

Be sure to follow the post-installation steps of php4 in /usr/share/doc/php4/README.Debian.gz.
In particular, un-comment the line:


LoadModule php4_module /usr/lib/apache/1.3/libphp4.so


Uncomment:


AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps


and add index.php to the line like this:


DirectoryIndex index.php index.phtml index.php3 index.html


Remember to restart apache (/etc/init.d/apache restart)



Now you need to create a database to hold the netjuke tables. If you
have an existing database and user, you can use that. I have fresh
MySQL install with no table nor any non-root database users, so I did
this:



  • By default debian's MySQL server doesn't listen on the network
    port but netjuke wanted to connect that say, so edit /etc/mysql/my.cnf
    to enable it by commenting out the skip-networking line and
    restart MySQL (/etc/init.d/mysql restart)


  • Check to see that it worked:

    $ mysqladmin -u root password 'sekert'
    $ mysqladmin -u root -p create netjuke
    Enter password:
    $ mysql -u root -p mysql
    Enter password:

    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 6 to server version: 4.0.13-log

    Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
    mysql> grant all privileges on netjuke.* to netjuke@localhost
    identified by 'othersekret;
    Query OK, 0 rows affected (0.01 sec)



  • Now you are ready to install netjuke.

    Go to the top of the web space, by default on debian it is /var/www
    and unpack netjuke (tar zxvf ~/ netjuke-1.0-rc2.tar.gz).

    Now as the netjuke docs say, go to http://127.0.0.1/netjuk
    e/installer/installer.php

    and click through the GPL license to the installation page. My
    answers were:


    DB Type: MySQL
    DB Host: localhost
    DB User: netjuke
    DB Password: othersekret
    Sys. Admin. email: marc@nozell.com
    Admin Password: moresekret


    After a submit (be sure javascript is enabled, netjuke uses it
    heavily) it will offer to save inc-prefs.php. Copy that to
    /var/www/netjuke/etc/ and you may need to set the privileges to the
    web server can read the file
    chmod 444 /var/www/netjuke/etc/inc-prefs.php


    You are almost done, so take a look at http://localhost/netjuke and
    log in and poke around some. Don't worry that there aren't any music
    files there, that is next.

    I keep my music files in /DATA/Music/ and didn't want to copy them to
    where netjuke wanted them (/var/www/netjuke/var/music), so I used
    ln to make them available like this:


    cp /var/www/netjuke/var/music/* /DATA/Music
    rm -rf /var/www/netjuke/var/music
    ln -s /DATA/Music /var/www/netjuke/var/music


    Now back to netjuke's web
    interface
    to import the files. Follow the links Admin->Recursive
    Audio File Finder->Start Scanning and then watch as the mp3/ogg/etc
    files are found and added to the netjuke database. If you have a lot
    (I have around 11G) you may need to import them a few at a time using
    the Admin->Music Directory Browser route and bring in a few
    directories at at time.