Twonky server для linux

mein Comp — mein Kampf

МОЙ КОМПЬЮТЕР — МОЯ БОРЬБА

суббота, 11 апреля 2015 г.

Linux mediaserver

На этот раз, сервис UPnP (DLNA) будет обеспечивать приложение Twonky Server.
ПО Twonky Server платное — цена $20, альтернатива — «Гугл» в поиск или 30-дневное ознакомление.

Текущую версию 8.0.3 для Linux скачиваем по указателю:
http://d1ctzy5vhd42ul.cloudfront.net/twonky-i386-glibc-2.2.5-8.0.3.zip
Сразу распакуем содержимое архива в домашний каталог, например, в папку twonkypack ( /home/user_name/ twonkypack) .

Подготовка ОС Xubuntu 14.10 desktop amd64.
Чтобы в 64-битной ОС Хubuntu работали 32-битные приложения, нужно установить в ОС 32-битные библиотеки:

sudo dpkg —add-architecture i386
sudo apt-get update
sudo apt-get install package-name:i386
sudo apt-get -f install
sudo apt-get install sni-qt:i386

Устанавливаем дополнительные компоненты:

sudo apt install ubuntu-restricted-extras
sudo apt install libavcodec-extra
sudo sh /usr/share/doc/libdvdread4/install-css.sh
sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next
sudo apt-get update
sudo apt-get install ffmpeg

Необходимо настроить исходящий многоадресный (multicast) маршрут для сервера, открываем файл настройки сети:

sudo mousepad /etc/network/interfaces

Добавьте следующее в конец файла настройки сети (обычно eth0, если у вас только одна сетевая карта), сохраните изменения.

# Adding a multicast static route for Twonky Server
up route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
down route del -net 224.0.0.0 netmask 240.0.0.0 dev eth0

Устанавливаем Twonky Server.
Пакет файлов из папки /home/user_name/twonkypack предназначен для ручной установки и, по умолчанию, должен находиться по пути: /usr/local/twonky.
Создадим папки, необходимые для работы Twonky Server:

sudo mkdir -p /usr/local/twonky
sudo mkdir -p /home/user_name/.twonky/twonkyserver/appdata
sudo mkdir -p /var/twonky/twonkyserver/appdata

Скопируем пакет файлов в каталог установки:

