Linux install for Plex Connect

Anybody? Bueller?

If you have the certfile option in Settings.cfg set to the default (relative) path, PlexConnect.py will only work when run from the PlexConnect root dir. If you want to run PlexConnect as a service, you need to put the absolute path in the certfile option.

You're the man! That was it, thanks so much for your help!  Now everything is finally back to normal.

If you have the certfile option in Settings.cfg set to the default (relative) path, PlexConnect.py will only work when run from the PlexConnect root dir. If you want to run PlexConnect as a service, you need to put the absolute path in the certfile option.

Anyone have the knowledge to get that startup script to work on FreeBSD/Nas4Free in a jail? Got plexconnect working here

I'm having a bit of an issue here it seems

i have the vhosts setup fine and i see that in the log.

i see my atv accessing plexconnect fine..

i can go into the trailers appl and the plex menu loads but i cant access anyting. just keeps scrolling 'Accessing Trailers'.

SSL server is being run by plexconnect on port 443 and http is apache2 on 80. settings.cfg for plex has ssl port as 443 and http as 81. 

i have in my ports.conf for apache:

NameVirtualHost *:80
Listen 80

and my 000-default in sites-enabled:


  ServerName trailers.apple.com
  ProxyPreserveHost On
  ProxyPass / http://192.168.1.10:81/
  ProxyPassReverse / http://192.168.1.10:81/


  ServerName atv.plexconnect
  ProxyPreserveHost On
  ProxyPass / http://192.168.1.10:81/
  ProxyPassReverse / http://192.168.1.10:81/

my other_vhosts_access.log shows this:

atv.plexconnect:80 192.168.1.45 - - [10/Nov/2013:17:10:38 -0500] "GET /&PlexConnect=Discover&PlexConnectUDID=C0HL4BWAFF54 HTTP/1.1" 200 433 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
atv.plexconnect:80 192.168.1.45 - - [10/Nov/2013:17:10:39 -0500] "GET /PlexConnect.xml&PlexConnectUDID=C0HL4BWAFF54 HTTP/1.1" 200 579 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
atv.plexconnect:80 192.168.1.45 - - [10/Nov/2013:17:10:39 -0500] "GET /js/utils.js HTTP/1.1" 200 1717 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
atv.plexconnect:80 192.168.1.45 - - [10/Nov/2013:17:10:39 -0500] "GET /&PlexConnectATVLogLevel=1&PlexConnectLog=loadItem%3A%20Library HTTP/1.1" 200 289 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
atv.plexconnect:80 192.168.1.45 - - [10/Nov/2013:17:10:39 -0500] "GET /PMS(%2F%2Flocal)/library/sections&PlexConnectUDID=C0HL4BWAFF54 HTTP/1.1" 404 542 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"

in my plex logs the only difference i can see is when i dont use apache and just stick to the plexconnect server i get:

17:14:12 WebServer: serving .xml: /PlexConnect.xml
17:14:12 WebServer: serving /js/utils.js
17:14:12 WebServer: serving .xml: /library/sections
17:14:12 WebServer: serving /js/utils.js
17:14:13 WebServer: serving .xml: /library/sections/1/recentlyAdded

 

and when i try the SSL by plex and http vhost i only get this:

17:14:58 WebServer: serving .xml: /PlexConnect.xml
17:14:58 WebServer: serving /js/utils.js

am i not able to have plex connect run ssl normally and use my apache2 use vhosts listening on 80 and forwarding to 81 plex?

i decided to try and have my apache2 server handle both http and https vhosts and the result is the same as if i use just http vhost and normal https with plexconnect on 443. anyone see an issue with my settings? i've narrowed the issue down to my http server but can't solve it. if i disabled listening on port 80 and just run vhost on 443 and use the plex http server for 80 it runs okay. if i use the plex server for 443 and my apache2 for 80 it does not work.

apache2 error.log

[Sun Nov 10 18:27:12 2013] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sun Nov 10 18:27:12 2013] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sun Nov 10 18:27:12 2013] [notice] Apache/2.2.22 (Ubuntu) mod_ssl/2.2.22 OpenSSL/1.0.1 configured -- resuming normal operations

apache2 other_vhosts_access.log

trailers.apple.com:443 192.168.1.45 - - [10/Nov/2013:18:27:26 -0500] "GET /appletv/us/js/application.js HTTP/1.1" 200 5559 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
trailers.apple.com:80 192.168.1.45 - - [10/Nov/2013:18:27:26 -0500] "GET /&PlexConnect=Discover&PlexConnectUDID=C0HL4BWAFF54 HTTP/1.1" 200 433 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
trailers.apple.com:80 192.168.1.45 - - [10/Nov/2013:18:27:27 -0500] "GET /PlexConnect.xml&PlexConnectUDID=C0HL4BWAFF54 HTTP/1.1" 200 579 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
trailers.apple.com:80 192.168.1.45 - - [10/Nov/2013:18:27:27 -0500] "GET /js/utils.js HTTP/1.1" 200 1717 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
trailers.apple.com:80 192.168.1.45 - - [10/Nov/2013:18:27:27 -0500] "GET /&PlexConnectATVLogLevel=1&PlexConnectLog=loadItem%3A%20Library HTTP/1.1" 200 289 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
trailers.apple.com:80 192.168.1.45 - - [10/Nov/2013:18:27:27 -0500] "GET /PMS(%2F%2Flocal)/library/sections&PlexConnectUDID=C0HL4BWAFF54 HTTP/1.1" 404 542 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
trailers.apple.com:80 127.0.0.1 - - [10/Nov/2013:18:27:37 -0500] "GET /announce?info_hash=%00%1c%8d%cd%a9%e8%d1%81V%cb%ab%ac%c3D%02%a5%80%95%ef%ad&peer_id=-DE1360-0j._TDRhAIOA&port=60167&uploaded=0&downloaded=0&left=0&corrupt=0&redundant=0&compact=1&numwant=200&key=f7b8085c&no_peer_id=1&supportcrypto=1&event=started HTTP/1.0" 403 396 "-" "Deluge 1.3.6"

PlexConnect.log

http://pastebin.com/FnuJTDfr

apache2 ports.conf:

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
NameVirtualHost *:80
Listen 80
 

    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to 
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
    NameVirtualHost *:443
    Listen 443

 

    NameVirtualHost *:443
    Listen 443

apache2 000-default.conf


  ServerName trailers.apple.com
  ServerAlias atv.plexconnect
  ProxyRequests Off
  SSLEngine off
  ProxyPreserveHost On

Order allow,deny
Allow from all

  ProxyPass / http://192.168.1.10:81/
  ProxyPassReverse / http://192.168.1.10:81/

apache2 000-default-ssl:


    ServerName trailers.apple.com
    ServerAlias atv.plexconnect
    ProxyRequests Off
    SSLEngine On
    SSLProtocol all -SSLv2
    SSLProxyEngine On
    SSLCertificateFile /usr/local/lib/plexconnect/assets/certificates/trailers.cer
    SSLCertificateKeyFile /usr/local/lib/plexconnect/assets/certificates/trailers.key
    ProxyPreserveHost On

Order allow,deny
Allow from all

    ProxyPass / https://192.168.1.10:4501/
    ProxyPassReverse / https://192.168.1.10:4501/

Plexconnect Settings.cfg:

[PlexConnect]
port_pms = 32400
port_webserver = 81
ip_plexconnect = 0.0.0.0
certfile = /usr/local/lib/plexconnect/assets/certificates/trailers.pem
ip_dnsmaster = 192.168.1.1
ip_pms = 192.168.178.10
loglevel = High
enable_dnsserver = False
logpath = .
enable_plexgdm = True
port_dnsserver = 53
enable_webserver_ssl = True
ip_webserver = 0.0.0.0
prevent_atv_update = True
port_ssl = 4501
enable_plexconnect_autodetect = True

seems as though my issue was fixed in another thread:

http://forums.plexapp.com/index.php/topic/85747-working-plexconnect-broke-with-one-of-the-newer-commits/

