Manual to install Swisscenter on Synology CS/DS - 2008/03/10 18:47 UPDATE 2009-06-28: firmware DSM 2.0-0803, SwissCenter SVN 1265
This instruction describes how SwissCenter can be installed on a Synology DS-x0x or CS-409. The installation has been tested and all features of SwissCenter do work, however, depending on the specs of your CS/DS some features may have performance differences.
IMPORTANT NOTICE: Synology products are CASE SENSITIVE; this applies also for all paths and symbolic links on a Synology, and non-compliance will cause SwissCenter to fail.
[1] enable Web Station, PHP and MySQL in the Network Services menu of the DS. The option to enable "register_globals" (related to the PHP configuration) must be unchecked.
[2] create in the same menu a VirtualHost with the following path:
Code:
/volume1/web/svr/swiss/
[3] copy the SwissCenter files and paste the files
in /volume1/web/svr/swiss/. This may be any other directory on /volume1/web/
[4] Enable telnet on the CS/DS in the Synology Disk Station Manager in menuNetwork Services, submenu Terminal. Telnet the CS/DS and login as root to adjust file ‘httpd-vhost.conf-user’ by:
close file 'httpd-vhost.conf-user' with ESC followed by ZZ
(NOTE: the port in the example is set to 8050, however, it can be anything except for port 8080 which is already in use by the CS/DS)
[5] create symbolic links for the commands that SwissCenter uses in the /usr/syno/bin/ directory by
Code:
cd /usr/syno/bin/
ln -s /bin/ls /usr/syno/bin/ls
[6] set the permissions for the SwissCenter-files
Code:
cd /volume1/web/svr/
chown -R admin:users swiss
chmod -R 777 swiss
[7] allow streaming of video files by adjusting the 'open_basedir'-function of the PHP.ini file by adding '/:' to the function
[8] in order to have sound, function exec() needs to be enabled by changing line
Code:
safe_mode_exec_dir = /usr/syno/bin
into
Code:
safe_mode_exec_dir =
close php.ini with ESC followed by ZZ
[9] restart Apache by
Code:
sh /usr/syno/etc.defaults/rc.d/S97apache-user.sh restart
[10] store your media files either somewhere on /volume1/ or (eg. /volume1/music/, /volume1/photo/ or /volume1/video/)
[11] replace function “shell_exec()” by “exec()”
SwissCenter uses function “shell_exec()” to detect function “wget". The latter is needed to download data from the internet (eg. for refreshing the RSS feeds). Unfortunately, function “shell_exec()” doesn’t work on the CS/DS, so must be replace by function “exec()”.
go to file /base/file.php line 712 of the SwissCenter directory
replace
Code:
return trim(shell_exec("which wget | grep '^/' | head -1"));
with
Code:
return trim(exec("which wget | grep '^/' | head -1"));
[12] enabling the “PLAY NOW”-screen
There are a couple of steps you have to take. First, create within the main SwissCenter directory a sub-directory “/fonts”. In this directory you store so-called GDF fonts. A couple of them can be downloaded from here, unzip the fonts and save them in your SwissCenter directory “/fonts”. In this directory you store so-called GDF fonts. The download contains “arial” fonts for a 624x496 resolution. In case of a different resolution you have to create your own fonts. The logging will report which font size is missing. An instruction how to do this you may find on the same web page.
Now file /base/image.php needs to be replaced by the version that can be downloaded from here.
[14] open the SwissCenter configuration screen by entering
Code:
http://<diskstation_ip>:8050/config
. For further details see "docmentation and FAQ".
[15] after entering your media location you may find the "search for new media"-option does not optimally work;
in stead you can do the media search manually by entering the following URL on your PC:
Code:
http://<diskstation_ip>:8050/media_search
your web browser starts searching for your media files
when finished, your web browser will mention that the web page cannot be found
[16] add server on ShowCenter / PCH
go to the configuration screen of the ShowCenter and select option add server; in case of a Popcorn Hour select WebService and select option add server.
enter the ip and port of the DS
ShowCenter
Code:
<diskstation_ip>:8050
Popcorn Hour
Code:
http://<diskstation_ip>:8050
when using a ShowCenter you should make the DS server your default
NOTE: ENABLING function exec() IN STEP [8] MAY CAUSE SECURITY RISKS RE YOUR WEB SERVER!!! In my post of 19/08/2008 below, a couple of protection methods are explained
---------------------------------------------------------------------------
SwissCenter SVN 1265
Simese 1.46 / PHP 4.4.4 / MySQL 4.0.21 / Windows XP
Apache 2.2.8 / PHP 5.2.6 / MySQL 5.0.51b / Linux Synology 2.6.15
Synology DS107+ (128), firmware: DSM 2.0-0803
Pinnacle SC200 / PCH A-110
| | The administrator has disabled public write access.
hanamail
User
Posts: 41
Re: Manual to install Swisscenter on Synology DSx0 - 2008/03/24 07:21Dear Klaas Vaak,
At step 3 I managed to have the telnet connection working and to log in as root with password. After that I include the lines as mentioned in the manual and the result I get is an explanation of Apache. I do not have any knowledge of Apache and before I do something what I regret, hereby once again a request for help. How do I get to file httpd.conf-user? How I read the manual is that I have first to get into this file to include the lines to create a virtual host. In this file I pressume is the line numbering so I can include the code as mentioned further in step 3 of the manual.
Hope you can help me out with this one.
Thnaks in advance.
hanamail
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/03/24 08:16Hi Hanamail,
Hanamail wrote:How do I get to file httpd.conf-user?go through step 3 using commands cd (change directory) and vi
Hanamail wrote:How I read the manual is that I have first to get into this file to include the lines to create a virtual hostyep, that's correct
Hanamail wrote:In this file I pressume is the line numbering so I can include the code as mentioned further in step 3 of the manualAs soon as you open the "httpd.conf-user"-file with command vi you'll see the line numbers for every row of the file.
regards, Klaas ----------------------------------------- SwissCenter 1.19.2 Simese 1.40 & Apache 2 / PHP 5.2.0 Windows XP & Linux Synology 2.6.15 Synology DS107+ (128) Pinnacle SC200
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/04/23 17:57Thanks to CryptoKnight the (see here), it’s possible to get the “PLAY NOW”-screen with the DSx07. I copied his code in the manual in order to have the manual as much as possible all inclusive.
| | The administrator has disabled public write access.
chrisrixon
User
Posts: 18
Re: Manual to install Swisscenter on Synology DSx0 - 2008/04/25 14:59fixed ..
| | The administrator has disabled public write access.
chrisrixon
User
Posts: 18
Re: Manual to install Swisscenter on Synology DSx0 - 2008/04/25 15:07Well I think I did all that ... and still no play now screens
I'm getting all ok apart from "Not all recommended PHP modules are available. Some non-critical features have been disabled as a result (recommended modules are: zip)."
Any clues on how to debug this? (I am moderate php experience)
I used the files from here well to no avail .. image_and_image_screens.zip as
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/04/25 15:26Hi Chrisrixon,
Thanks for your note on the missing "-"; I've adjusted the "manual".
Re the "zip-module": this module is not supported by the Synology PHP-version, but it doesn't influence the PLAY NOW screen.
It's odd that you haven't got the PLAY NOW screen yet.
Did you use any of the prepared "image_screens.php"-files. Is so, what language did you use. And I'm not sure I understand your latest remark:
Chrisrixon wrote:I used the files from here well to no avail .. image_and_image_screens.zip as ... regards, Klaas ----------------------------------------- SwissCenter 1.20 Simese 1.40 & Apache 2 / PHP 5.2.0 Windows XP & Linux Synology 2.6.15 Synology DS107+ (128) Pinnacle SC200
| | The administrator has disabled public write access.
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/04/25 18:33I've tested the english "image_screens.php" and it should be OK. The problem could be the font and/or the path thats points at the font directory.
May I ask you which font you've selected and where you've put the font directory?
regards, Klaas ----------------------------------------- SwissCenter 1.20 Simese 1.40 & Apache 2 / PHP 5.2.0 Windows XP & Linux Synology 2.6.15 Synology DS107+ (128) Pinnacle SC200
| | The administrator has disabled public write access.
chrisrixon
User
Posts: 18
Re: Manual to install Swisscenter on Synology DSx0 - 2008/04/25 18:38
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/04/26 08:31Hi Chris,
I tested your uploaded files and they work fine, although there's a difference in the code of the "image.php"-file, where in your file "function z_get_text_width (line 412 through 422) that isn't present the my "image.php"-file. Despite this difference the "PLAY NOW"-screen in not affected.
I had a similar problem as you described which was caused by the property rights of the folder "fonts". In first instance I copied the directory (including the fonts) from outside my network through a FTP-server. This caused property problems, so SwissCenter couldn't access the fonts, although the system check (in the config screen) confirmed the fonts were present. After copying the directory again from inside my network, the "PLAY NOW"-screen appeared. Maybe this could be with you as well. Just give it a try and I'm looking forward to hear the result.
Moreover, due to a small error in the "image_screens.php"-file, the lay-out needed to be adjusted. I did this, so you should download the English version of the file once more.
regards, Klaas ----------------------------------------- SwissCenter 1.20 Simese 1.40 & Apache 2 / PHP 5.2.0 Windows XP & Linux Synology 2.6.15 Synology DS107+ (128) Pinnacle SC200
| | The administrator has disabled public write access.
chrisrixon
User
Posts: 18
Re: Manual to install Swisscenter on Synology DSx0 - 2008/04/26 11:14all the files are globally readable, but I re-did the: chown -R admin:users swiss chmod -R 777 swiss
commands to be safe and no difference.
I'll try and debug it when I get a moment
Thanks for getting me this far, its totally usable anyway
| | The administrator has disabled public write access.
chrisrixon
User
Posts: 18
Re: Manual to install Swisscenter on Synology DSx0 - 2008/04/26 14:34One thing I have a Synology DS107 ( no +)
I have started to debug it and
function now_playing_image
is not being called ....
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/04/26 15:46Well, the difference between DSx07 and DXx07+ is the CPU clock rate (266Mhz against 500 Mhz). As the firmware is (or should be) the same, I don't think that's the reason why function "now_playing_image" fails.
I'll have a look as well, keep up the good spirit.
regards, Kaas ----------------------------------------- SwissCenter 1.20 Simese 1.40 & Apache 2 / PHP 5.2.0 Windows XP & Linux Synology 2.6.15 Synology DS107+ (128) Pinnacle SC200
| | The administrator has disabled public write access.
chrisrixon
User
Posts: 18
Re: Manual to install Swisscenter on Synology DSx0 - 2008/04/26 18:19
There seems to be two problems, the fonts aren't working .. I proved this by using built in fonts:
and i can see it generating the pics correctly (with tiny fonts ...)
but as to why their not getting displayed in the showcenter ...
| | The administrator has disabled public write access.
chrisrixon
User
Posts: 18
Re: Manual to install Swisscenter on Synology DSx0 - 2008/04/27 03:27My only idea is that my DS is too slow to generate the pics in time and the SC is timing out ... am investigating ...
| | The administrator has disabled public write access.
chrisrixon
User
Posts: 18
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/23 13:15I've had no luck with external fonts. Consider this file:
$f = $font; $f = 5; // comment this line and no text
imagestring($im, $f, 10, 1, "$fh x $fw $font Jackels love my big SPHINX of Quartz 1234567890", $white); imagepng($im); ?>
This works and proves that the font is loaded (because the dimensions are). However comment out $f = 5 and it doesn't work.
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/23 14:48Hi Chris,
My only idea is that my DS is too slow to generate the pics in time and the SC is timing out ... am investigating ... I noticed that too large albumart-images cause failure of the "PLAY NOW"-screen (it simply times out). Maybe you can give it a try whithout albumart to see what's happening.
Furthermore, I tried your script and I see the fonts, but I'm not sure what you're trying to say (my knowlegde re PHP may be not sufficient to get it).
regards, Klaas ----------------------------------------- SwissCenter 1.20.1 Simese 1.40 & Apache 2 / PHP 5.2.0 Windows XP & Linux Synology 2.6.15 Synology DS107+ (128) Pinnacle SC200
| | The administrator has disabled public write access.
chrisrixon
User
Posts: 18
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/23 15:07Well its not all bad news, I have got the now playing screens going by:
Changing this: $image = new CImage(); To: $image = new CImage(convert_x(1000,SCREEN_COORDS), convert_y(1000,SCREEN_COORDS));
And commenting out this: //$image->load_from_file(style_img('NOW_BACKGROUND',true) ); //$image->resize( convert_x(1000,SCREEN_COORDS), convert_y(1000,SCREEN_COORDS), 0, false);
This saves a load and resize speeding things up a lot at the expense of a black background. The black background also helps when saving as a jpeg image as there is a lot less processing to do ....
(My Show centre is running HD)
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/23 15:55Hi Chris,
I tried your adjustment re file base/image.php and I've seen no difference in output of the "PLAY NOW"-screen, so that's fine for me, but I'm not sure whether you are satified with the "PLAY SCREEN" you're getting right now.
If so, please let me know and I'll include your solution in the "manual".
thanks & regards, Klaas ----------------------------------------- SwissCenter 1.20.1 Simese 1.40 & Apache 2 / PHP 5.2.0 Windows XP & Linux Synology 2.6.15 Synology DS107+ (128) Pinnacle SC200
| | The administrator has disabled public write access.
chrisrixon
User
Posts: 18
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/23 16:50Um well it makes it black so not as pretty as the default. Maybe a note for owners of the slower model.
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/23 18:16Hi Chris,
When I tried your script change,
Code:
$image = new CImage(convert_x(1000,SCREEN_COORDS), convert_y(1000,SCREEN_COORDS));
the background was still the same as it was before, so what's making the background turn into black.
regards, Klaas -----------------------------------------
SwissCenter 1.20.1
Simese 1.40 & Apache 2 / PHP 5.2.0
Windows XP & Linux Synology 2.6.15
Synology DS107+ (128)
Pinnacle SC200
| | The administrator has disabled public write access.
chrisrixon
User
Posts: 18
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/24 04:29so what's making the background turn into black. commenting out these lines:
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/24 13:15I'm afraid I'm not getting it, I still got the normal background. Would you mind posting your "/base/image.php"?
many thanks & regards, Klaas ----------------------------------------- SwissCenter 1.20.1 Simese 1.40 & Apache 2 / PHP 5.2.0 Windows XP & Linux Synology 2.6.15 Synology DS107+ (128) Pinnacle SC200
| | The administrator has disabled public write access.
chrisrixon
User
Posts: 18
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/24 14:48here is my image.php and image_screens.php
It sets a solid blue background to match the default background.
you may find them hacked about a bit.
the salient part is:
Code:
function now_playing_image( $current_track, $previous_track = '', $next_track = '', $tracks = '', $photos = '' )
{
$image = new CImage(convert_x(1000,SCREEN_COORDS), convert_y(1000,SCREEN_COORDS));
$blue = imagecolorallocate($image->image, 0, 54, 158);
imagefill($image->image, 0, 0, $blue);
$artfile = new CImage();
// Load the image and scale it to the appropriate size.
//$image->load_from_file(style_img('NOW_BACKGROUND',true) );
//$image->resize( convert_x(1000,SCREEN_COORDS), convert_y(1000,SCREEN_COORDS), 0, false);
| | The administrator has disabled public write access.
Dutchsea
User
Posts: 100
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/30 09:17Klaas,
I had a close look again at your manual and maybe there are some things that can be added/changed to fine tune it. (original code/text in blue, changes in red, comments in black)
[11] optimizing the screen lay-out As the GDF-fonts differ from the standard fonts used by SwissCenter the code of file /base/image_screens.php adjusted a bit. (add “s” in the filename)
line 152 $title_y = convert_y(80,SCREEN_COORDS); line 169 $text_width = convert_x(215,SCREEN_COORDS); line 170 $indent = convert_x(125,SCREEN_COORDS); line 152 $title_y = convert_y(80,SCREEN_COORDS); (remove this one as its a duplicate of first line) line 197 $time_text_y = max($text_y,convert_y(640,SCREEN_COORDS)); line 200 $tab_prev = convert_x(98,SCREEN_COORDS); (not listed in my file) line 201 $tab_next = convert_x(85,SCREEN_COORDS); (not listed in my file) line 238 $adjust_y = -40; (line 234 in my file) line 250 $total_label = convert_x(870,SCREEN_COORDS) - $image-> get_text_width(str('TRACKS'),$detail_text_size); (line 248 in my file) line 251 $total_detail = convert_x(870,SCREEN_COORDS) - $image-> get_text_width($tracks,$detail_text_size); (line 249 in my file)
For your convenience the “/base/image_screen.php”-file optimised for font arial12.gdf can be downloaded per language from here. (note: the files that can be downloaded via this link differ a lot from the file created after following the instructions in above text)
Item number [13] does not exist. Supersticious?
I believe the change of the safe_mode_exec_dir = in the php.ini file to safe_mode_exec_dir = /bin (related to the "No Sound" tread should also be mentioned in the manual.
The comments about the GDF-fonts may not be so relevant as these are so pendent on the image_screen.php”-file that one has available on the Synology. (Not sure why we have different versions though?)
Thanks again for you time (and others) on creating this manual. Its working better and better for me.
WouterSwissCenter 1.22 Synology CS407 firmware DSM 2.0-0598 Pinnacle SC200 - firmware 21-63 Windows XP SP2 Linux on Synology PHP 5.2.0 MySQL 5.0.51 Apache 2.2.3 (Unix)
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/30 11:26Hi Wouter,
Thanks for your remarks and I have updated the manual with your suggestions.
Wouter wrote:I believe the change of the safe_mode_exec_dir = in the php.ini file to safe_mode_exec_dir = /bin (related to the "No Sound" tread should also be mentioned in the manual.Although it was mentioned, the updated manual shows this items more explicit under item [8].
Wouter wrote:(Not sure why we have different versions though?)Well, the initial "/image_screens.php"-file is probably the same. However, in order to improve the "PLAY NOW"-screen a bit I inserted line 200 and 201 (see updated manual). Furthermore the co-ordinates differ depending the language you use.
Wouter wrote:Item number [13] does not exist. Supersticious?Ha, you're the first one who noticed ...
regards, Klaas ----------------------------------------- SwissCenter 1.20.1 Simese 1.40 & Apache 2 / PHP 5.2.0 Windows XP & Linux Synology 2.6.15 Synology DS107+ (128) Pinnacle SC200
| | The administrator has disabled public write access.
Dutchsea
User
Posts: 100
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/30 13:40Hi Klaas,
I didn't realize that the code described under item 8 is to enable sound. I did follow this part of the set-up the first time I installed SC on my CS407 but did not get any sound. So I started to look in the forum and there understood the code should read:
safe_mode_execdir = /bin (as taken from the tread I mentioned)
But after this change still no sound when playing MP3.
SwissCenter 1.22 Synology CS407 firmware DSM 2.0-0598 Pinnacle SC200 - firmware 21-63 Windows XP SP2 Linux on Synology PHP 5.2.0 MySQL 5.0.51 Apache 2.2.3 (Unix)
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/30 14:40Hi Wouter,
Line 184 of your "ini.php" shows:
Code:
safe_mode_execdir = /bin
This should be changed into:
Code:
safe_mode_exec_dir =
I expect this will enable PHP function exec() on your system and you'll have sound; if not we'll continue the journey.
regards, Klaas
I've changed the manual a bit to get this issue clearer -----------------------------------------
SwissCenter 1.20.1
Simese 1.40 & Apache 2 / PHP 5.2.0
Windows XP & Linux Synology 2.6.15
Synology DS107+ (128)
Pinnacle SC200
| | The administrator has disabled public write access.
Dutchsea
User
Posts: 100
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/30 17:30Hi Klaas,
I already tried:
Code:
safe_mode_execdir =
But no sound
WouterSwissCenter 1.22 Synology CS407 firmware DSM 2.0-0598 Pinnacle SC200 - firmware 21-63 Windows XP SP2 Linux on Synology PHP 5.2.0 MySQL 5.0.51 Apache 2.2.3 (Unix)
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/30 18:26hmm ... I suggest you have a look at the second post of this thread and try out Rob's suggestion. This may give you sound, although it's no solution, it will give some direction where to look.
regards, Klaas ----------------------------------------- SwissCenter 1.20.1 Simese 1.40 & Apache 2 / PHP 5.2.0 Windows XP & Linux Synology 2.6.15 Synology DS107+ (128) Pinnacle SC200
| | The administrator has disabled public write access.
Dutchsea
User
Posts: 100
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/30 19:06Yes, now there is sound. But why is this not a solution?SwissCenter 1.22 Synology CS407 firmware DSM 2.0-0598 Pinnacle SC200 - firmware 21-63 Windows XP SP2 Linux on Synology PHP 5.2.0 MySQL 5.0.51 Apache 2.2.3 (Unix)
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/31 03:40Well, it means that function exec() is working, as Rob's suggestion was focussed to avoid this function to play music. Although you may be able to play music, all other functions called by function exec() will fail.
I'll have a close look at your "ini.php" once again. regards, Klaas ----------------------------------------- SwissCenter 1.20.1 Simese 1.40 & Apache 2 / PHP 5.2.0 Windows XP & Linux Synology 2.6.15 Synology DS107+ (128) Pinnacle SC200
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/31 04:36Hi Wouter,
I think it still has to do with line 184 of your “php.ini”-file. In your case it’s
Code:
safe_mode_execdir = /bin
.As far as I can judge there’re two problems.
[1] “/bin” should be removed
[2] you should insert a underscore ( _ ) between exec and dir (missing in the manual)
So, line 184 should be:
Code:
safe_mode_exec_dir =
In order to test this, pls undo Rob’s suggestion and put back the large_filesize() function in “/base/file.php”.
Although it has nothing to do with this issue, you should enable
line 585 extension=php_mbstring.dll
line 594 extension=php_gettext.dll
Your line 619 is empty, while it should be
Code:
extension=php_zip.dll
salut, Klaas
BTW I'll adjust the manual re the missing underscore ( _ ) -----------------------------------------
SwissCenter 1.20.1
Simese 1.40 & Apache 2 / PHP 5.2.0
Windows XP & Linux Synology 2.6.15
Synology DS107+ (128)
Pinnacle SC200
| | The administrator has disabled public write access.
Dutchsea
User
Posts: 100
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/31 05:51Hi Klaas,
The extra underscore in the "_" did the trick.
The other changes I made as well. If you have time to explain I really like to know what those will change.
FYI, In my config screen not all php test are marked as succesfull. I suspected the new line 619 you advised (extension=php_zip.dll) would change this test result but it didn't.
Below the relevant part of the PHP Installation Checks
The following tests were successful:
* Your version of PHP is supported. * All required PHP modules are available. * Successfully located a TrueType Font for generating "Now Playing" images.
The following tests failed: * Not all recommended PHP modules are available. Some non-critical features have been disabled as a result (recommended modules are: zip).SwissCenter 1.22 Synology CS407 firmware DSM 2.0-0598 Pinnacle SC200 - firmware 21-63 Windows XP SP2 Linux on Synology PHP 5.2.0 MySQL 5.0.51 Apache 2.2.3 (Unix)
| | The administrator has disabled public write access.
Dutchsea
User
Posts: 100
Re: Manual to install Swisscenter on Synology DSx0 - 2008/05/31 20:18 aargh.. You fix one thing and another crashes........
I created a new database and now everything works great except for the fact that my movies don't play anymore. If a press the play button after selecting a title, the screen changes for a few seconds and then returns to the previous screen.
On the php_zip.dll issue: I have enabled this function but still the SC Installation Checks screen says its missing. Maybe Synology does not include this file in their firmware???
Also album art etc for TV series is not collected anymore. Maybe a rights issue? I see that banner directories are created in each TV directory but nothing is stored.
Attached the log. Last lines show me trying to play the movie 8 mileSwissCenter 1.22 Synology CS407 firmware DSM 2.0-0598 Pinnacle SC200 - firmware 21-63 Windows XP SP2 Linux on Synology PHP 5.2.0 MySQL 5.0.51 Apache 2.2.3 (Unix)
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/06/01 08:33Hi Wouter,
I suggest we open a new thread for this issue as this is not really related to Synology NAS (at least not as far as I can see at the moment).
regards, Klaas ----------------------------------------- SwissCenter 1.20.1 Simese 1.40 & Apache 2 / PHP 5.2.0 Windows XP & Linux Synology 2.6.15 Synology DS107+ (128) Pinnacle SC200
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/06/22 07:21With reference to this thread the manual is adjusted.
regards, Klaas --------------------------------------------------------------------------- SwissCenter 1.20.1 Simese 1.40 / PHP 4.4.4 / MySQL 4.0.21 / Windows XP Apache 2.2.8 / PHP 5.2.6 / MySQL 5.0.51b / Linux Synology 2.6.15 Synology DS107+ (128), firmware: DSM 2.0-0637 Pinnacle SC200
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/08/19 15:06In the manual it a security risk is mentioned that occurs when have SwissCenter installed on a CS/DS. The risk can be mitigated in various ways depending the way you want to utilise the CS/DS.
If you don’t host a website and don’t want to make use of the “Photo Station” externally you best close port 80 and 443 of your router. Your system is completely safe.
In case you want to host a website and/or you want to make use of the “Photo Station” from outside your network and therefore have ports 80 and 443 open, you expose your system (SwissCenter and the D to security problems. The problem is that you must have the SwissCenter directory on the open “web”-directory; other (safer) locations are not allowed by the system. So, it becomes very easy to access the SwissCenter configuration page by entering the path. Entering
Code:
http//:<your external ip>/svr/swiss/config/
in a browser leads you directly to the SwissCenter config page.
First thing to prevent this, is allowing only your intranet to access the SwissCenter VirtualHost:
Code:
Listen 8080
<VirtualHost _default_:8080>
DocumentRoot "/volume1/web/svr/swiss"
<Directory "/volume1/web/svr/swiss">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule mod_dir.c>
DirectoryIndex index.html index.php
</IfModule>
Alias /root/ "/"
</VirtualHost>”
should be changed into
Code:
Listen 8080
<VirtualHost _default_:8080>
DocumentRoot "/volume1/web/svr/swiss"
<Directory "volume1/web/svr/swiss">
Options Indexes FollowSymlinks Multiviews
AllowOverride None
Order deny,allow
Deny from all
Allow from <first three,two or one octets of your network IP, eg 192.168.1>
</Directory>
<IfModule mode_dir.c>
DirectoryIndex index.html index.php
</IfModule>
Alias /root/ "/"
</VirtualHost>
So, the "allow"-line could look like this:
Code:
Allow from 192.168.1
Now, depending on how you want to make use of the web features of the CS/DS, you may introduce various ways of security.
If you want to make your website/”photo station” available to a limited number of IP-addresses, you can protect your web directories with a so-called “.htaccess”-file. The file looks like:
Code:
AuthName "<enter name of domain/network>"
AuthType Basic
order deny,allow
deny from all
allow from <enter first three,two or one octets of your network IP, eg 192.168.1>
allow from <enter full external IP-adress from which you want to have access>
allow from <enter a second external IP-adress>
Save the ".htaccess"-file in your main "web"-directory (/volume1/web/).
By doing so, everyone from the indicated IPs can still can access the SwissCenter directories. You may choose to have an additional password protection to prevent unauthorised access to these directories. The Synology support site provides a clear instruction how to do this.
If you would like to have unlimited access to your website/”photo station” you can choose to put the either the “.htaccess” as mentioned above or the password protection in your SwissCenter directory.
Please be aware that password protection gives some safety, but can be cracked as well. Maybe someone knows how to deal with hammering in Apache?
regards, Klaas ---------------------------------------------------------------------------
SwissCenter 1.20.1
Simese 1.40 / PHP 4.4.4 / MySQL 4.0.21 / Windows XP
Apache 2.2.8 / PHP 5.2.6 / MySQL 5.0.51b / Linux Synology 2.6.15
Synology DS107+ (128), firmware: DSM 2.0-0637
Pinnacle SC200
| | The administrator has disabled public write access.
Joe_999
User
Posts: 99
Re: Manual to install Swisscenter on Synology DSx0 - 2008/08/20 02:29klaasvaak wrote: [1] enable Web Station, PHP and MySQL in the Network Services menu of the DS. The option to enable "register_globals" (related to the PHP configuration) must be unchecked.
I upgraded in the meantime to FW 6.40 on the DS207+ and found that it is not necessary to enable the Web Station in order to run SwissCenter on the DS207+.
In my case it is even just the opposite: If I enable the Webn Station, use Swiss Center and use also the Surveillance Station, I have sometimes problems in the Surveillance Station. If I deactivate the Web Station, everything is fine.
JoeClients: Popcorn A-100 with 4 GB Flash-Memory, Mozilla Firefox on MS Vista Business SP1.0 Media storage on NAS: Synology DS207+ SC 1.22 latest SVN installed on DS207+ (RAID 1) with FW 2.0-8.03 utilizing: Apache 2.2.8 (Unix) mod_ssl/2.2.8, MySQL 5.0.51b, OpenSSL 0.9.8g, PHP 5.2.6 GbE network with Zyxel GS-108A PCH-A100 connected via HDMI in 1920x1080p to display.
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/08/20 15:00Hi Joe,
Joe_999 wrote:I upgraded in the meantime to FW 6.40 on the DS207+ and found that it is not necessary to enable the Web Station in order to run SwissCenter on the DS207+.Completely true, however, in case you have "redeclare" problems (see here and here), you cannot access the SwissCenter config page through the VirtualHost, but you have to use the real path. In case of the latter disabling the "Web Station" of your CS/DS will block access to the config screen. However, if you don't have "redeclare"-problems and you don't want to host any website, but want to make use of "Photo Station", then disabling the "Web Station" is the best security solution.
Joe_999 wrote:In my case it is even just the opposite: If I enable the Webn Station, use Swiss Center and use also the Surveillance Station, I have sometimes problems in the Surveillance Station. If I deactivate the Web Station, everything is fine.What kind of problems do you have?
regards. Klaas --------------------------------------------------------------------------- SwissCenter 1.20.1 Simese 1.40 / PHP 4.4.4 / MySQL 4.0.21 / Windows XP Apache 2.2.8 / PHP 5.2.6 / MySQL 5.0.51b / Linux Synology 2.6.15 Synology DS107+ (128), firmware: DSM 2.0-0637 Pinnacle SC200
| | The administrator has disabled public write access.
Joe_999
Visitor
Re: Manual to install Swisscenter on Synology DSx0 - 2008/08/31 04:36Klaas,
my problem was that I could not get access to my IP camera through the DS207+ Surveillance station anymore.
I have not found the reason but the combination of SC on a virtual host on the DS207+, the Webstation and the Surveillance Station had some interference.
Yesterday, I have upgraded the DS207+ to FW7.02beta, which supports MPEG4 streaming for my IP camera (HCM531) what is a huge improvement to the last FW 6.40.
The new FW7.02 makes life for SC easier:
There is now an option to enable NFS and a virtual server, where the swiss files have to be put in a folder below /volume1/web, e.g. /volume1/web/swiss). Port 8080, however, is reserved for internal purposes therefore another port (in my case 8088) has to be selected. The only manual changes via Telnet I had to do was edit the php.ini according to your manual and to set the rights accordingly.
Nevertheless, I still have a lot of performance differences between the SC WIN-XP Simese and the SC Linux Apache installation: Only one example: The play now screen works very nicely on the Simese but so far without any success on the SC Linux Apache installation. I have no clue why! Probably due to PHP 5 on the SC Linux Apache installation?
Regards
Joe
| | The administrator has disabled public write access.
Joe_999
User
Posts: 99
Re: Manual to install Swisscenter on Synology DSx0 - 2008/09/07 20:19Joe_999 wrote: There is now an option to enable NFS and a virtual server, where the swiss files have to be put in a folder below /volume1/web, e.g. /volume1/web/swiss). Port 8080, however, is reserved for internal purposes therefore another port (in my case 8088) has to be selected. The only manual changes via Telnet I had to do was edit the php.ini according to your manual and to set the rights accordingly. I have to add that it´s still necessary to do the changes to the httpd.conf-user as suggested by Klaas otherwise some rights issues will hinder the operation of SwissCenter. I therefore also for compatibility issues stick to put Swisscenter into /volume1/web/svr/swiss/. Since port 8080 is not available with FW7.17 I am now using port 8083 instead. JoeClients: Popcorn A-100 with 4 GB Flash-Memory, Mozilla Firefox on MS Vista Business SP1.0 Media storage on NAS: Synology DS207+ SC 1.22 latest SVN installed on DS207+ (RAID 1) with FW 2.0-8.03 utilizing: Apache 2.2.8 (Unix) mod_ssl/2.2.8, MySQL 5.0.51b, OpenSSL 0.9.8g, PHP 5.2.6 GbE network with Zyxel GS-108A PCH-A100 connected via HDMI in 1920x1080p to display.
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/09/08 11:58Hi Joe,
Thanks for your note, I've adjusted the manual in order to warn users not to select port 8080.
regards, Klaas --------------------------------------------------------------------------- SwissCenter 1.21.1 Simese 1.40 / PHP 4.4.4 / MySQL 4.0.21 / Windows XP Apache 2.2.8 / PHP 5.2.6 / MySQL 5.0.51b / Linux Synology 2.6.15 Synology DS107+ (128), firmware: DSM 2.0-0702 Pinnacle SC200
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/09/08 18:17Two changes to the “PLAY NOW”-screen has been made (see step [12] of the manual):
[1] a version more alike the standard one can be downloaded; [2] the “PLAY NOW”-screen in line with Spanish is available.
regards, Klaas --------------------------------------------------------------------------- SwissCenter 1.21.1 Simese 1.40 / PHP 4.4.4 / MySQL 4.0.21 / Windows XP Apache 2.2.8 / PHP 5.2.6 / MySQL 5.0.51b / Linux Synology 2.6.15 Synology DS107+ (128), firmware: DSM 2.0-0702 Pinnacle SC200
| | The administrator has disabled public write access.
BABACHAN
User
Posts: 43
Re: Manual to install Swisscenter on Synology DSx0 - 2008/09/26 10:07Klaas,
The manual still refers to port 8080 in step 14, 15 and 16. This should be the same as in step 3, which is 8050.SwissCenter 1.21.1 client: Popcorn Hour A-100 servers: Synology DS207+ (128) firmware DSM 2.0-0722 servers: Windows XP SP2
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/09/26 16:07oops, slip of the pen
changes applied
thanks for notifying, regards, Klaas --------------------------------------------------------------------------- SwissCenter SVN 1090 Simese 1.40 / PHP 4.4.4 / MySQL 4.0.21 / Windows XP Apache 2.2.8 / PHP 5.2.6 / MySQL 5.0.51b / Linux Synology 2.6.15 Synology DS107+ (128), firmware: DSM 2.0-0702 Pinnacle SC200
| | The administrator has disabled public write access.
BABACHAN
User
Posts: 43
Re: Manual to install Swisscenter on Synology DSx0 - 2008/10/03 09:08Hi Klaas,
I finally found the time and need to install SwissCenter om my DS207+.
I didn't like the way the image_screens file is altered to fix the layout for using the fixed point arial GD font. It is only 1 size, language specific and also the wrapping of long text did not work properly.
So I a took the time to implement the support of GD fonts in Swisscenter. If you like it you can add it to the manual. You have to rename step 14 to 12 and replace step 11 with this:
############################################
[11] Enabling support for GD fonts for the “PLAY NOW”-screen There are a couple of steps you have to take. First, create within the main SwissCenter directory a sub-directory “/fonts”. In this directory you store so-called GDF fonts. I have attached the arial fonts for a 624x496 resolution . I you have a different resolution than use step 14a to create your own fonts. The logging will report which font size is missing.
Now file /base/image.php needs to be edited. Replace line 369-444 with this (replacing function text(), get_text_width() and get_text_height()):
Code:
// -------------------------------------------------------------------------------------------------
// Outputs some text onto the image (using truetype fonts).
// NOTE: The font-size given should be specified in pixels.
// -----------------------------------------------------------------------------------------------
--
function text ($text, $x = 0, $y = 0, $colour = 0, $size = 14, $font = '', $angle = 0 )
{
// Exit value of this function.
$result = false;
// Determine the font to use if not specified.
if (empty($font))
$font = get_sys_pref('TTF_FONT');
// Write the text to the image
if ($this->image !== false)
{
// Determine which font type we have
$extension = file_ext($font);
if ($extension == "ttf")
{
// GD version 2 takes the font-size argument in points, whereas this function takes the
// text size in pixels. We therefore need to convert the given value before passing to GD.
if (gd_version() >=3)
$size *= 0.8;
$result = @imagettftext($this->image,$size,$angle,$x,$y,$colour,$font,$text);
if ( $result == false )
{
send_to_log(5,"Unable to use Truetype Font '$font' to display '$text'");
}
}
elseif($extension == "gdf")
{
$font = sprintf($font, $size);
$font_no = @imageloadfont($font);
if ($font_no !== false)
{
// Correct x and y
if($angle == 0)
{
$y -= imagefontheight($font_no);
$result = imagestring($this->image, $font_no, $x, $y, $text, $colour);
if ($result == false)
{
send_to_log(5,"Unable to use GD Font '$font' to display '$text'");
}
}
elseif($angle == 90)
{
$y -= imagefontheight($font_no) * strlen($text);
$result = imagestringup($this->image, $font_no, $x, $y, $text, $colour);
if ($result == false)
{
send_to_log(5,"Unable to use GD Font '$font' to display '$text'");
}
}
}
else
{
send_to_log(5,"Unable to use GD Font '$font' to display '$text'");
}
}
$this->src_fsp = false;
}
return $result;
}
/**
* Returns the width (in pixels) of the text when rendered
*
* @param string $text
* @param integer $size
* @param string $font
* @param integer $angle
* @return integer
*/
function get_text_width( $text, $size = 14, $font = '', $angle = 0)
{
if (empty($font))
$font = get_sys_pref('TTF_FONT');
$extension = file_ext($font);
if ($extension == "ttf")
{
if (gd_version() >=3)
$size *= 0.8;
$box = @imagettfbbox($size, $angle, $font, $text);
return ($box[2] - $box[6]);
}
elseif($extension == "gdf")
{
$font = sprintf($font, $size);
$font_no = imageloadfont($font);
if ($font_no !== false)
{
return (imagefontwidth($font_no) * strlen($text));
}
}
}
/**
* Returns the height (in pixels) of the text when rendered
*
* @param string $text
* @param integer $size
* @param string $font
* @param integer $angle
* @return integer
*/
function get_text_height( $text, $size = 14, $font = '', $angle = 0)
{
if (empty($font))
$font = get_sys_pref('TTF_FONT');
$extension = file_ext($font);
if ($extension == "ttf")
{
if (gd_version() >=3)
$size *= 0.8;
$box = @imagettfbbox($size, $angle, $font, $text);
return ($box[3] - $box[7]);
}
elseif($extension == "gdf")
{
$font = sprintf($font, $size);
$font_no = imageloadfont($font);
if ($font_no !== false)
{
return imagefontheight($font_no);
}
}
}
// ----------------------------------------------------------------------------------
// Truncates a string to the given width (in pixels)
// ----------------------------------------------------------------------------------
function shorten($text, $width, $size = 24)
{
if(empty($text))
return $text;
$short_string = "";
$len = 0;
$text = (string)$text;
$continue = true;
$trimmed = false;
$short_string = $text;
while($continue)
{
$len = $this->get_text_width($short_string, $size);
if ($len < $width)
{
if ($trimmed)
{
// Trim the string back to the last whitespace (max 8 chars will be trimmed)
if ((strlen($short_string) - strrpos($short_string,' ')) <10)
{
$short_string = substr($short_string, 0, strrpos($short_string,' ')+1);
}
}
$continue = false;
}
else
{
// Remove last char
$short_string = substr($short_string, 0, -1);
$trimmed = true;
}
}
return $short_string;
}
In file /base/image_screens.php replace function wrap (line 18-33) with this:
[14] Selecting GD fonts in configuration
In the configuration page "Miscellaneous" enter "/volume1/web/svr/swiss/fonts/arial_tt%d.gdf" as the true type fonts and press save settings
[14a] Make your own fonts
If you do not like the supplied fonts and want to create your own fonts. Or you have a big endian NAS then you need to create your own GD fonts. Or the fonts are not supplied. The fonts size is screen resolution and specific.
Use this program to convert ttf fonts to gd fonts. A couple of hints:
1. Character width = font width / 1.6. This gives the best results
2. Save the fonts as <font name>_tt<size>.gdf with size = true type font size / 1.3.
GD fonts are machine specific. You can check here to see what type your NAS is. CS/RS407, DS207+, DS107+ and intel processors are little endian. Use attached ConvertGDFHeader.exe to convert a GD font from little endian to big endian. Syntax: ConvertGDFHeader.exe in_file out_file.
############################################
Klaas, If you like I can sent you the needed files by email. So that you can add links to them in the manual.
SwissCenter 1.21.1 client: Popcorn Hour A-100 servers: Synology DS207+ (128) firmware DSM 2.0-0722 servers: Windows XP SP2
| | The administrator has disabled public write access.
klaasvaak
User
Posts: 785
Re: Manual to install Swisscenter on Synology DSx0 - 2008/10/03 09:34Hi Babachan,
Thanks for your contibution, I'll try out to see the differences; meanwhile it would be great when you can send me the files. E-mail exchange goes throught the admin, so I'll ask Rob to exchange the e-mail addresses. Alternatively, you may zip the files and post them all together at the forum.
@Rob Would you please exchange e-mail addresses?
regards, Klaas --------------------------------------------------------------------------- SwissCenter SVN 1091 Simese 1.40 / PHP 4.4.4 / MySQL 4.0.21 / Windows XP Apache 2.2.8 / PHP 5.2.6 / MySQL 5.0.51b / Linux Synology 2.6.15 Synology DS107+ (128), firmware: DSM 2.0-0702 Pinnacle SC200
| | The administrator has disabled public write access.
BABACHAN
User
Posts: 43
Re: Manual to install Swisscenter on Synology DSx0 - 2008/10/03 10:07Here are the full image.php and image_screens.php