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


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
Server (2) rental Cent OS 7
HTTP Gateway dlna.mydomain.org available
Client Outdoor android / iPhone Player

Tools used


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


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

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

  ProxyRequests Off
  ProxyPass /
  ProxyPassReverse /


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


Screen sample




-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