AllowEncodedSlashes NoDecode


    ServerName trailers.apple.com
    ServerAlias atv.plexconnect
    ProxyRequests Off
    ProxyPreserveHost On
    
        Order allow,deny
        Allow from all
    
    AllowEncodedSlashes NoDecode
    ProxyPass / http://192.168.1.10:81/ nocanon
    ProxyPassReverse / http://192.168.1.10:81/

Hi

I'm running PlexConnect on Ubuntu 13.10. Here's my version of an UPSTART script. To me it seems a fair bit simpler than the INIT script. It assumes PlexConnect files to be in /usr/local/lib/plexconnect. Here it is (plexconnect.conf):

# PlexConnect - Plex for Apple TV
#
# The PlexConnect server redirects the Trailer app on Apple TV to
# the local Plex server infrastructure.

description “PlexConnect server”

start on runlevel [2345]
stop on runlevel [!2345]

respawn
respawn limit 10 5
umask 022

send output to a log file (by default /var/log/upstart/)

you can monitor it using ‘sudo tail -f /var/log/upstart/plexconnect.log’

console log

pre-start script
test -x /usr/local/lib/plexconnect/PlexConnect.py || { stop; exit 0; }
test -c /dev/null || { stop; exit 0; }
end script

this will start the server

exec /usr/local/lib/plexconnect/PlexConnect.py

To use this version:

sudo cp plexconnect.conf /etc/init/plexconnect.conf
sudo chown root:root /etc/init/plexconnect.conf
sudo chmod 644 /etc/init/plexconnect.conf

To start immediately:

sudo start plexconnect

To stop it:

sudo stop plexconnect

To see the current log (which I assume will be auto-rotated/compressed by the UPSTART infrastructure):

sudo tail -f /var/log/upstart/plexconnect.log

You can now just create a symlink in /etc/init.d/ called plexconnect linking to the actual PlexConnect_daemon.bash file in the PlexConnect folder and then add it to autostart by writing 

sudo update-rd.d plexconnect defaults

thats it

think there was a typo, this worked for me:

sudo update-rc.d plexconnect defaults

Yea thanks, it was a typo. update-rd.d of course does not exist :P

After upgrading to Ubuntu Server 13.10, I can no longer get this script to work. When I enter, with or without sudo, "service plexconnect status/start/etc." I get the following back:

mike@nas4atu:/$ service plexconnect start
/etc/init.d/plexconnect: invalid arguments
 * could not access PID file for PlexConnect process
 * Starting the process PlexConnect

From the Apple TV's perspective, nothing is wrong. I can watch content.

I tried using the bash script that's now included, but it didn't start the service at boot. I'm not sure if it's supposed to or not.

Any ideas? I've tried every vague thing that Google turned up and I haven't had any progress.

i decided to try and have my apache2 server handle both http and https vhosts and the result is the same as if i use just http vhost and normal https with plexconnect on 443. anyone see an issue with my settings? i've narrowed the issue down to my http server but can't solve it. if i disabled listening on port 80 and just run vhost on 443 and use the plex http server for 80 it runs okay. if i use the plex server for 443 and my apache2 for 80 it does not work.

apache2 error.log

[Sun Nov 10 18:27:12 2013] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sun Nov 10 18:27:12 2013] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sun Nov 10 18:27:12 2013] [notice] Apache/2.2.22 (Ubuntu) mod_ssl/2.2.22 OpenSSL/1.0.1 configured -- resuming normal operations

apache2 other_vhosts_access.log

