PlexConnect & Apple TV need to have ports 80 & 443. Instead of using port redirection i opted to do this via LXC container.
Heres a HowTo for OMV 1.19+. Please note that im using static DHCP mappings, you have to change the network sections if you want to use manual IP. And its a plain config, so if needed please take care to harden your LXC container (iptables, ssh and so on).
Word of wisdom: you shouldnt do that like me as root, use sudo instead
----
# prepare Network for lxc:
# edit /etc/network/interfaces (example for ipv4 & dhcp static lease only, adjust if needed)
--- snip ---
# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp
auto eth0
iface eth0 inet manual
#iface eth0 inet6 manual
auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_fd 0
bridge_maxwait 0
#bridge_hello 0
#bridge_maxage 0
#bridge_stp off
--- snap ---
# restart network
service network restart
# check network settings
ifconfig
# lxc install
# Install required packages
apt-get install lxc
# Install optional packages
apt-get install bridge-utils libvirt-bin debootstrap
# edit /etc/fstab:
--- snip ---
cgroup /sys/fs/cgroup cgroup defaults 0 0
--- snap ---
# check fstab entry:
mount /sys/fs/cgroup
# check lxc config:
lxc-checkconfig
# The lxc-checkconfig program is reporting "Cgroup memory controller: missing". If you want memory control via cgroups then you need to recompile the linux kernel (or simply add cgroup_enable=memory to the kernel command line on jessie or later).
# Template installation (the Templates included in Wheezy dont work):
wget https://github.com/simonvander…debian-wheezy-robvdhoeven -O /usr/share/lxc/templates/lxc-debian-wheezy
chown root:root /usr/share/lxc/templates/lxc-debian-wheezy
chmod +x /usr/share/lxc/templates/lxc-debian-wheezy
# create Plexconnect container
lxc-create -n plexconnect -t debian-wheezy
# edit /var/lib/lxc/plexconnect/config
--- snip ---
lxc.utsname = plexconnect
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.hwaddr = xx:xx:xx:xx:xx:xx # {mac address for container}
# if not using static dhcp leases you will need this sections too:
#lxc.network.ipv4 = xxx.xxx.xxx.xxx/xx # {ip address for plexconnect container / netmask }
#lxc.network.ipv4.gateway = xxx.xxx.xxx.xxx # {ip address of gateway }
--- snap ---
# start container
lxc-start -n plexconnect -d
# container status
lxc-info -n plexconnect
# make plexconnect container autostart
ln -s /var/lib/lxc/plexconnect/config /etc/lxc/auto/plexconnect
# login to container
lxc-console -n plexconnect
# from here everything is done inside the plexconnect container
# login as root/root
# change root password
pwd root
# edit /etc/network/interfaces (example for dhcp static lease, change for manual ip if needed)
--- snip ---
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
--- snap ---
# restart network
service networking restart
# check network config
ifconfig
# install python & git
apt-get install python git
# install plexconnect
cd /opt
git clone https://github.com/iBaa/PlexConnect.git
# create certificate for ATV
cd /opt/PlexConnect/
cd assets/certificates/
openssl req -new -nodes -newkey rsa:2048 -out trailers.pem -keyout trailers.key -x509 -days 7300 -subj "/C=US/CN=trailers.apple.com"
openssl x509 -in trailers.pem -outform der -out trailers.cer && cat trailers.key >> trailers.pem
# start PlexConnect to create basic settings
./PlexConnect.py
<Ctrl-C>
# edit /opt/PlexConnect/Settings.cfg
# for more info: https://github.com/iBaa/PlexCo…d-use-and-troubleshooting
--- snip ---
ip_pms = xxx.xxx.xxx.xxx # {IP of Plex Host = OMV IP}
enable_plexgdm = False
--- snap ---
# start PlexConnect
./PlexConnect_daemon.bash start
./PlexConnect_daemon.bash status
# for ATV configuration see https://github.com/iBaa/PlexConnect/wiki/Install-Guide
# stop PlexConnect
./PlexConnect_daemon.bash stop
# Create Auto Startup File for PlexConnect
# edit /etc/init.d/plexconnect
--- snip ---
#!/bin/bash
### BEGIN INIT INFO
# Provides: plexconnect
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: This is the Plex Connect daemon
# Description: This script starts PlexConnect in debian
### END INIT INFO
. /lib/lsb/init-functions
NAME=PlexConnect
INSTDIR="/opt/PlexConnect"
DAEMON="$INSTDIR/PlexConnect.py"
DAEMON_OPTS="2>&1 >/dev/null"
DAEMON_USER="root"
PIDFILE=/var/run/PlexConnect.pid
test -x "$DAEMON" || exit 5
case $1 in
start)
if [ -e $PIDFILE ]; then
status_of_proc -p $PIDFILE "$DAEMON $DAEMON_OPTS" "$NAME process" && status="0" || status="$?"
if [ $? = "0" ]; then
log_success_msg "Starting the process $NAME"
exit # Exit
fi
fi
# Start the daemon.
# Start the daemon with the help of start-stop-daemon
# Log the message appropriately
if start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile $PIDFILE --startas $DAEMON -p $PIDFILE -- ${DAEMON_OPTS}; then
log_success_msg "Starting the process $NAME"
else
log_failure_msg "Starting the process $NAME"
fi
;;
stop)
# Stop the daemon.
if [ -e $PIDFILE ]; then
status_of_proc -p $PIDFILE "$DAEMON DAEMON_OPTS" "Stoppping the $NAME process" && status="0" || status="$?"
if [ "$?" = 0 ]; then
start-stop-daemon --stop --signal 2 --quiet --oknodo --pidfile $PIDFILE && /bin/rm $PIDFILE
log_success_msg ""Stopping the $NAME process""
fi
else
log_failure_msg "$NAME process is not running"
fi
;;
restart)
# Restart the daemon.
$0 stop && sleep 2 && $0 start
;;
status)
# Check the status of the process.
if [ -e $PIDFILE ]; then
status_of_proc -p $PIDFILE "$DAEMON $DAEMON_OPTS" "$NAME process" && exit 0 || exit $?
log_success_msg "$NAME process is running"
else
log_failure_msg "$NAME process is not running"
fi
;;
reload)
$0 restart
;;
*)
# For invalid arguments, print the usage message.
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 2
;;
esac
Alles anzeigen
--- snap ---
chmod +x /etc/init.d/plexconnect
update-rc.d plexconnect defaults
# start plexconnect
/etc/init.d/plexconnect start
-----
Have Fun!
Btw. it was my first experience with LXC, maybe there is room for improvement