Hi,
I'm trying to set up my raspberry pi as Plex Server. At the current step I experience problems in getting my AppleTV3 to recognize my Plex Server via "Trailers". Probably due a collision of Nginx and PlexConnect as described by some of you above. Here are the symptoms:
- My Plex Server is running. I can access the web interface via my web browser.
- My ATV3 has internet connection and can access the apple movie, series & other databases.
- However when I navigate to "Trailers" ATV3 complains that Trailers can't be accessed!
- Nginx is running by default on the installation and using port 80 and 443.
Two further notes:
- My old Plex Server is running on my windows pc and Apple TV can communicate without problems.
- As long as I use the windows PC as DNS server for ATV3 with PlexConnect running on the windows PC, my ATV recognizes both libraries in "Trailers": The old Windows PC based library and the new raspberry library.
Here is what I did until now:
- Setup my raspberry using one of the images provided by HTPC Guides. This is a minimal Debian installation already including the plex media server installed as well as nginx. But by default no PlexConnect is installed.
- Install PlexConnect and tried to get the connection running and tried to follow the hints mentioned above.
- I created the certificates and the corresponding ATV3 profile.
Below are copies of my files (my raspberry within the network is 192.168.2.110).
/etc/nginx/sites-available/plexconnect
upstream plexconnect {
server 192.168.2.110:8080;
}
server {
listen [::]:80;
server_name trailers.apple.com;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://plexconnect;
}
}
server {
listen [::]:443;
server_name trailers.apple.com;
ssl_certificate /opt/PlexConnect/assets/certificates/trailers.pem;
ssl_certificate_key /opt/PlexConnect/assets/certificates/trailers.key;
ssl on;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://plexconnect;
}
}
/etc/nginx/sites-available/trailers.apple.com
server {
listen 80;
server_name 192.168.2.110;
root /var/www/trailers.apple.com/public_html;
index index.html index.htm;
}
/opt/PlexConnect/Settings.cfg
[PlexConnect]
enable_plexgdm = False
ip_pms = 192.168.2.110
port_pms = 32400
enable_dnsserver = True
port_dnsserver = 53
ip_dnsmaster = 192.168.2.1
prevent_atv_update = True
enable_plexconnect_autodetect = True
ip_plexconnect = 0.0.0.0
hosttointercept = trailers.apple.com
port_webserver = 8080
enable_webserver_ssl = False
port_ssl = 443
certfile = ./assets/certificates/trailers.pem
allow_gzip_atv = False
allow_gzip_pmslocal = False
allow_gzip_pmsremote = True
loglevel = Normal
logpath = .
/opt/PlexConnect/Settings.py
# load/save config
def loadSettings(self):
dprint(__name__, 1, "load settings")
self.cfg.read(self.getSettingsFile())
def saveSettings(self):
dprint(__name__, 1, "save settings")
f = open(self.getSettingsFile(), 'wb')
self.cfg.write(f)
f.close()
def getSettingsFile(self):
return sys.path[0] + sep + "Settings.cfg"
def checkSection(self):
modify = False
# check for existing section
if not self.cfg.has_section(self.section):
modify = True
self.cfg.add_section(self.section)
dprint(__name__, 0, "add section {0}", self.section)
for (opt, (dflt, vldt)) in g_settings:
setting = self.cfg.get(self.section, opt)
if setting=='\0':
# check settings - add if new
modify = True
self.cfg.set(self.section, opt, dflt)
dprint(__name__, 0, "add setting {0}={1}", opt, dflt)
elif not re.search('\A'+vldt+'\Z', setting):
# check settings - default if unknown
modify = True
self.cfg.set(self.section, opt, dflt)
dprint(__name__, 0, "bad setting {0}={1} - set default {2}", opt, setting, dflt)
# save if changed
if modify:
self.saveSettings()
# access/modify PlexConnect settings
def getSetting(self, option):
dprint(__name__, 1, "getsetting {0}={1}", option, self.cfg.get(self.section, option))
return self.cfg.get(self.section, option)
if name==“main”:
Settings = CSettings()
option = 'enable_plexgdm'
print Settings.getSetting(option)
option = 'enable_dnsserver'
print Settings.getSetting(option)
del Settings
(END)
And a copy of the used ports:
Plex 2267 plex 54u IPv4 8597 0t0 TCP *:32400 (LISTEN)
Plex 2267 plex 55u IPv4 8598 0t0 TCP *:32401 (LISTEN)
Plex 2267 plex 65u IPv4 8678 0t0 UDP *:32414
Plex 2267 plex 71u IPv4 9374 0t0 UDP *:32410
Plex 2267 plex 72u IPv4 8680 0t0 UDP *:32413
Plex 2267 plex 74u IPv4 8681 0t0 UDP localhost:55759
Plex 2267 plex 75u IPv4 8682 0t0 UDP 192.168.2.110:59392
Plex 2267 plex 76u IPv4 8683 0t0 UDP localhost:54731
Plex 2267 plex 77u IPv4 8684 0t0 UDP 192.168.2.110:46900
Plex 2528 plex 12u IPv4 8689 0t0 UDP *:1900
Plex 2528 plex 15u IPv4 8692 0t0 TCP *:1664 (LISTEN)
Plex 2528 plex 18u IPv4 8696 0t0 UDP *:13169
Plex 2528 plex 21u IPv4 8699 0t0 TCP *:32469 (LISTEN)
Plex 2528 plex 24u IPv4 8702 0t0 UDP *:51866
Plex 2528 plex 27u IPv4 8705 0t0 UDP *:52843
Plex 2528 plex 67u IPv4 8679 0t0 TCP localhost:34420->localhost:54123 (CLOSE_WAIT)
nginx 2294 root 6u IPv4 9300 0t0 TCP *:80 (LISTEN)
nginx 2294 root 7u IPv6 9301 0t0 TCP *:80 (LISTEN)
nginx 2294 root 8u IPv4 9302 0t0 TCP *:443 (LISTEN)
nginx 2295 www-data 6u IPv4 9300 0t0 TCP *:80 (LISTEN)
nginx 2295 www-data 7u IPv6 9301 0t0 TCP *:80 (LISTEN)
nginx 2295 www-data 8u IPv4 9302 0t0 TCP *:443 (LISTEN)
nginx 2296 www-data 6u IPv4 9300 0t0 TCP *:80 (LISTEN)
nginx 2296 www-data 7u IPv6 9301 0t0 TCP *:80 (LISTEN)
nginx 2296 www-data 8u IPv4 9302 0t0 TCP *:443 (LISTEN)
nginx 2297 www-data 6u IPv4 9300 0t0 TCP *:80 (LISTEN)
nginx 2297 www-data 7u IPv6 9301 0t0 TCP *:80 (LISTEN)
nginx 2297 www-data 8u IPv4 9302 0t0 TCP *:443 (LISTEN)
nginx 2298 www-data 6u IPv4 9300 0t0 TCP *:80 (LISTEN)
nginx 2298 www-data 7u IPv6 9301 0t0 TCP *:80 (LISTEN)
nginx 2298 www-data 8u IPv4 9302 0t0 TCP *:443 (LISTEN)