sudo cp -rp /home/user_name/twonkypack/* /usr/local/twonky

Установим права на чтение/запись/выполнение (так называемый ехе бит) владельцу и группе пользователей , для следующих файлов пакета:

cd /usr/local/twonky
sudo chmod 770 twonkys* twonkyserver twonkystarter cgi-bin/* plugins/*

Выполним первый запуск Twonky Server’a:

/usr/local/twonky/twonkystarter

Twonky Server запущен и работоспособен, но будет сообщение о том, что не всё прошло гладко.
В принципе, можно переходить к настройкам Twonky Server’a.

Однако, для более правильного процесса запуска/остановки Twonky Server’a, желательно задействовать init- скрипт twonky.sh.

sudo cp -rp /usr/local/twonky/twonky.sh /etc/init.d
sudo chmod 770 /etc/init.d/twonky.sh
sudo update-rc.d twonky.sh defaults
sudo ln -s /etc/init.d/twonky.sh /etc/rc3.d/S99twonkyserver
sudo ln -s /etc/init.d/twonky.sh /etc/rc5.d/K99twonkyserver

sudo /etc/init.d/twonky.sh stop
sudo /etc/init.d/twonky.sh start

Примечание. Существует известная проблема: init-с крипт «twonky.sh» не работает на современных ubuntu linux системах из-за несовместимости с некоторыми конфигурационными инструментами системы. Это значит, что скрипт не возможно использовать для автозапуска Twonky Server’a.

Для автозапуска Twonky Server’a будем использовать файл twonkystarter. Ставим его в автозагрузку:
Меню > Настройки > Сеансы и запуск > Автозапуск > Добавить
Имя: Twonky Server
Команда: /usr/local/twonky/twonkystarter

Источник

[РЕШЕНО] Помогите с Twonky

#1 — 6 марта 2016 в 16:12

#2 — 6 марта 2016 в 18:22

****************************
* TwonkyServer Linux HowTo *
****************************
This document was last modified June 16th, 2015.

The Twonky UPnP server for Linux is available for different
machine architectures:

— Standard PC (x86)
— ARM (Advanced Risc Machine) big and little endian
— MIPS (Microprocessor without interlocked pipeline stages)
big and little endian
— PowerPC (Performance optimization with enhanced RISC Performance Chip)
— SH3 (Hitachi SH)
— SH4 (Hitachi SH)
— SPARC (Scalable Processor ARChitecture)

Your package will consist of the following files:

twonkystarter Twonky UPnP server starter
twonkyserver Twonky UPnP server
cgi-bin/* cgi scripts for twonky
plugins/* plugins for twonky
resources/* resources for twonky
radio.m3u Sample playlist
Linux-HowTo.txt This file
NOTICES-Server.txt Licenses and notices for open source used for Twonky Server
TwonkyServer-Readme.html Release notes
Terms of Use*.pdf Licence Agreement
twonky.license/twonky.dat License file required to run Twonky Server
twonky.sh Sample autostart script
twonkyserver-default.ini Default configuration for Twonky Server

Copy all files (keeping the directory structure) into your most
favourite installation directory, e.g. /usr/local/twonky.

Make sure that the server file, plugins and the cgi scripts have the exe bit set.
If not, try:
«chmod 700 twonkys* twonkyproxy cgi-bin/* plugins/*»

Читайте также:  Журнал событий windows 10 как посмотреть ошибки

Twonky needs an «appdata» folder to store its database and other runtime generated
files. The default location for this depends on the user running the server. For
the user root (id = 0) this is
/var/twonky

For all other users this is
$HOME/.twonky

To specify an alternate location for the «appdata» use the command line switch
-appdata «/

The specified path needs to be full qualified, do not use relative paths here.

In any case make sure that this folder exists and is writable before starting the
server.

Now start the server with a full qualified path (never just «./twonkystarter»),
but «/usr/local/twonky/twonkystarter» . The server will display a startup
message. The server is running now and you can find and use it with
your UPnP client device. Before you continue, you should point the
server to one or more content directories via the configuration
web-page.

To open the server’s configuration web-page, open the following url in a web
browser:
http://127.0.0.1:9000/webconfig

If the server can not be found by any client device check your
network firewall settings (see below).

To enable autostart of the server, you need to be a Linux expert,
because all Linux flavours differ and no general procedure can be
suggested. In many cases «twonky.sh» could be adapted to your
needs and linked into an appropriate location to enable autostart.
The script is intended to work on SUSE, OpenSUSE, Fedora Core and other
Linux Standard Base (LSB) compliant systems when installed into
/etc/init.d and linked to rc3.d and rc5.d as S99twonkyserver and
K99twonkyserver:
«ln s ../twonky.sh S99twonkyserver»
«ln s ../twonky.sh K99twonkyserver»

The installer script (twonky*.sh) is not working for modern ubuntu linux
systems due to incompatibitlities with some system config tools (chkconfig
vs. update-rc.d). The manual installation however is unaffected.

Eventually it is necessary to have a multicast route set for the
server by issuinge, e.g.:
«route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0»

If Iptables is enabled on the linux system, some rules shall be added for Twonkyserver
A standard configuration would be the following.
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
target prot opt in out source destination
ACCEPT all — lo * 0.0.0.0/0 0.0.0.0/0
ACCEPT all — * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
ACCEPT udp — * * 0.0.0.0/0 0.0.0.0/0 udp dpt:1900 # BYEBYE/ALIVE MESSAGES
ACCEPT udp — * * 0.0.0.0/0 0.0.0.0/0 udp dpt:1030 # MSEARCH
ACCEPT tcp — * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:9000 # TwonkyServer WebUI
ACCEPT udp — * * 0.0.0.0/0 0.0.0.0/0 udp dpt:5353 # Airplay discovery (mDNS) — polling to multicast
ACCEPT udp — * * 0.0.0.0/0 0.0.0.0/0 udp spt:5353 # Airplay discovery (mDNS) — answers from client
ACCEPT tcp — * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 # https
DROP all — * * 0.0.0.0/0 0.0.0.0/0

If you are running a Debian distribution on a 64 bit architecture, it
is possible that you need to install the 32 bit compatibility
libraries. In this case invoke:
«apt-get install ia32-libs»

Источник

Twonky Forum

Discussion of Lynx Technology & Twonky products

  • Unanswered topics
  • Active topics
  • Search
  • The team

Ultimate Server (5.1) install guide on Ubuntu (9.10)

Ultimate Server (5.1) install guide on Ubuntu (9.10)

Post by fboecom » Fri Mar 05, 2010 7:04 pm

I thought there is a need for a more comprehensive install guide for twonky on unbuntu — here it is.
A replay or gathering of earlier posts into the newest versions — tested&verified against Twonkyserver 2.2.5-5.1.3 and Ubuntu 9.10, but I am convinced it will work on other ubuntu versions — since it is so simple.
Some small changes to earlier posts. Some explanations. Some comments on Twonky’s own documentation (LinuxHowTo). Some solutions after some errors.
** 24feb11 — checked and quickly updated for 2.2.5.6.0.28 on Ubuntu 10.04**.

Main goal environment for my installation was a headless (no monitor) Ubuntu server. So a start of twonky at boot time was required.

Items:
1. File names and background
2. Long install with explanations
3. Creating the autostart
4. Some problems solved
5. Short installation description

Читайте также:  Линуксы для работы с флешки

1. FILE NAMES AND BACKGROUND
One of the major concerns for me was that the twonkymedia install script generates errors in Ubuntu 9.10, both during install as during the creating of boot links (update-rc), which are — so it seems — annoying but do not prevent normal operation. So simply disregard them — unless they really mean somthing of course.

Another concern is the terminology in packages that I find confusing. ‘Media’ and ‘Server’ are happily mixed up here. That situation no doubt has resulted from times when twonkymedia was the company to own the server.

Some «»»twonky»»» items you may come accross:
— twonkymedia-i386-glibc-2.2.5-5.1.3.sh: the linux install setup package. Will stay and reside in your installation directory after running it.
after installing that .sh:
— twonkymedia and twonkymediaserver: in your installation directory, the actual server executables, that are daemonized by the twonkymedia.sh shell script
— twonkymedia.sh: in your install directory, the shell script (with non fatal errors in Ubuntu) that kicks off the server processes. Can run as a normal user, especially by the user who owns this directory, but not when auto startup is required.
— twonkyserver, in /etc/init.d, created by the install script run from a sudo command, has exactly the same contents as twonkymedia.sh in the install directory. Should be root and have exe privileges.
— twonkymedia, a process after kicking off the » twonkymedia.sh start» or «/etc/init.d/twonkyserver start» (use ps-ef|grep twonky).
— twonkymediaserver, same.
if both last two processes are running, without , you have reached your goal!
— /var/run/mediaserver.pid: if catted out: will show the PID of the twonkymedia process that is active.

Another comment: after installing the twonkedia server, the install directory will contain a file LinuxHowTo.txt. Although the contents is not specifically wrong, it holds too many unnecessary instructions and the statement that you need to be a Linux expert to create autostart is ridiculous. It is dead simple.

2. LONG INSTALL DESCRIPTION
download twonky media server Linux setup package from http://www.twonkymedia.com/installs.html
on Mar 5, 2010 that is:
http://www.twonkymedia.com/downloads/tw . 5-5.1.3.sh

— Presume you will have admin rights for sudo.
—Although twonkymedia server will perfectly run when kicked off by a regular user, installing it as a bootup system service will (at this time) mean root to own the process anyway. In order to avoid any problems, I propose to sudo everything here. However, sudo/root owning the process means that twonky will access ANY content on your system!
— Presume you will want to install in /usr/local/twonkymedia
—(creating the install dir /usr/local/twonkymedia is a choice and it may be in other locations. But do check (nano / gedit) if the twonkymedia.sh has the right install directory specified (after installation).).
-Presume you (use firefox and) downloaded to your Downloads directory.
—Alternative is to use wget. Not described here.
—Note: With the * examples below I presume that you don’t have anything else starting with ‘tw’ in the directories. If you do, expand the # of characters before the *

Instead of mv from Downloads you can of course also use copy (cp). Of course change the download path if the .sh file is somewhere else.
I have verified that you can start the .sh with ./tw*. Of course you can also specify the exact name of the downloaded version.
Further we do need sudo in order to have access rights to write the server script to /etc/init.d. If you don’t, then twonkymedia.sh will not be copied to /etc/init.d/twonkyserver.

Executing the script will generate a chkconfig error.
You can simply ignore that.
** 6.0 version — problem solved**

If you must, you can prevent that by:

but..in normal cases, twonky displays it started the Daemons and is now running.

check the process with:
(terminal)

3 entries should appear: twonkymedia + twonkymediaserver + the grep of twonky itself.

3. CREATING THE AUTOSTART
Now making twonky permanent at unattended startup.
Adding to the ubuntu user startup (Upstart) works for an individual user that logs in, but not for a server, where normally nobody will log in.

Читайте также:  Почему не могу форматировать диск при установке windows

Twonky’s own instruct, in LinuxHowTo in the install directory says:

Both of these, chmod or route, proved NOT necessary in my installation.

As indicated earlier, the install shell script that you have used, has (if you run it with sudo) created an executable script (copy of twonkymedia.sh) in the /etc/init.d directory, named twonkyserver.
It should have the correct execute rights, check it and if necessary:

NEVER use ./twonkymedia or ./twonkyserver stop|start but always the full path, as the LinuxHowTo states correctly.
I have experienced a twonkymedia in the process list after disregarding this. (If you have remove the /var entries (see below) and restart the computer).

After installing twonky, there are not yet any entries in rc0..rc6.d where start stop levels need to be created.

The update-rc command results in LSB errors since the twonkymedia script is not perfect for Ubuntu.
However the results will be OK in terms of daily operation.
Someone may want to update this script. It shouldnt be too difficult.

if you need to check the startup/kill entries:

reboot. test.

4. SOME PROBLEMS SOLVED
Some problems that occurred and were solved:
1.
The reason why occurs, is that something or someone has started the twonkymedia script the wrong way or with the wrong credentials. twonky tries to start, it fails, is not in the process list, but a second (manual) start leads to the .
Apparantly, if an rcX.d start fails, you don’t see it in the process list, you manually start it, but: .

2. deinstall
If for some reason you need to deinstall twonky, for instance with the , here are the steps:

3. samba localhost conflict
Note: I have found localhost conflicts between samba and twonky. I removed samba en reinstalled it.

4. startup rights
As indicated earlier, twonkyserver (or twonkymedia.sh) will start with normal rights, However the autostart requires root to own the process in /etc/init.d and in the rc*.d directories too. So use sudo for the install procedure, as described above and below.

Note: For the 5.x version I had been trying to start twonkymedia with normal user rights using the ‘sudo -u ‘ in the init.d startup script. However there was a bug in twonky that did not correctly startup the second (server) process.
** 6.0.28 version: fixed** (In 5.x, twonky can only autorun as root and thus has access to ALL your content since through the http interface ANY user can set the content to «/».).
You can start twonky from the unix commandline, for example:

with ps-ef this will show the user wintv as the owner of the twonkymedia and twonkyserver processes. Well done twonky .
In order to make this work in unattended startup, you need to update the /etc/init.d/twonkyserver script — I have not done that yet, so no advices here. You dont need sudo in the command because you run rc.d startups as root.
The good thing is twonkyserver now also has a password in the configuration HTML page .. so that also takes away the problem of the normal user serving any file through twonky..

5. SHORT INSTALL DESCRIPTION (for root as user)
so, recapping, all what you really need for installing a headless twonky server, now including the download of the install package (of today):

And that. folks.. is really all there is. Nothing else is really needed!!
but remember: don’t fool around with the wrong rights, and don’t start the server/media in the wrong way manually (with ./twxxx).

Some practical additional advice: for twonky to find and serve the right content, you may need to add root to the group that owns the media files. Even root could not have access.

Источник

Оцените статью