[LINUX] Forcibly bring out DLNA with ReadyMedia + Reverse Proxy

Overview

I tried to bring out DLNA when using the audio media at home outdoors. The environment is limited, but I managed to do it, so a memorandum.

Environment configuration and setting value example

Terminal place OS example role host name Global IP VPN IP Private IP
Server (1) home Cent OS 7
(Raspberry Pi 3)
DLNA Server 192.168.5.2 192.168.1.2
Server (2) rental Cent OS 7
(rental)
HTTP Gateway dlna.mydomain.org available 192.168.5.3
Client Outdoor android / iPhone Player

Tools used

procedure

Procedure (1) Domain setting

Set the association between the global IP of Server (2) and the host name. (Domain registrar, DDNS service site, etc.)

Step (2) [Server (1)] Build ReadyMedia

Install ReadyMedia on your local server and build a DLNA server. (The construction method is omitted because it is 2 ^ 10 decoction)

Step (3) [Server (1), Server (2)] VPN construction

Because it is a reverse proxy, the purpose is to enable mutual communication between servers. Not required if both servers are on the same network. Also, VPN construction is possible other than Tinc VPN, so it is omitted. (I mean, it gets longer when I write it ...)

Step (4) [Server (2)] Reverse Proxy settings

The main part of this article. Set Reverse Proxy on Virtual Host. DLNA communicates with the server in XML, Because the full path to the content includes the IP address is returned You cannot reach the media through the Reverse Proxy. Therefore, replace the IP described in XML with the host address. Since the communication between the servers is via VPN, the replacement source IP is the VPN IP.

item value
hostname dlna.mydomain.org
Forwarding destination 192.168.5.2:8200

apache:/etc/httpd/conf.d/httpd-vhosts.conf


<VirtualHost *:80>
  ServerName dlna.mydomain.org

  AddOutputFilterByType SUBSTITUTE text/xml
  Substitute "s|192.168.5.2:8200|dlna.mydomain.org|i"

  ProxyRequests Off
  ProxyPass / http://192.168.5.2:8200/
  ProxyPassReverse / http://192.168.5.2:8200/
</VirtualHost>

terminal


systemctl restart httpd.service

Step (5) [Client]

Listen using the smartphone version of foobar2000.

item value
Client foober2000
(Google Play,AppStore)
URL http://dlna.mydomain.org/rootDesc.xml

Setting screen

foober2000.png

Screen sample

foober2000.png

Impressions

reference

-Mod_substitute --Apache HTTP Server Version 2.4 https://httpd.apache.org/docs/2.4/mod/mod_substitute.html -VirtualHost for reverse proxy to access with completely different IP / host name --Qiita https://qiita.com/tkykmw/items/d7f07f26b89f923d57d5 -Text rewriting by Apache mod_substitute + mod_filter --doodle-on-web https://www.doodle-office.work/entry/mod_substitute_mod_filter ยท Mod rewrite --Apache mod_substitute on HTTP request to reverse proxyed host --Tutorial for beginners https://tutorialmore.com/questions-757269.htm

Recommended Posts

Forcibly bring out DLNA with ReadyMedia + Reverse Proxy
Reverse proxy with Apache 2.4 on Ubuntu 19.10 Eoan Ermine