AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1012380
Accepted
ndemarco
ndemarco
Asked: 2018-03-07 03:19:05 +0800 CST2018-03-07 03:19:05 +0800 CST 2018-03-07 03:19:05 +0800 CST

如何在不指定端口号的情况下使 Logitech Media Server 可用?

  • 772

Logitech Media Server是一款流式音频服务器,以前由 Slim Devices 开发,称为 SlimServer。它将音频流式传输到 Squeezebox 设备(由 Logitech 提供)和第三方设备,如基于 Raspberry Pi 的PiCorePlayer。

使用默认选项安装时,Logitech Media Server 在端口 9000 上可用。默认 URL 为http://myserver:9000.

我想将 URL 重写为http://myserver/music.

从同行那里,我了解到需要反向代理服务器。我试图为此使用 nginx,但没有成功。我很确定 Apache 可以解决这个问题,但是这两种解决方案都没有成功。我渴望学习!

SlimDevices wiki 上的这篇文章解释了使用 Apache 的过程。我关注了这篇文章,但没有成功。

文章指出要安装未找到的软件包libapache2-mod-proxy-html。我从这篇文章中了解到,它不再需要。按照说明,似乎libapache2-mod-proxy-html不是我的问题的原因。我是一个寻求帮助的人,所以我顺从别人。

文章的配置文件是:

# 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>

当我实施文章的解决方案并尝试在http://myserver/slimserveror上访问 Logitech Media Server 时http://myserver/slimserver,我得到了正确的页面背景,但主要内容仅显示Loading Logitech Media Server...。 正在加载 Logitech Media Server... 屏幕图像 URLhttp://myserver:9000有效。我可以正常与罗技媒体服务器交互。

我更愿意学习在 nginx 中执行此操作的方法,因为这是我的同事今天使用并且最熟悉的方法。如果向我展示了如何在 Apache2 中执行此操作,我可以尝试自己在 nginx 中复制该功能作为学习经验。一旦显示正确的方法,我将进入 Apache 或 nginx 文档并研究解决方案的细节。如上所述重写 URL 是我多年来一直想做的事情 [在此处插入尴尬的表情符号],但没有成功。

apache2 nginx reverse-proxy
  • 2 2 个回答
  • 1431 Views

2 个回答

  • Voted
  1. Best Answer
    J. Reeves
    2018-07-29T12:46:45+08:002018-07-29T12:46:45+08:00

    您可以使用iptables将端口 80 映射到 9000 的请求:

    sudo iptables -I PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-port 9000
    

    这将允许您在没有端口号的情况下请求http://myserver/ 。为了在重启后保持这种状态,您需要安装 iptables-persistent

    sudo apt-get install iptables-persistent
    
    • 2
  2. Thad
    2018-09-13T09:39:15+08:002018-09-13T09:39:15+08:00

    我还没有尝试过,但是为什么不在slimserver.pl启动时将端口设置为80。我在我只有基本用户权限的工作机器上运行它。
    一切都用完了我的家庭目录。

    我有一个完全独立的安装,没有特权用户来启动/停止等。如果你深入研究它,它会非常灵活。

    这是该命令的使用指南:

    Usage: ./slimserver.pl [--audiodir ] [--daemon] [--stdio] [--logfile ] 
                           [--user ]
                           [--group ]
                           [--httpport  [--httpaddr ]]
                           [--cliport  [--cliaddr ]]
                           [--prefsfile  [--pidfile ]]
                           [--d_various]
                           --help           => Show this usage information.
                           --audiodir       => The path to a directory of your MP3 files.
                           --logfile        => Specify a file for error logging.
                           --daemon         => Run the server in the background.
                                               This may only work on Unix-like systems.
                           --stdio          => Use standard in and out as a command line interface
                                               to the server
                           --user           => Specify the user that server should run as.
                                               Only usable if server is started as root.
                                               This may only work on Unix-like systems.
                           --group          => Specify the group that server should run as.
                                               Only usable if server is started as root.
                                               This may only work on Unix-like systems.
                           --httpport       => Activate the web interface on the specified port.
                                               Set to 0 in order disable the web server.
                           --httpaddr       => Activate the web interface on the specified IP address.
                           --cliport        => Activate the command line interface TCP/IP interface
                                               on the specified port. Set to 0 in order disable the
                                               command line interface server.
                           --cliaddr        => Activate the command line interface TCP/IP
                                               interface on the specified IP address.
                           --prefsfile      => Specify the path to the preferences file
                           --pidfile        => Specify where a process ID file should be stored
                           --quiet          => Minimize the amount of text output
                           --playeraddr     => Specify the _server's_ IP address to use to connect
                                               to players
                           --streamaddr     => Specify the _server's_ IP address to use to connect
                                               to streaming audio sources
                           --nosetup        => Disable setup via http.
    
    • 2

相关问题

  • 如何使用 fastcgi 和简单的测试脚本设置 apache?

  • 新贵监督的 Apache 初始化脚本?

  • http://localhost/ 不工作

  • 访问启用的虚拟主机时出现 403 禁止错误

  • 如何设置一台机器来将我的网站托管到世界各地 - 使用我自己的网址?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve