plexconnect -getting it to work with nginx?

    • OMV 1.0
    • plexconnect -getting it to work with nginx?

      I have tried to follow a previous user here to get plexconnect to work so that I can use my appleTV v3 to view plex but I am confused. I basically modified the listed code with my ip(s) and paths in attempt, but I believe I got myself lost. Can someone tell me how to query via CLI what programs are running? I followed the post all the way to attempting to get plexconnect to start up as a daemon. All of the supported plugins work I just cannot get this little app that allows ATV viewing to work.

      I changed the web interface for OMV to be viewed at port :8085 so that (as I understand it) the ATV can connect to the PMS on port 80 because this can't be changed short of creating an ip table in omv's firewall or perhaps a trigger set up in my router? I understand the basics but I think I am getting wrapped up in the details.

      I went ahead and tried to change the dns server and certificate in the ATV, but ATV cannot find my cert. I changed the path in the settings.cnfg to point to where I have the cert, but I think I am missing something that allows the ATV to connect. When I try to use: "service plexconnect start" as ultimately the code for the created daemon should let me do, I do not receive any echoed response. I cannot remember the command that allows one to see all the running processes, so I am really not certain I have PlexConnect running. Will someone please post that command? And or help me figure out where I have gone wrong?

      ~jt~
      OMV 1.14
    • contents of /etc/init.d/plexconnect

      Here is the code I have in my init.d file for plexconnect



      Shell-Script

      1. #!/bin/bash
      2. ### BEGIN INIT INFO
      3. # Provides: plexconnect
      4. # Required-Start: plexmediaserver networking
      5. # Required-Stop: plexmediaserver networking
      6. # Default-Start: 3 4 5
      7. # Default-Stop: 0 1 6
      8. # Short-Description: This is the Plex Connect daemon
      9. # Description: This script starts the Plex Connect
      10. # Python scripts in a detached screen.
      11. ### END INIT INFO
      12. # Using the lsb functions to perform the operations.
      13. . /lib/lsb/init-functions
      14. # Process name ( For display )
      15. NAME=PlexConnect
      16. # Daemon name, where is the actual executable
      17. DAEMON="/usr/bin/screen"
      18. DAEMON_OPTS="-S PlexConnect -d -m /home/PlexConnect/PlexConnect.py"
      19. DAEMON_USER="root"
      20. # pid file for the daemon
      21. PIDFILE=/var/run/PlexConnect.pid
      22. # If the daemon is not there, then exit.
      23. test -x "$DAEMON" || exit 5
      24. case $1 in
      25. start)
      26. # Checked the PID file exists and check the actual status of process
      27. if [ -e $PIDFILE ]; then
      28. status_of_proc -p $PIDFILE "$DAEMON $DAEMON_OPTS" "$NAME process" && status="0" || status="$?"
      29. # If the status is SUCCESS then don't need to start again.
      30. if [ $? = "0" ]; then
      31. log_success_msg "Starting the process $NAME"
      32. exit # Exit
      33. fi
      34. fi
      35. # Start the daemon.
      36. # Start the daemon with the help of start-stop-daemon
      37. # Log the message appropriately
      38. if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -p $PIDFILE -- ${DAEMON_OPTS}; then
      39. while read line ; do [[ $line =~ ([0-9]*).PlexConnect ]] && echo ${BASH_REMATCH[1]} ; done < <(screen -ls) > $PIDFILE
      40. log_success_msg "Starting the process $NAME"
      41. else
      42. log_failure_msg "Starting the process $NAME"
      43. fi
      44. ;;
      45. stop)
      46. # Stop the daemon.
      47. if [ -e $PIDFILE ]; then
      48. status_of_proc -p $PIDFILE "$DAEMON DAEMON_OPTS" "Stoppping the $NAME process" && status="0" || status="$?"
      49. if [ "$?" = 0 ]; then
      50. start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
      51. /bin/rm -rf $PIDFILE
      52. log_success_msg ""Stopping the $NAME process""
      53. fi
      54. else
      55. log_failure_msg "$NAME process is not running"
      56. fi
      57. ;;
      58. restart)
      59. # Restart the daemon.
      60. $0 stop && sleep 2 && $0 start
      61. ;;
      62. status)
      63. # Check the status of the process.
      64. if [ -e $PIDFILE ]; then
      65. status_of_proc -p $PIDFILE "$DAEMON $DAEMON_OPTS" "$NAME process" && exit 0 || exit $?
      66. log_success_msg "$NAME process is running"
      67. else
      68. log_failure_msg "$NAME process is not running"
      69. fi
      70. ;;
      71. reload)
      Display All
      OMV 1.14
    • In the diagnostics section you can check system information for running process. I was in that thread for nginx (which i found to be totatly unnecessary).

      You don't need to change port 80 in the webUI. You can set a specific iptables rule to redirect incomming traffic from atv3 ip to omv ports 80 and 443 to other ports (the ones in plexconnect settings). The rule is published in the forum, just use google not the forum engine.

      For installing the certificate (can't remember the exact procedure) but it was just to start a simple web server in the folder were you have the certificates and with atv interface point to that address to install them.

      ​python -m SimpleHTTPServer
      New wiki
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server
    • PlexConnect port conflict

      Just firing this rules in terminal make the port redirection work, but they are not reboot persistant. As a fast solution you can put them at /etc/rc.local file before the exit line to make them reboot persistant.
      New wiki
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server