Logitech Media Server is a streaming audio server formerly by Slim Devices known as SlimServer. It streams audio to Squeezebox devices (by Logitech), and third party devices, like Raspberry Pi-based PiCorePlayer.
When installed with default options, the Logitech Media Server is available on port 9000. The default URL is http://myserver:9000
.
I would like to rewrite the URL as http://myserver/music
.
From peers, I understand a reverse proxy server is required. I've attempted to use nginx for this without success. I am quite sure Apache could work for this, but have not been successful with either solution. I am eager to learn!
This article, on the SlimDevices wiki, explains the process using Apache. I followed the article, but have not been successful.
The article states to install the package libapache2-mod-proxy-html, which is not found. I understand from this article, it is no longer required. Following the instructions, it seems libapache2-mod-proxy-html is not the cause of my problem. I'm the one asking for help, so I defer to others.
The article's configuration file is:
# Slimserver Reverse Proxy Configuration
# Prepared by BV January 2008
#
# Make sure that the server cannot be abused
#
ProxyRequests Off
# The Proxy section below allows internet users
# to access the internal server
ProxyPass /slimserver/ http://localhost:9000/
ProxyHTMLURLMap http://localhost:9000 /slimserver
<Location /slimserver/>
Order allow,deny
Allow from all
ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /slimserver/
ProxyHTMLURLMap /slimserver /slimserver
RequestHeader unset Accept-Encoding
</Location>
When I implement the article's solution and attempt to access the Logitech Media Server on http://myserver/slimserver
or http://myserver/slimserver
, I get the proper page background, but the main content only says Loading Logitech Media Server.... Loading Logitech Media Server... screen image The URL http://myserver:9000
works. I can interact with the logitech media server normally.
I would prefer to learn the way to do this in nginx, as that's what my coworkers use today and are most familiar with. If I am shown how to do this in Apache2, I could attempt to duplicate the functionality in nginx myself as a learning experience. Once shown the right way, I will go into the Apache or nginx docs and research the details of the solution. Rewriting the URL as described above is something I've wanted to do for years [insert embarrassed face emoji here] but have not been successful.
You can use iptables
to do map requests to port 80 back to 9000:
sudo iptables -I PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-port 9000
This will allow you to request http://myserver/ without the port number. In order to make this persistent across reboots, you'll need to install iptables-persistent
sudo apt-get install iptables-persistent
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments