找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 16491|回复: 18

[k3] Plex Media Server on K3 安装过程【有问题】

[复制链接]
发表于 2017-10-10 23:59 | 显示全部楼层 |阅读模式
声明照猫画虎搬过来的,技术不懂,问题也不少,请大神帮忙处理。请加群讨论QQ:641057163 讨论。
教程相关文件进群下载  entware-ngu-setup.sh
                                    debian_jessie8.9-arm_clean.gz
                                    PlexMediaServer-0.9.16.6.1993-5089475.tar.bz2
使用路由器斐讯K3
一、安装梅林固件,我安装的是混血版(感谢作者)
       安装好梅林固件后(1)开软件中心,非必需   (2)开启 SSH开启 必需
       请把需要在路由器安装的插件先装上,尤其涉及网络服务的¥¥等。(本教程不影响最终 软件中心 的使用,以防万一,还是先装好)
       格式化外接硬盘位ext4格式,必需(路由器/opt挂载点)。接路由器确保正常,建议容量大一些。
       注意:PLEX比较吃性能,路由器建议不要弄主路由,防止上网不开心。
二、安装entware-NG(安装至硬盘),swap file 选择2GB
       putty 链接路由  Winscp 链接路由 密码就是路由器管理密码,地址 路由器管理地址
       安装过程中权限不够的,请在Winscp查看添加
       将entware-ngu-setup.sh拷贝至路由器根目录 tmp文件夹下
      (1) 输入命令,安装脚本并执行
      cd /tmp
      chmod +x ./entware-ngu-setup.sh
      ./entware-ngu-setup.sh
效果如下
admin@RT-AC66U:/tmp# ./entware-ngu-setup.sh
Info: This script was created by ryzhov_al and modified by TeHashX.
Info: Thanks @zyxmon & @ryzhov_al for New Generation Entware
Info: and @Rmerlin for his awesome firmwares
Info: This script will guide you through the Entware-NG installation.
Info: Script modifies only "entware-ng" folder on the chosen drive,
Info: no other data will be touched. Existing installation will be
Info: replaced with this one. Also some start scripts will be installed,
Info: the old ones will be saved on partition where Entware-NG is installed
Info: like /tmp/mnt/sda1/jffs_scripts_backup.tgz Info: Looking for available partitions...
[1] --> /tmp/mnt/sda1
=> Please enter partition number or 0 to exit
[0-1]:

       ( 2 )选择1  安装至外置硬盘
             1
            Press ENTER

Info: /tmp/mnt/sda1 selected.

* Warning: Found chrooted-debian installation, stopping...
* Warning: stopping running services...
* Warning: Found Entware installation, saving...
* Warning: Found Old Optware installation, saving...
* Warning: Found Old Optware-NG installation, saving...
* Warning: Found previous installation, saving...
Info: Creating /tmp/mnt/sda1/entware-ng folder...
* Warning: Deleting old /tmp/opt symlink...
Info: Creating /tmp/opt symlink...
Info: Creating /jffs scripts backup...
tar: removing leading '/' from member names
Info: Modifying start scripts...
Info: Starting Entware-NG deployment....

Info: Creating folders...
Info: Deploying opkg package manager...
Info: Basic packages installation...
Updated list of available packages in /opt/var/opkg-lists/entware-ng.
Installing ldconfig (1.0.8-1) to root...
Installing findutils (4.5.14-1) to root...
Installing libc (1.0.8-1) to root...
Installing libgcc (4.8.5-1) to root...
Installing libssp (4.8.5-1) to root...
Configuring ldconfig.
Configuring libgcc.
Configuring libc.
Configuring libssp.
Configuring findutils.

Router model
RT-AC66U
---------
SWAP FILE
---------
Choose swap file size (Highly Recommended)
1. 512MB
2. 1024MB (recommended)
3. 2048MB
4. Skip this step, I already have a swap file / partition
   or I don't want to create one right now
Enter your choice [ 1 - 4 ]
        ( 3 ) 选择swap空间大小,推荐2G
            3
            Press ENTER
效果省略,一路回车
        ( 4 ) 安装软件测试是否成功
           cd /opt
/tmp/mnt/sda1/entware-ng#
           安装软件 nano 编辑软件
           opkg install nano
           opkg install nano findutils
效果省略Downloading
其他帮助命令 软件 启动 关闭 重启 命令
/opt/etc/init.d/SXX-package-name start
/opt/etc/init.d/SXX-package-name stop
/opt/etc/init.d/SXX-package-name restart

entware 服务的 启动 关闭 重启 命令
services start
services stop
services restart
三、安装Debian Jessie
       将 debian_jessie8.9-arm_clean.gz 拷贝至路由器外接硬盘 \sda1\entware-ng.arm 文件夹下
       ( 1 )输入命令 安装 debian 包
             cd /opt
             tar -xvzf ./debian_jessie8.9-arm_clean.gz
       ( 2 ) 创建启动脚本并加载服务
             编辑设置
             nano /opt/etc/init.d/S99debian
             将下列标记颜色的拷贝至S99debian中,红色部分可以# EXT_DIR=/tmp/mnt/sda1/Media/语句中#的去掉,也可以修改成自己的地址
Dibian 相当是自己的服务器,有自己的环境。路由器有自己的环境, Entware有自己的环境,还有一个koolshare的软件中心 不要弄晕了
#!/bin/sh
PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin
# Folder with Debian Jessie
CHROOT_DIR=/tmp/mnt/sda1/entware-ng.arm/debian
# Some folder outside of sandbox,
# will be mounted to /mnt folder in Debian
# Uncommented next line if you need to mount a folder inside debian (remove #)
# EXT_DIR=/tmp/mnt/sda1/Media/
CHROOT_SERVICES_LIST=/opt/etc/chroot-services.list
if [ ! -e "$CHROOT_SERVICES_LIST" ]; then
        echo "Please, define Debian services to start in
$CHROOT_SERVICES_LIST first!"
        echo "One service per line. Hint: this is a script names from
Debian's /etc/init.d/"
        exit 1
fi
MountedDirCount="$(mount | grep $CHROOT_DIR | wc -l)"
start() {
        if [ $MountedDirCount -gt 0 ]; then
                echo "Chroot'ed services seems to be already started,
exiting..."
                exit 1
        fi
        echo "Starting chroot'ed Debian services..."
        for dir in dev proc sys; do
                mount -o bind /$dir $CHROOT_DIR/$dir
        done
        [ -z "$EXT_DIR" ] || mount -o bind $EXT_DIR $CHROOT_DIR/mnt
        for item in $(cat $CHROOT_SERVICES_LIST); do
                chroot $CHROOT_DIR /etc/init.d/$item start
        done
        }
stop() {
        if [ $MountedDirCount -eq 0 ]; then
                echo "Chroot'ed services seems to be already stopped,
exiting..."
                exit 1
        fi
        echo "Stopping chroot'ed Debian services..."
        for item in $(cat $CHROOT_SERVICES_LIST); do
                chroot $CHROOT_DIR /etc/init.d/$item stop
                sleep 2
        done
        mount | grep $CHROOT_DIR | awk '{print $3}' | xargs umount -l
        }
restart() {
        if [ $MountedDirCount -eq 0 ]; then
                echo "Chroot'ed services seems to be already stopped"
                start
                else
                echo "Stopping chroot'ed Debian services..."
        for item in $(cat $CHROOT_SERVICES_LIST); do
                chroot $CHROOT_DIR /etc/init.d/$item stop
                sleep 2
        done
        mount | grep $CHROOT_DIR | awk '{print $3}' | xargs umount -l
                echo "Restarting chroot'ed Debian services..."
        for dir in dev proc sys; do
                mount -o bind /$dir $CHROOT_DIR/$dir
        done
        [ -z "$EXT_DIR" ] || mount -o bind $EXT_DIR $CHROOT_DIR/mnt
        for item in $(cat $CHROOT_SERVICES_LIST); do
                chroot $CHROOT_DIR /etc/init.d/$item start
        done
        fi
        }       
enter() {
        [ -z "$EXT_DIR" ] || mount -o bind $EXT_DIR $CHROOT_DIR/mnt
        mount -o bind /dev/ /opt/debian/dev/
        mount -o bind /dev/pts /opt/debian/dev/pts
        mount -o bind /proc/ /opt/debian/proc/
        mount -o bind /sys/ /opt/debian/sys/
        chroot /opt/debian /bin/bash
        }
status() {
        if [ $MountedDirCount -gt 0 ]; then
                echo "Chroot'ed services running..."
        else
                echo "Chroot'ed services not running!"
        fi
        }
case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        restart)
                restart
                ;;
        enter)
                enter
                ;;       
        status) status
                ;;
        *)
                echo "Usage: (start|stop|restart|enter|status)"
                exit 1
                ;;
esac
echo Done.
exit 0
保存 CTRL-O, and 回车 ENTER and 退出 CTRL-X 推出nano编辑器
        ( 3 ) 赋予S99debian执行权限
         chmod 755 /opt/etc/init.d/S99debian
        ( 4 )  建立启动链接
        touch /opt/etc/chroot-services.list
        ln -s /opt/etc/init.d/S99debian /opt/bin/debian
        如果执行失败的话,将S99debian的语句直接复制到putty 单独执行
        (5)debian 服务启动 关闭 重启 进入 状态
         debian start
         debian stop
         debian restart
         debian enter
        debian status
But don't forget to add services name from /opt/debian/etc/init.d/ to /opt/etc/chroot-services.list
我没弄明白这句话什么意思,应该是把服务名称 全部添加至chroot-services.list文件中,我是单独执行S99debian脚本语句启动debian服务,反正后期plex脚本是吧服务添加至这个文件中了,大家试一下吧
          (  6 ) 复制路由器hosts文件到硬盘debian下,可手工复制
             cp /etc/hosts /opt/debian/etc/
         (7)进入debian
             debian enter
          ( 8 )安装软件服务可用
              apt update && apt upgrade -y
          ( 9 )设置时区
              dpkg-reconfigure tzdata
          ( 10)安装获取软件包
               apt install wget
         成功
辅助命令
1 -debian stop
2 - rm -r /opt/debian
3 - rm /opt/etc/init.d/S99debian
     rm /opt/bin/debian
4 - reboot
四、安装Plex Media Server
       ( 1 )进入debian环境
       debian enter
       ( 2 )安装解压包软件
       apt install wget zip bzip2 libexpat1 -y
       ( 3 )建立应用文件夹/apps 将文件考入PlexMediaServer-0.9.16.6.1993-5089475.tar.bz2
       mkdir -p /apps && cd /apps
       bzip2 -cd PlexMediaServer-0.9.16.6.1993-5089475.tar.bz2 | tar -xv
       mv ./PlexMediaServer-0.9.16.6.1993-5089475 ./plex && rm ./PlexMediaServer-0.9.16.6.1993-5089475.tar.bz2
       (4)添加依赖库启动脚本
         sed -i 's|ulimit.*|export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/var/lib/plexmediaserver"\n&|g' /apps/plex/start.sh
sed -i 's|.\/Plex\\ Media\\ Server|\/apps\/plex\/Plex\\ Media\\ Server|g' "/apps/plex/start.sh"
         ( 5 ) 修复准库执行权限
        cd /apps/plex
find . -iname "*.so" -exec chmod 644 {} \;
find . -iname "*.so.*" -exec chmod 644 {} \;
         ( 6 ) 创建启动脚本,复制粘贴,执行
         cat >> /etc/init.d/plexmediaserver << 'EOF'
#!/bin/sh
### BEGIN INIT INFO
# Provides: plexmediaserver
# Required-Start: $remote_fs $syslog $networking
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Plex Media Server
# Description: Plex Media Server for Linux,
# More information at http://www.plexapp.com
# Many thanks to the great PlexApp team for their wonderfull job !
# Author: Cedric Quillevere / origin@killy.net
# Rewamped Christian Svedin / christian.svedin@gmail.com
# Adapted by TeHashX / contact@hqt.ro
# Version: 1.3
### END INIT INFO
test -f "/apps/plex/start.sh" || exit 0
plex_running=`ps ax | grep "Plex Media Server" | awk '{ print $1 }' | wc -l`
case "$1" in
start)
if [ "$plex_running" -gt 1 ]; then
echo "Plex already running..."
exit 0
fi
echo -n "Starting Plex Media Server: "
/apps/plex/start.sh & >/dev/null 2>&1
sleep 1
echo "done"
;;
stop)
if [ "$plex_running" -eq 1 ]; then
echo "Plex Media Server is not running (no process found)..."
exit 0
fi
echo -n "Killing Plex Media Server: "
# Trying to kill the Plex Media Server itself but also the Plug-ins
ps ax | grep "Plex Media Server" | awk '{ print $1 }' | xargs kill >/dev/null 2>&1
ps ax | grep "Plex*" | awk '{ print $1 }' | xargs kill >/dev/null 2>&1
sleep 1
echo "done"
;;
restart)
sh $0 stop
sh $0 start
;;
status)
if [ "$plex_running" -gt 1 ]; then
echo "Plex Media Server process running."
else
echo "It seems that Plex Media Server isn't running (no process found)."
fi
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
exit 0
EOF
按回车 ENTER
         ( 7 ) 赋予可执行权限
         chmod +x /etc/init.d/plexmediaserver
         ( 8 ) 把启动服务添加至chroot-services.list文件,并赋予权限
          echo "" >>/opt/etc/chroot-services.list
          echo "plexmediaserver" >>/opt/etc/chroot-services.list
          chmod 755 /opt/etc/chroot-services.list
          (  9)重启debian,同时plexmediaserver自动同步启动
          debian restart
