linux(debian) 下安装ample搭建局域网共享音乐服务器。

本文介绍如何使用Ample在局域网内快速搭建音乐服务器。包括安装配置Ample、设置音乐文件夹路径、允许客户端数量等步骤,并提供通过VLC播放器及网页端访问的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

加班太累。。。到了晚上在同事旁边调试的时候,想播放下自己机器里面的音乐。这个时候搭建一个音乐服务器就很有必要了。
这里我们使用ample
#apt-get install ample 
然后配置它
在/etc/ample/ample.conf 里面
配置非常简单。


# An example of Ample config file
#


# Port number to use 端口号
port = 40404


# Should files be ordered when playing a mixed stream? 
order = false


# Amount of simaltaneous client allowed #允许链接的客户端数
clients = 5


# Path to logile if syslog isn't used #日志
logfile /var/log/ample.log


# Path(s) to MP3 dir/files or M3U file


#Add your MP3 path here
#mp3path = /usr/share/mp3


#mp3path = /home/moremp3  #这里填你的服务器的音乐文件夹
mp3path = /home/media/music/other


# Path to the HTML file to use as a template
#htmlfile = /home/ample.html




# Should the MP3 dir(s) be recursively scanned? 
recursive = true


# Name of the server
# (displayed to clients here and there) #共享的IP
serveraddress = 192.168.20.68
#音乐服务器的名字
servername = Tom's Music Centre


# Username and password, if these are specified, Ample
# will automatically ask for username/password
#username = MusicLover
#password = Pekaboo




# Filter to pass each music file through
# (before they are sent to the client)
# filter = /usr/bin/lame -b64 --quiet "@FPATH@" -




修改好后,保存重启下ample
#/etc/init.d/ample restart
最后在局域网同事的机器上打开vlc, 在网络地址那里填上我们自定义的。 

比如我的http://192.168.20.68:40404/就可以了.vlc支持切换上下一首。还可以支持自定义的播放列表m3u. 这样客户端就可以选歌了。

也可以通过网页端来播放, 直接访问 http://192.168.20.68:40404/index.html 


如果启动ample后并没有运行, 检查下/var/log/ample.log 并且查看下给的音乐文件夹是否有权限, 是否路径是对的,这些可以去/var/log/syslog 看见对应的错误。修复完这些错误后/etc/init.d/ample force-reload 即可


或者可以直接在命令行启动,

#ample -p40404-c5 -f /etc/ample/ample.conf -d

-p是端口, -c5 是指定几个人链接, -f 是指定配置文件 -d是print debug


enjoy!!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值