trailers.apple.com:443 192.168.1.45 - - [10/Nov/2013:18:27:26 -0500] "GET /appletv/us/js/application.js HTTP/1.1" 200 5559 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
trailers.apple.com:80 192.168.1.45 - - [10/Nov/2013:18:27:26 -0500] "GET /&PlexConnect=Discover&PlexConnectUDID=C0HL4BWAFF54 HTTP/1.1" 200 433 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
trailers.apple.com:80 192.168.1.45 - - [10/Nov/2013:18:27:27 -0500] "GET /PlexConnect.xml&PlexConnectUDID=C0HL4BWAFF54 HTTP/1.1" 200 579 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
trailers.apple.com:80 192.168.1.45 - - [10/Nov/2013:18:27:27 -0500] "GET /js/utils.js HTTP/1.1" 200 1717 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
trailers.apple.com:80 192.168.1.45 - - [10/Nov/2013:18:27:27 -0500] "GET /&PlexConnectATVLogLevel=1&PlexConnectLog=loadItem%3A%20Library HTTP/1.1" 200 289 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
trailers.apple.com:80 192.168.1.45 - - [10/Nov/2013:18:27:27 -0500] "GET /PMS(%2F%2Flocal)/library/sections&PlexConnectUDID=C0HL4BWAFF54 HTTP/1.1" 404 542 "-" "iTunes-AppleTV/5.3 (3; 8GB; dt:12)"
trailers.apple.com:80 127.0.0.1 - - [10/Nov/2013:18:27:37 -0500] "GET /announce?info_hash=%00%1c%8d%cd%a9%e8%d1%81V%cb%ab%ac%c3D%02%a5%80%95%ef%ad&peer_id=-DE1360-0j._TDRhAIOA&port=60167&uploaded=0&downloaded=0&left=0&corrupt=0&redundant=0&compact=1&numwant=200&key=f7b8085c&no_peer_id=1&supportcrypto=1&event=started HTTP/1.0" 403 396 "-" "Deluge 1.3.6"

PlexConnect.log

http://pastebin.com/FnuJTDfr

apache2 ports.conf:

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
NameVirtualHost *:80
Listen 80
 

    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to 
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
    NameVirtualHost *:443
    Listen 443

 

    NameVirtualHost *:443
    Listen 443

apache2 000-default.conf

  ServerName trailers.apple.com
  ServerAlias atv.plexconnect
  ProxyRequests Off
  SSLEngine off
  ProxyPreserveHost On

Order allow,deny
Allow from all

  ProxyPass / http://192.168.1.10:81/
  ProxyPassReverse / http://192.168.1.10:81/

apache2 000-default-ssl:

    ServerName trailers.apple.com
    ServerAlias atv.plexconnect
    ProxyRequests Off
    SSLEngine On
    SSLProtocol all -SSLv2
    SSLProxyEngine On
    SSLCertificateFile /usr/local/lib/plexconnect/assets/certificates/trailers.cer
    SSLCertificateKeyFile /usr/local/lib/plexconnect/assets/certificates/trailers.key
    ProxyPreserveHost On

Order allow,deny
Allow from all

    ProxyPass / https://192.168.1.10:4501/
    ProxyPassReverse / https://192.168.1.10:4501/

Plexconnect Settings.cfg:

[PlexConnect]
port_pms = 32400
port_webserver = 81
ip_plexconnect = 0.0.0.0
certfile = /usr/local/lib/plexconnect/assets/certificates/trailers.pem
ip_dnsmaster = 192.168.1.1
ip_pms = 192.168.178.10
loglevel = High
enable_dnsserver = False
logpath = .
enable_plexgdm = True
port_dnsserver = 53
enable_webserver_ssl = True
ip_webserver = 0.0.0.0
prevent_atv_update = True
port_ssl = 4501
enable_plexconnect_autodetect = True

Hi iLNESS,

did you found a way to get vhost working in apache?

Or does anybody else will post the working config?

Cheers Robert

I used the Ubuntu script in Post #48, and I got it set up right. When I start the service, all is well. However, when I try and run:

sudo update-rc.d plexconnect defaults

This is what I see:

insserv: script plexconnect is not an executable regular file, skipped!
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'plexmediaserver' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `plexmediaserver'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `plexmediaserver'

What am I doing wrong? I hate being this close and yet so far. I don't mind starting the service once in a while, but I need to make it as user friendly as possible for my wife! Thanks for this thread and all the help thus far!

Let me put it this way, I am not good with Ubuntu, so if it is going to be easier to give me a step by step after PMS is installed, I would prefer that! Thanks!

sudo chmod +x thefile(s)

for example:

sudo chmod +x PlexConnect.py

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.