SwissCenter - server for the ShowCenter, LinkPlayer and LinkTheatre
From NAS-Central Buffalo - The Linkstation Wiki
| (21 intermediate revisions not shown) | |||
| Line 1: | Line 1: | ||
| - | + | {{Template:Articles}} | |
| + | [[Image:Swisscenter10.png]] | ||
| Line 6: | Line 7: | ||
You will need to install: | You will need to install: | ||
| - | # [[ | + | # [[Apache HTTP server, installing | Apache]] |
| - | # [[ | + | # [[Apache HTTP server, installing | PHP]] |
# [[Articles/DebianMySQL | MySQL]] | # [[Articles/DebianMySQL | MySQL]] | ||
# [http://www.boutell.com/gd/ GD] (for this I simply did a...) | # [http://www.boutell.com/gd/ GD] (for this I simply did a...) | ||
apt-get install php4-gd | apt-get install php4-gd | ||
| + | Need a command line version of PHP | ||
| + | |||
| + | apt-get install php4-cli | ||
| + | |||
| + | Need Truetype font 'luxisr' | ||
| + | |||
| + | apt-get install ttf-xfree86-nonfree | ||
=== Installation === | === Installation === | ||
| Line 32: | Line 40: | ||
chown -R www-data:www-data /var/www/swisscenter | chown -R www-data:www-data /var/www/swisscenter | ||
| + | Need to change a file to pick up Truetype font | ||
| + | |||
| + | pico /var/www/swisscenter/base/image.php | ||
| + | |||
| + | Edit to add the complete path to the luxisr path, on line 330 (use 'where is' in pico - <Ctrl> & W) - looks like this | ||
| + | |||
| + | function text ($text, $x = 0, $y = 0, $colour, $size = 14, $font = '', $angle = 0 ) | ||
| + | { | ||
| + | if (empty($font)) | ||
| + | { | ||
| + | if (is_windows()) | ||
| + | $font = 'Arial'; | ||
| + | else | ||
| + | <font color=red>$font = 'luxisr';</font> | ||
| + | } | ||
| + | |||
| + | if ($this->image !== false) | ||
| + | { | ||
| + | @imagettftext ($this->image,$size,$angle,$x,$y,$colour,$font,$text); | ||
| + | $this->src_fsp = false; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Change it to this | ||
| + | |||
| + | function text ($text, $x = 0, $y = 0, $colour, $size = 14, $font = '', $angle = 0 ) | ||
| + | { | ||
| + | if (empty($font)) | ||
| + | { | ||
| + | if (is_windows()) | ||
| + | $font = 'Arial'; | ||
| + | else | ||
| + | <font color=red>$font = '/mnt/hda/usr/share/fonts/truetype/ttf-xfree86-nonfree/luxisr.ttf';</font> | ||
| + | } | ||
| + | |||
| + | if ($this->image !== false) | ||
| + | { | ||
| + | @imagettftext ($this->image,$size,$angle,$x,$y,$colour,$font,$text); | ||
| + | $this->src_fsp = false; | ||
| + | } | ||
| + | } | ||
== Apache == | == Apache == | ||
| Line 95: | Line 144: | ||
to | to | ||
| - | if ( $sock = @fsockopen('google.com', 80, $temp, $temp, 0.5)) // www.google.com | + | if ( $sock = @fsockopen(<font color=red>'google.com'</font>, 80, $temp, $temp, 0.5)) // www.google.com |
Once it's configured | Once it's configured | ||
| Line 105: | Line 154: | ||
[[Image:Swisscenter02.JPG]] | [[Image:Swisscenter02.JPG]] | ||
| + | == Troubleshooting == | ||
| + | |||
| + | In the event of something not working as it should, do this and ask for help | ||
| + | |||
| + | Create a file to see your php settings | ||
| + | |||
| + | pico /var/www/swisscenter/config/test_php.php | ||
| + | |||
| + | and put this in it | ||
| + | |||
| + | <? | ||
| + | phpinfo(); | ||
| + | ?> | ||
| + | |||
| + | It should output your PHP settings when you try to reach it, check for MySQL support | ||
| + | |||
| + | <nowiki>http://<LinkstationIP>:8080/swisscenter/config/test_php.php</nowiki> | ||
| + | |||
| + | Create a file to check you MySQL settings | ||
| + | |||
| + | pico /var/www/swisscenter/config/test_mysql.php | ||
| + | |||
| + | and put this in it | ||
| + | |||
| + | <? | ||
| + | echo mysql_pconnect('swiss','swisscenter','swisscenter'); | ||
| + | ?> | ||
| + | |||
| + | Try and access it and see what it gives you | ||
| + | |||
| + | <nowiki>http://<LinkstationIP>:8080/swisscenter/config/test_mysql.php</nowiki> | ||
== Screenshots == | == Screenshots == | ||
| - | <center>These are on a pc so it doesn't show up quite right.</center> | + | <center>'''These are on a pc so it doesn't show up quite right'''.</center> |
| - | [[Image:Swisscenter03.JPG| | + | [[Image:Swisscenter03.JPG|250px|Today's Weather]] |
| - | [[Image:Swisscenter04.jpg| | + | [[Image:Swisscenter04.jpg|250px|Week's Weather]] |
| - | [[Image:Swisscenter05.jpg| | + | [[Image:Swisscenter08.jpg|250px|Change City]] |
| - | [[Image:Swisscenter06.jpg| | + | [[Image:Swisscenter05.jpg|250px|Internet Radio]] |
| + | [[Image:Swisscenter07.jpg|250px|Internet Radio]] | ||
| + | [[Image:Swisscenter06.jpg|250px|Listen to Music]] | ||
| + | [[Image:Swisscenter09.jpg|250px|Browse Video]] | ||
--------- | --------- | ||
| - | + | More screenshots can be seen [http://www.swisscenter.co.uk/content/view/57/60/ from here] | |
[[User:Bauldrick|Bauldrick]] 09:22, 4 July 2006 (EDT) | [[User:Bauldrick|Bauldrick]] 09:22, 4 July 2006 (EDT) | ||
| - | <small><font color=red>Many thanks to | + | <small><font color=red>Many thanks to <b>REDSOLO'S</b> guide where most of this info comes from. |
| + | NOTE: link to his guide is now dead. http://redsolo.homeip.net/mediawiki/index.php/SwissCenterOnDebian | ||
Latest revision as of 00:41, 17 September 2007
Contents |
Requirements
You will need to install:
apt-get install php4-gd
Need a command line version of PHP
apt-get install php4-cli
Need Truetype font 'luxisr'
apt-get install ttf-xfree86-nonfree
Installation
Create a swisscenter directory in apache's DocumentRoot (/var/www)
mkdir /var/www/swisscenter
Download Swisscenter into previously created directory
cd /var/www/swisscenter wget http://www.swisscenter.co.uk/downloads/swisscenter.zip
Unzip the downloaded file
unzip swisscenter.zip
Change user:group
chown -R www-data:www-data /var/www/swisscenter
Need to change a file to pick up Truetype font
pico /var/www/swisscenter/base/image.php
Edit to add the complete path to the luxisr path, on line 330 (use 'where is' in pico - <Ctrl> & W) - looks like this
function text ($text, $x = 0, $y = 0, $colour, $size = 14, $font = , $angle = 0 )
{
if (empty($font))
{
if (is_windows())
$font = 'Arial';
else
$font = 'luxisr';
}
if ($this->image !== false)
{
@imagettftext ($this->image,$size,$angle,$x,$y,$colour,$font,$text);
$this->src_fsp = false;
}
}
Change it to this
function text ($text, $x = 0, $y = 0, $colour, $size = 14, $font = , $angle = 0 )
{
if (empty($font))
{
if (is_windows())
$font = 'Arial';
else
$font = '/mnt/hda/usr/share/fonts/truetype/ttf-xfree86-nonfree/luxisr.ttf';
}
if ($this->image !== false)
{
@imagettftext ($this->image,$size,$angle,$x,$y,$colour,$font,$text);
$this->src_fsp = false;
}
}
Apache
Now you will need to create a file in apache to see swisscenter
pico /etc/apache/conf.d/swisscenter.conf
and add this to that file
# SwissCenter Apache Virtual Host Configuration file
Listen 8080
<VirtualHost _default_:8080>
DocumentRoot "/var/www/swisscenter"
<Directory "/var/www/swisscenter">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule mod_dir.c>
DirectoryIndex index.html index.php
</IfModule>
</VirtualHost>
Restart apache
/etc/init.d/apache restart
Run it
Go to your Swisscenter on your Linkstation
http://<IPAdddress>:8080
and if you get MySQL errors
pico /etc/apache/httpd.conf
comment out port 80 and add Listen 80 underneath
#Port80 Listen80
Now goto Swisscenter config on your Linkstation
http://<IPAdddress>:8080/config
and hopefully you'll see this:
Set up the databases and point it to your media and you should be away! In order to be able to get weather forecasts, internet radio and updates you will need to
pico /var/www/swisscenter/base/server.php
and add change
if ( $sock = @fsockopen('66.249.87.99', 80, $temp, $temp, 0.5)) // www.google.com
to
if ( $sock = @fsockopen('google.com', 80, $temp, $temp, 0.5)) // www.google.com
Once it's configured
http://<IPAdddress>:8080
and you should see this:
Troubleshooting
In the event of something not working as it should, do this and ask for help
Create a file to see your php settings
pico /var/www/swisscenter/config/test_php.php
and put this in it
<? phpinfo(); ?>
It should output your PHP settings when you try to reach it, check for MySQL support
http://<LinkstationIP>:8080/swisscenter/config/test_php.php
Create a file to check you MySQL settings
pico /var/www/swisscenter/config/test_mysql.php
and put this in it
<?
echo mysql_pconnect('swiss','swisscenter','swisscenter');
?>
Try and access it and see what it gives you
http://<LinkstationIP>:8080/swisscenter/config/test_mysql.php
Screenshots
More screenshots can be seen from here
Bauldrick 09:22, 4 July 2006 (EDT)
Many thanks to REDSOLO'S guide where most of this info comes from. NOTE: link to his guide is now dead. http://redsolo.homeip.net/mediawiki/index.php/SwissCenterOnDebian