五、自己调试吧
       软件中心 安装 卸载正常     尽量装和硬盘无关的软件 效能高
       entware下安装卸载正常    随便吧
       usb中心 下载大师正常       随便吧
       debian   软件安装卸载正常    不建议装常用软件
效果k3
效果plex

我的恩山、我的无线 The best wifi forum is right here.
发表于 2017-10-11 00:15 | 显示全部楼层
好像很吊的样子,这个是一个家庭媒体服务端吗?

点评

plex是一个跨平台集中管理的家庭媒体服务,可以加好友互相分享电影。我不知道哪里设置不对,服务启动了,但视频播放失败。按道理有了debian,是不是可以安装docker服务了,装软件就不用依托别的软件中心了。让大神给  详情 回复 发表于 2017-10-11 00:25
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-10-11 00:25 | 显示全部楼层
极品斌 发表于 2017-10-11 00:15
好像很吊的样子,这个是一个家庭媒体服务端吗?

plex是一个跨平台集中管理的家庭媒体服务,可以加好友互相分享电影。我不知道哪里设置不对,服务启动了,但视频播放失败。按道理有了debian,是不是可以安装docker服务了,装软件就不用依托别的软件中心了。让大神给看看

点评

失败看看什么错误提示,很可能是性能或者编解码器的原因,其实路由器上装个nfs服务,终端用kodi也是个很好的选择,这样服务器压力很小,而且nfs传输比smba有优势,基本不会出现一卡一卡的问题  详情 回复 发表于 2017-10-11 13:34
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-10-11 10:04 | 显示全部楼层
这种指令不懂.梅林基于什么系统我都还不懂,好像是LINUX,,,LINUX的知识可以说是一塌糊涂...
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-10-11 13:22 | 显示全部楼层
本帖最后由 jhlau 于 2017-10-11 13:26 编辑

看到问题了,但是不懂,只好等大神帮你了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-10-11 13:29 | 显示全部楼层
plex带实时转码,性能要求太高,arm的nas都不敢轻易尝试,路由器估计比较累
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-10-11 13:34 | 显示全部楼层
walls 发表于 2017-10-11 00:25
plex是一个跨平台集中管理的家庭媒体服务,可以加好友互相分享电影。我不知道哪里设置不对,服务启动了, ...

失败看看什么错误提示,很可能是性能或者编解码器的原因,其实路由器上装个nfs服务,终端用kodi也是个很好的选择,这样服务器压力很小,而且nfs传输比smba有优势,基本不会出现一卡一卡的问题
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-10-11 22:11 | 显示全部楼层
本帖最后由 walls 于 2017-10-11 22:22 编辑
badcrazy 发表于 2017-10-11 13:34
失败看看什么错误提示,很可能是性能或者编解码器的原因,其实路由器上装个nfs服务,终端用kodi也是个很 ...

plex 自带的dlna中可以播放,服务器刮削和功能都正常,但是plex的软件app 手机 电视 网页都不行,网页端显示无法播放当前项目
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-10-11 22:34 | 显示全部楼层
walls 发表于 2017-10-11 22:11
plex 自带的dlna中可以播放,服务器刮削和功能都正常,但是plex的软件app 手机 电视 网页都不行,网页端 ...

sorry,有的视频能播,可能是plex 有些格式不支持,尴尬
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-10-11 22:44 | 显示全部楼层
低端的x86都不太能满足plex的转码需求,路由器就别折腾了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-10-12 12:03 | 显示全部楼层
walls 发表于 2017-10-11 22:34
sorry,有的视频能播,可能是plex 有些格式不支持,尴尬

plex是全格式支持的,所以这个问题就邪门了,很可能就是我说的性能和解码器问题,毕竟是路由器。建议还是玩玩kodi
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-10-12 12:07 来自手机 | 显示全部楼层
本帖最后由 badcrazy 于 2017-10-12 12:13 编辑

kodi全平台制霸,新版移动端原生界面那是相当风骚的,觉得不好看还有各类主题,插件也一堆

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-10-12 12:11 | 显示全部楼层
恩山论坛因你而精彩!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-12-14 19:33 | 显示全部楼层
请问 debian_jessie8.9-arm_clean.gz 去哪里下载?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-12-16 15:56 | 显示全部楼层
fhvk 发表于 2017-12-14 19:33
请问 debian_jessie8.9-arm_clean.gz 去哪里下载?

QQ:641057163 群里共享了 ,我百度没实名
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-3-29 21:55

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表