Difference between revisions of "KPlaylist"

From SME Server
Jump to navigationJump to search
(→‎Adding more sources folders: apache read/write access)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{Languages|KPlaylist}}
 
{{Languages|KPlaylist}}
  
=Maintainer=
+
=KPlaylist for SME Server=
 +
{{Level|medium}}
 +
 
 +
==Maintainer==
 
[[User:Cool34000|Sylvain Gomez]]<br/>
 
[[User:Cool34000|Sylvain Gomez]]<br/>
 
mailto:sylvaingomez@free.fr
 
mailto:sylvaingomez@free.fr
  
=kPlaylist Description=
+
==kPlaylist Description==
 
[http://www.kplaylist.net/ kPlaylist] is a free PHP system that makes your music collection available via the Internet.  
 
[http://www.kplaylist.net/ kPlaylist] is a free PHP system that makes your music collection available via the Internet.  
  
Line 12: Line 15:
 
Read [http://www.kplaylist.net/index.php?readmore=true more] about kPlaylist and check the [http://www.kplaylist.net/index.php?features=true features].
 
Read [http://www.kplaylist.net/index.php?readmore=true more] about kPlaylist and check the [http://www.kplaylist.net/index.php?features=true features].
  
=kPlaylist RPM=
+
==kPlaylist RPM==
==Download==
+
===Install===
You can download this package ''[http://mirror.contribs.org/smeserver/contribs/sgomez/contribs/kplaylist/smeserver-kplaylist-1.7.426-1.noarch.rpm  here]''.
 
 
 
If you want to save it directly on your SME Server, you can give these commands at the prompt:
 
wget http://mirror.contribs.org/smeserver/contribs/sgomez/contribs/kplaylist/smeserver-kplaylist-1.7.426-1.noarch.rpm
 
==Install==
 
 
To install kPlaylist, issue the following command:
 
To install kPlaylist, issue the following command:
  yum localinstall smeserver-kplaylist-1.7.426-1.noarch.rpm
+
  yum install smeserver-kplaylist --enablerepo=smecontribs
 
You can ignore the yum-comments ''signal event post-upgrade'' and ''signal-event reboot''.
 
You can ignore the yum-comments ''signal event post-upgrade'' and ''signal-event reboot''.
==Special commands==
+
 
 +
===Special commands===
 
To view kPlaylist's configuration, you can type the following at the prompt:
 
To view kPlaylist's configuration, you can type the following at the prompt:
 
  config show kplaylist
 
  config show kplaylist
Line 31: Line 30:
 
  # MaxUpload      | xM          | 16M    | Max uploadable file size
 
  # MaxUpload      | xM          | 16M    | Max uploadable file size
 
  # URL            | new alias    |        | Optionnal alias for kPlaylist
 
  # URL            | new alias    |        | Optionnal alias for kPlaylist
 +
 
After any change to kPlaylist configuration, you should apply modifications by typing the following at the prompt:
 
After any change to kPlaylist configuration, you should apply modifications by typing the following at the prompt:
 +
expand-template /etc/httpd/conf/httpd.conf
 +
/etc/rc7.d/S86httpd-e-smith sigusr1
 +
Example: You want to change PublicAccess to "global"
 +
config setprop kplaylist PublicAccess global
 
  expand-template /etc/httpd/conf/httpd.conf
 
  expand-template /etc/httpd/conf/httpd.conf
 
  /etc/rc7.d/S86httpd-e-smith sigusr1
 
  /etc/rc7.d/S86httpd-e-smith sigusr1
  
==Update==
+
===Update===
The RPM installs the latest stable version (1.7.426). If you want to try the development release (1.7.464), simply upload the new file in '''''/opt/kplaylist/html/'''''.
+
The RPM installs the latest stable version (1.7.426). If you want to try the development release (1.7.464) or a custom install, simply upload the new file in '''''/opt/kplaylist/html/'''''.
  
 
Then edit this file and change MySQL password at line #71
 
Then edit this file and change MySQL password at line #71
Line 46: Line 50:
 
  chown root:www /opt/kplaylist/hmtl/index.php
 
  chown root:www /opt/kplaylist/hmtl/index.php
 
  chmod 660      /opt/kplaylist/hmtl/index.php
 
  chmod 660      /opt/kplaylist/hmtl/index.php
Then you need to update the database, this extra step will be done at your first login.
+
Then you may need to update the database, this extra step will be done at your first login.
  
Future RPM versions will of course be able to update an existing installation. A new RPM version will be released each time a stable version comes out.
+
===Uninstall===
==Uninstall==
 
 
To uninstall kPlaylist, just hit the following command:
 
To uninstall kPlaylist, just hit the following command:
 
  yum remove smeserver-kplaylist
 
  yum remove smeserver-kplaylist
Line 58: Line 61:
 
{{Warning box|Default MP3 folder will be deleted by this script! Move your files before launching this script!}}
 
{{Warning box|Default MP3 folder will be deleted by this script! Move your files before launching this script!}}
  
=kPlaylist Usage=
+
==kPlaylist Usage==
==Web Access==
+
===Web Access===
 
kPlaylist web interface is LAN ONLY by default (without HTTPS)
 
kPlaylist web interface is LAN ONLY by default (without HTTPS)
  
Line 66: Line 69:
 
  pass  : admin
 
  pass  : admin
 
Please change admin password first!
 
Please change admin password first!
==Getting started==
+
===Getting started===
 
kPlaylist's concept is pretty easy to understand:
 
kPlaylist's concept is pretty easy to understand:
 
  1) Upload your music in '''''/opt/kplaylist/files'''''(see the 3 following sections for more details)
 
  1) Upload your music in '''''/opt/kplaylist/files'''''(see the 3 following sections for more details)
 
  2) Update your database using Administration console ''Update''
 
  2) Update your database using Administration console ''Update''
 
  3) Enjoy!
 
  3) Enjoy!
