Install Zina Media Server
From SynologyWiki
This page aims to give FULL step by step instructions on how to install Zina on a Synology NAS. It is aimed at the complete novice. This page was written after installing Zina v1.0rc3 on a DS-207+ with firmware v2.0.3 - 0518 and is known to work on all firmwares upto fw 722 (the current firmware at the time of editing).
Note: Versions 2.0a1 and 2.0a2 of Zina are in Alpha/Beta testing and do not currently work on the Synology NAS's. You should currently use version 1.0rc4
Contents |
What is Zina
The Zina website would be your best answer to this question, but in short Zina is a FREE but capable streaming media server which can be installed on a Synology DS to enable users to stream music files (e.g. MP3) over a LAN or over the Internet. Zina is a php application and can therefore run on a Synology DS using the Web service. Zina has some advanced functionality as described on the Zina website.
Unlike the Synology Audio Station it will not play over an Audio card attached to your Synology box (you have to stream, e.g. to your laptop) but it will show you your tree of music (as a tree instead of flattening all files like the Synology Audio Station), show album art and let you record votes.
Why might I be interested in Zina instead of other packages
Unlike many packages the installation of Zina doesn't require the installation of other packages (e.g bootstrap or ipkg). It is also very easy to install and can be TOTALLY removed if required by simply deleting the folder containing the Zina application.
Pre Installation
The following is assumed;
- You have a Synology DS with firmware v2.0.3 - 518 or higher (although it would most probably work on all firmwares providing the "Web Service").
- You know the IP address of your Synology NAS, from now on refered to as xxx.xxx.xxx.xxx
- You know how to login to the Management page of your DS as "admin"
- You have 1 hour spare to complete this wiki
Installing Zina
- Using an internet browser login to the Management page of your NAS and start the "Web Service". This can be found under "Network Services"
- Enable the Command Line Interface (Telnet or SSH)
- Download the zina archive file in the .tar.gz form from http://sourceforge.net/projects/zina to your computer
- Copy the .tar.gz file from your computer to the "web" folder on your DS. The easiest way to do this is through ftp or the "File Station" utility page of your NAS
- Login into the Command Line Interface
- Navigate to the web folder on your NAS, e.g. enter "cd /volume1/web"
- Unpack the archive file you placed in the web folder in step 4 above, e.g. enter "tar -xvvzf thefilename.tar.gz"
- Delete the compressed file, e.g. enter "rm thefileName.tar.gz"
- Enter "dir" and make a note of the directory name that was created by Unpacking the archive, for the author of this how to page it was "zina-1.0rc3"
- Close the telnet or ssh session
- If you want you can now use the synology patch to disable SSH or Telnet, whichever you used in step 2) above
- Installation of Zina is now complete.
Configuration of Zina
A) Using an internet browser browse to the file "index.php" in the zina directory you noted in step 9) above, e.g. for the author it was "http://xxx.xxx.xxx.xxx/zina-1.0rc3/index.php". Note: you do not add "web" as part of the path
B) You should now see a Zina page titled "Artists" but probably the icons will not be shown (if you used version 1.0rc3 of Zina). Do not worry if the icons do not initialy show, this will be corrected in step C) below. Follow the on screen instructions to login to Zina and get access to the settings to change the password etc. Use admin / password as defaults.
C) If the icons did not show you need to change the path called "Zina Files Directory (relative path):" which will probably show "-1.0rc3/_zina". Change it to "_zina" then scroll to the bottom of the page and hit the "Update" button. All icons will now show properly.
How to get Zina to use the NAS's default Music folder
By default Zina looks for music in a directory called music that was created when you unpacked the archive file. However if you want to keep your music in the NAS's default music folder located at /volume1/music then you need to create a symbolic link to enable Zina access to this folder and you also need to change a security setting in the php engine installed on the NAS.
If you want to create a symbolic link to the NAS's default music folder you need to do the following...
- Re-open the Telnet or SSH session as described in step 5) above
- Change to the directory you noted in step 9) above, e.g. "cd /volume1/web/zina-1.0rc3"
- Delete the existing sub directory called "music", e.g. "rmdir music"
- Create a symbolic softlink to the NAS's default music directory, e.g. "ln -s /volume1/music /volume1/web/zina-1.0rc3/music"
- Open the php.ini file using the vi text editor, e.g. "vi /usr/syno/etc/php.ini"
- Find the definition line for variable open_basedir, e.g. "/open_basedir". The "/" is a comand to vi to find the following text. Hence the command will jump to the first occurence of the text in the file. The first occurence it will find is just a remark it is preceded by a ";". Press "n" to get vi to find the next occurence of the text. You should now be looking at a line that starts "open_basedir = /volume1/web:/volume2/web".......etc.
- You are going to modify this line and only this line. The structure of the line is that a ":" is used to seperate the various paths. You need to insert the path for /volume1/music into this line, however as you can see from the exisitng entries any path is duplicated for volumes 2, 3, 4 and 5, hence you should do the same. Change vi to insert text mode by pressing the "i" key. Use the cursor keys (right cursor key) to move along the line till the first "/" is highlighted (the one after the "=" sign. Now type "/volume1/music:/volume2/music:/volume3/music:/volume4/music:/volume5/music". Press the escape key to quit the insert text mode. The line should now look like "open_basedir = /volume1/music:/volume2/music:/volume3/music:/volume4/music:/volume5/music:/volume1/web:/volume2/web"....etc.
- To quit vi and save the changes type "ZZ", note they have to be capital Z's
- Close the Telnet or SSH session
- You now need to reboot your NAS to get it to re-read the open_basedir variable you changed above, e.g. using a web browser login in to the management page of your NAS, under "system" > "power management" you can select to reboot the NAS.
- Repeat step A) above and all your music in the NAS's defualt music folder will be listed for you.
What you need to do after updating the Syno Firmware
If you update your Synology Servers Firmware and you used the above procedure to enable Zina to access your music files in "/volume1/music", you will need to renable php to access your music files in "/volume1/music", e.g.
- Login to the CLI as user "root"
- Open php.ini using the vi text editor, e.g. "vi /usr/syno/etc/php.ini"
- Find the definition line for variable open_basedir, e.g. "/open_basedir". The "/" is a comand to vi to find the following text. Hence the command will jump to the first occurence of the text in the file. The first occurence it will find is just a remark it is preceded by a ";". Press "n" to get vi to find the next occurence of the text. You should now be looking at a line that starts "open_basedir = /volume1/web:/volume2/web".......etc.
- You are going to modify this line and only this line. The structure of the line is that a ":" is used to seperate the various paths. You need to insert the path for /volume1/music into this line, however as you can see from the exisitng entries any path is duplicated for volumes 2, 3, 4 and 5, hence you should do the same. Change vi into insert text mode by pressing the "i" key. Use the cursor keys (right cursor key) to move along the line till the first "/" is highlighted (the one after the "=" sign. Now type "/volume1/music:/volume2/music:/volume3/music:/volume4/music:/volume5/music". Press the escape key to quit the insert text mode. The line should now look like "open_basedir = /volume1/music:/volume2/music:/volume3/music:/volume4/music:/volume5/music:/volume1/web:/volume2/web"....etc.
- To quit vi and save the changes type "ZZ", note they have to be capital Z's
- You now need to reboot your NAS to get it to re-read the open_basedir variable you changed above, e.g. enter the command "reboot".