==Upload==
+
===Upload===
 
Registered users can upload files. These files will be stored in '''''/opt/kplaylist/files''''' by default.
 
Registered users can upload files. These files will be stored in '''''/opt/kplaylist/files''''' by default.
  
Line 79: Line 82:
 
  /etc/rc7.d/S86httpd-e-smith sigusr1
 
  /etc/rc7.d/S86httpd-e-smith sigusr1
 
where ''xx'' is your needed size (don't forget the '''M'''!)
 
where ''xx'' is your needed size (don't forget the '''M'''!)
==Samba Access==
+
===Samba Access===
 
For faster local downloading/uploading you can use Samba to access '''''/opt/kplaylist/files'''''.
 
For faster local downloading/uploading you can use Samba to access '''''/opt/kplaylist/files'''''.
  
 
Simply browse your SME server shares and you will see a folder named '''''kplaylist'''''.
 
Simply browse your SME server shares and you will see a folder named '''''kplaylist'''''.
  
Existing SME accounts will be able to browse this new shared folder after the RPM install.
+
Only SME Admin account will be able to browse this new shared folder after the RPM install.
==Adding more sources folders==
+
 
 +
If you want to allow all SME users to browse this directory, issue the following command:
 +
chown -R root:shared /opt/kplaylist/files
 +
If you want to revert to default, issue the following command:
 +
chown -R www:www /opt/kplaylist/files
 +
 
 +
===Adding more sources folders===
 
kPlaylist Supports multiple music sources (drives, directories, nmb, smbfs, nfs, etc).
 
kPlaylist Supports multiple music sources (drives, directories, nmb, smbfs, nfs, etc).
  
Line 105: Line 114:
 
  expand-template /etc/httpd/conf/httpd.conf
 
  expand-template /etc/httpd/conf/httpd.conf
 
  /etc/rc7.d/S86httpd-e-smith sigusr1
 
  /etc/rc7.d/S86httpd-e-smith sigusr1
Verify that Apache (''www'') have read/write access to the new folder.
+
Verify that Apache (''www'' or ''shared'') have read/write access to the new folder and files.
  
Now go to kPlaylist web interface and login with the admin account. Clic on Admin control ''Settings''. Then clic on ''Filehandling'' and manually add your new path to the list (or create a symbolic link).
+
Now go to kPlaylist web interface and login with the admin account. Click on Admin control ''Settings''. Then click on ''Filehandling'' and manually add your new path to the list (or create a symbolic link).
  
==Multiple Download==
+
===Multiple Download===
 
If you want to allow multiple download, edit '''''/opt/kplaylist/html/index.php''''' and modify the following value to true:
 
If you want to allow multiple download, edit '''''/opt/kplaylist/html/index.php''''' and modify the following value to true:
 
  $cfg['archivemode'] = true;
 
  $cfg['archivemode'] = true;
 
Now you will have more download options!
 
Now you will have more download options!
==mp3mail==
+
===mp3mail===
 
kPlaylist can send mail. If you want to use this feature, you need to tweak MySQL ''max_allowed_packet'' (else you will see an error page when trying to send mails).
 
kPlaylist can send mail. If you want to use this feature, you need to tweak MySQL ''max_allowed_packet'' (else you will see an error page when trying to send mails).
  
Line 124: Line 133:
 
  expand-template /etc/httpd/conf/httpd.conf
 
  expand-template /etc/httpd/conf/httpd.conf
 
  /etc/rc7.d/S86httpd-e-smith sigusr1
 
  /etc/rc7.d/S86httpd-e-smith sigusr1
==ID3v2 support==
+
===ID3v2 support===
 
getid3 v1.7.x is the default recommended tag reader for kPlaylist. If you want to add this feature to your kPlaylist, just follow this quick howto.
 
getid3 v1.7.x is the default recommended tag reader for kPlaylist. If you want to add this feature to your kPlaylist, just follow this quick howto.
  
Line 137: Line 146:
 
  $cfg['getid3include'] = '/opt/kplaylist/getid3/getid3/getid3.php';
 
  $cfg['getid3include'] = '/opt/kplaylist/getid3/getid3/getid3.php';
 
Save the file and check if it's working: log in as a admin to kPlaylist, click on Settings and then on 'Filehandling'. If 'Write id3v2 with stream' is not disabled, getid3 should be working. You should also see the version number in the right.
 
Save the file and check if it's working: log in as a admin to kPlaylist, click on Settings and then on 'Filehandling'. If 'Write id3v2 with stream' is not disabled, getid3 should be working. You should also see the version number in the right.
==Cron job==
+
===Cron job===
 
A cron job can be created to update kPlaylist's database. This has the same effect of clicking on "Update" button in Administration console.
 
A cron job can be created to update kPlaylist's database. This has the same effect of clicking on "Update" button in Administration console.
  
Line 167: Line 176:
 
Now each day at 23:30 the server will auto-update kPlaylist database.
 
Now each day at 23:30 the server will auto-update kPlaylist database.
  
=Additional information=
+
==Additional information==
 
*[http://www.kplaylist.net/ Homepage]
 
*[http://www.kplaylist.net/ Homepage]
 
*[http://www.kplaylist.net/index.php?documentation=true Documentation]
 
*[http://www.kplaylist.net/index.php?documentation=true Documentation]
Line 177: Line 186:
  
 
----
 
----
[[Category: Contrib]]
+
[[Category: Deprecated Contrib]]
[[Category: Webapps]]
 

Latest revision as of 06:19, 18 April 2021


KPlaylist for SME Server

PythonIcon.png Skill level: medium
The instructions on this page require a basic knowledge of linux.


Maintainer

Sylvain Gomez
mailto:sylvaingomez@free.fr

kPlaylist Description

kPlaylist is a free PHP system that makes your music collection available via the Internet.

kPlaylist is a music database that you manage via the web. With kPlaylist you can stream your music (ogg, mp3, wav, wma, etc.), you can upload, make playlists, share, search, download and a lot more.

Read more about kPlaylist and check the features.

kPlaylist RPM

Install

To install kPlaylist, issue the following command:

yum install smeserver-kplaylist --enablerepo=smecontribs

You can ignore the yum-comments signal event post-upgrade and signal-event reboot.

Special commands

To view kPlaylist's configuration, you can type the following at the prompt:

config show kplaylist

You can change a few parameters:

   DB parameter   |    Options   | Default | Explanation
# HTTPS           | on/off       | off     | Enable/Disable forced https mode of web interface
# PublicAccess    | local/global | local   | Accessibility of web interface
# MaxUpload       | xM           | 16M     | Max uploadable file size
# URL             | new alias    |         | Optionnal alias for kPlaylist

After any change to kPlaylist configuration, you should apply modifications by typing the following at the prompt:

expand-template /etc/httpd/conf/httpd.conf
/etc/rc7.d/S86httpd-e-smith sigusr1

Example: You want to change PublicAccess to "global"

config setprop kplaylist PublicAccess global
expand-template /etc/httpd/conf/httpd.conf
/etc/rc7.d/S86httpd-e-smith sigusr1

Update

The RPM installs the latest stable version (1.7.426). If you want to try the development release (1.7.464) or a custom install, simply upload the new file in /opt/kplaylist/html/.

Then edit this file and change MySQL password at line #71

'pass' => 'kplaylist', # MySql password

You can retrieve your existing MySQL password with the following command:

config getprop kplaylist DbPassword

Then rename the file into index.php and apply security:

mv -f /opt/kplaylist/hmtl/kplaylist.1.7.464.php /opt/kplaylist/hmtl/index.php
chown root:www /opt/kplaylist/hmtl/index.php
chmod 660      /opt/kplaylist/hmtl/index.php

Then you may need to update the database, this extra step will be done at your first login.

Uninstall

To uninstall kPlaylist, just hit the following command:

yum remove smeserver-kplaylist

You can ignore the yum-comments signal event post-upgrade and signal-event reboot.

To completly remove kPlaylist (installation files ; MySQL user+database) you will need the following command:

sh /root/KPlaylist-Full-Uninstall.sh
Warning.png Warning:
Default MP3 folder will be deleted by this script! Move your files before launching this script!


kPlaylist Usage

Web Access

kPlaylist web interface is LAN ONLY by default (without HTTPS)

You can access the web interface at http://yourserver/kplaylist

login : admin
pass  : admin

Please change admin password first!

Getting started

kPlaylist's concept is pretty easy to understand:

1) Upload your music in /opt/kplaylist/files(see the 3 following sections for more details)
2) Update your database using Administration console Update
3) Enjoy!

Upload

Registered users can upload files. These files will be stored in /opt/kplaylist/files by default.

The default maximum uploadable file size is 16M (could be enough for most needs). You can modify this default value with following commands:

config setprop kplaylist MaxUpload xxM
expand-template /etc/httpd/conf/httpd.conf
/etc/rc7.d/S86httpd-e-smith sigusr1

where xx is your needed size (don't forget the M!)

Samba Access

For faster local downloading/uploading you can use Samba to access /opt/kplaylist/files.

Simply browse your SME server shares and you will see a folder named kplaylist.

Only SME Admin account will be able to browse this new shared folder after the RPM install.

If you want to allow all SME users to browse this directory, issue the following command:

chown -R root:shared /opt/kplaylist/files

If you want to revert to default, issue the following command:

chown -R www:www /opt/kplaylist/files

Adding more sources folders

kPlaylist Supports multiple music sources (drives, directories, nmb, smbfs, nfs, etc).

Option FollowSymLinks is also available which means that you can use symbolic links inside /opt/kplaylist/files.

Just remember that kPlaylist is restricted to /opt/kplaylist by default, you should override the existing template with a custom-template to allow access to the needed folder.

Reminder: Correct procedure to create a custom-template
# Create the folder if not exist
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf

# Copy original template
cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/98kplaylist /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/

# Edit /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/98kplaylist
# Replace line #34 with your needed settings
php_admin_value open_basedir /opt/kplaylist:/tmp:/usr/share/pear:/home/e-smith/files/ibays/mp3_ibay/files   (just an example)

# Apply your changes
expand-template /etc/httpd/conf/httpd.conf
/etc/rc7.d/S86httpd-e-smith sigusr1

Verify that Apache (www or shared) have read/write access to the new folder and files.

Now go to kPlaylist web interface and login with the admin account. Click on Admin control Settings. Then click on Filehandling and manually add your new path to the list (or create a symbolic link).

Multiple Download

If you want to allow multiple download, edit /opt/kplaylist/html/index.php and modify the following value to true:

$cfg['archivemode'] = true;

Now you will have more download options!

mp3mail

kPlaylist can send mail. If you want to use this feature, you need to tweak MySQL max_allowed_packet (else you will see an error page when trying to send mails).

Create the file /etc/e-smith/templates/etc/my.cnf/011max-allowed-packet if it doesn't exist and paste the following code in it:

max_allowed_packet=32M   (you may need to higher this value)

Then apply new modifications:

expand-template /etc/my.cnf
service mysqld restart
expand-template /etc/httpd/conf/httpd.conf
/etc/rc7.d/S86httpd-e-smith sigusr1

ID3v2 support

getid3 v1.7.x is the default recommended tag reader for kPlaylist. If you want to add this feature to your kPlaylist, just follow this quick howto.

First, Check the latest version here.

wget http://surfnet.dl.sourceforge.net/sourceforge/getid3/getid3-1.7.7.zip
unzip getid3-1.7.7.zip -d /opt/kplaylist/
rm -f getid3-1.7.7.zip

Now edit /opt/kplaylist/html/index.php and modify following lines:

  • Line #95, enable getid3
$cfg['enablegetid3'] = 1;
  • Line #98, provide path to getid3.php
$cfg['getid3include'] = '/opt/kplaylist/getid3/getid3/getid3.php';

Save the file and check if it's working: log in as a admin to kPlaylist, click on Settings and then on 'Filehandling'. If 'Write id3v2 with stream' is not disabled, getid3 should be working. You should also see the version number in the right.

Cron job

A cron job can be created to update kPlaylist's database. This has the same effect of clicking on "Update" button in Administration console.

Edit /opt/kplaylist/html/index.php and modify following lines:

  • Line 125, enable autoupdate
$cfg['autoupdate'] = 1;
  • Optionnaly, uncomment lines 8977, 8978 and 8979
$options['deleteunused'] = 1;  # Uncomment if you want to remove deleted files from the database
$options['rebuildid3'] = 1;    # Uncomment if you want to reread all the information from your music files (OGG/MP3).
$options['debugmode'] = 1;     # Uncomment if you want to enable debug mode

You can check that it's working at http://yourserver/kplaylist/index.php?update=5000&user=autooperate

You should get this message: Wrong host (YOUR IP) or user (autooperate) for update.


Create a template called kplaylist in /etc/e-smith/templates/etc/cron.d/ and paste the following code in it:

# kPlaylist database update cron job

# ___________ Minute      (from 0 to 59)
#|   ________ Hour        (from 0 to 23)
#|  |  ______ Day         (from 1 to 31)
#|  | |  ____ Month       (from 1 to 12)
#|  | | |  __ Day of week (from 0 to 6 - 0 is sunday) 
#|  | | | |
#v  v v v v
30 23 * * * /usr/bin/lynx -dump "http://127.0.0.1/kplaylist/index.php?update=5000&user=autooperate"

Save the file and apply modifications with the following command:

expand-template /etc/cron.d/kplaylist

Now each day at 23:30 the server will auto-update kPlaylist database.

Additional information


Sylvain Gomez (Cool34000)