PlexConnect Configuration using Mavericks Server

Hi all

 

I have now spent a fair amount of time trying to get PlexConnect working on Mavericks Server using Server.app. I now managed to get a working configuration although it still was somehow a little fishy sometimes (maybe I missed something). Since I couldn't find one complete Mavericks Server setup manual and because I had to search everything together I thought I post my setup procedure in order to make it easier for everyone following my footsteps :-). At this point thanks for all the setup instructions contributors :-)! Please feel free to test and correct my instructions since I myself still think that there might still something be slightly weird. Here we go.

 

 

Server Configuration
 
1. Getting your stuff
Download a fresh copy of PlexConnect using "git clone https://github.com/iBaa/PlexConnect.git" or by downloading on the PlexConnect git website (you'll find that yourself).
 
 
2. Create the certificate
Open a terminal window (Terminal.app on Mac) and run the following command
 
openssl req -new -nodes -newkey rsa:2048 -out ~/Desktop/trailers.pem -keyout ~/Desktop/trailers.key -x509 -days 7300 -subj "/C=US/CN=trailers.apple.com"
 
This will create two files on your desktop: trailers.key and trailers.pem. Next run this:
 
openssl x509 -in ~/Desktop/trailers.pem -outform der -out ~/Desktop/trailers.cer && cat ~/Desktop/trailers.key >> ~/Desktop/trailers.pem
 
the following files should now be on your desktop: trailers.pem, trailers.key, and trailers.cer.
 
 
3. Add the certificate files to PlexConnect
Place the trailers.pem, trailers.cer and trailers.key files into the following folder:
/assets/certificates/
 
 
4. Initialization
Run the PlexConnect.py script once in the terminal to create the settings.cfg file. Then hit CTRL+enter to end the script
 
 
5. Edit the settings.cfg file
set ip_pms to the ip of your PlexMediaServer
set ip_dnsmaster to the ip of your DNS-server (in my case these two are the same)
set enable_dnsserver to "false" (without the quotes)
set port_webserver to "9999" (without the quotes)
set the certifle to the path of you trailers.pem file (it is important to use an absolute path since this will result in the least problems afterwards e.g. /Applications/PlexConnect/assets/certificates/trailers.pem)
 
 
6. Fire it up
That's it with the plexconnect script. Fire it up using "sudo python ./PlexConnect.py" and make sure everything works as it's supposed to.
You should get the message "WebServer : WebServer: Serving HTTP on YOUR_IP_ADDRESS port 9999."
 
 
7. DNS server setup
Now it's time to fix our DNS-server using Server Admin. Open DNS server settings and make sure "Show All Records" is unchecked in the gear menu.
Add a Primary DNS Zone "trailers.apple.com". Point it to your PlexConnect server IP.
 
 
8. Webserver setup
Open Server Admin, go to the web section. Click the plus icon and create a new site with domain name "trailers.apple.com" on port 80. Created a folder named trailers to use as document root. Click done!
 
 
9. Hacking the webserver setup
Open up the file called "0000_any_80_trailers.apple.com.conf" by running the following command in terminal (or by using any other editor of your choice)
sudo pico /Library/Server/Web/Config/apache2/sites/0000_any_80_trailers.apple.com.conf
 
add the following lines of code at the bottom of the file  (3rd last line) between the and tags.
 
RequestHeader set User-Agent AppleTV
ProxyRequests off
AllowEncodedSlashes NoDecode
ProxyPass / http://trailers.apple.com:9999/ nocanon
ProxyPassReverse / http://trailers.apple.com:9999/
 
 
10. Reboot webserver
Go back to the server app and make sure to reboot your web server. (Turn off and then on again)
 
 
11. Reboot DNS server
Restart DNS Server in server app (Turn off and then on again)
 
 
12. Flush DNS cache
Run "dscacheutil -flushcache" in Terminal
 
 
13. Set your servers DNS server
In your servers system preferences, navigate to the settings of your network connection and set the DNS server setting to this servers IP address.
 
 
 
AppleTV Configuration
 
1. Go to the Apple TV Settings.
2. Select ‘General‘ then scroll the cursor down to highlight ‘Send Data To Apple‘.
3. Set ‘Send data to apple‘ to ‘No‘.
4. This time press ‘Play‘ (not the normal ‘Select‘ button) and you will be prompted to add a profile. 
5. Enter the URL for the .cer file: 
http://your-Plex-Server-IP-address/trailers.cer
 [.../trailers.der for Windows] (don’t forget to add http:// and use your PlexConnect IP address). Click on ‘Submit‘.
6. Set the DNS server in the AppleTV network configuration to the IP address of your PlexConnect server.
 
 
Pray and try to access Plex using the Trailers app :-)

Your steps about ATV.plexconnect are no longer needed, this domain name was removed recently.

Your steps about ATV.plexconnect are no longer needed, this domain name was removed recently.

Thanks for the hint... I was not sure about that step. I updated post #1 accordingly.

It would be nice, if you could add the alternative with the "Apple Configuration Tool". That was the way I got Plex to run on the AppleTV. By the way, did Apple chance something lately? I disabled a few services and at the same time I couldn't reach the AppleTV any more. I had to enter the last to lines (the PlexProxy) from the "0000_any_80_trailers.apple.com.conf". They were gone. Could be an coincidence but I'm not sure.

And I couldn't enter the URL for the Cert-File....It always told me, that the URL is wrong (something like that).

Anyway, thanks for the Tutorial. Great stuff!!!

It would be nice, if you could add the alternative with the "Apple Configuration Tool". That was the way I got Plex to run on the AppleTV. By the way, did Apple chance something lately? I disabled a few services and at the same time I couldn't reach the AppleTV any more. I had to enter the last to lines (the PlexProxy) from the "0000_any_80_trailers.apple.com.conf". They were gone. Could be an coincidence but I'm not sure.

And I couldn't enter the URL for the Cert-File....It always told me, that the URL is wrong (something like that).

Anyway, thanks for the Tutorial. Great stuff!!!

I personally think that configuring the device without USB connection is much more elegant. Just using the already built in functions and not using any other configuration utility seems more straight forward to me and it works like a charm. I also had it once that my trailers.apple.com.conf file was overwritten. I couldn't reproduce it yet.

Hi guys

So it seems that I myself need some more help. As suggested I removed the host atv.plexconnect from Server Admin in the sections (DNS and Websites) and restarted everything. Now if i open trailers.apple.com on my PlexConnect server (which is using it's own DNS server) I get the "Welcome to OS X Server" default website despite the fact that I edited the trailers.apple.com.conf file as described above. When it worked, I was displayed an error message saying some things about the certificates and "not served for my client". I think that my DNS / Apache are not forwarding requests from trailers.apple.com:80 to trailers.apple.com:9999 (PlexConnect is listening on port 9999). Do you guys have any suggestions on how I could debug this?

Thanks a lot for your help!

Christoph

I followed you guide , got the .cer file to atv and changed the dns , but now there is no internet or icons on the atv???

can you help me..

I followed you guide , got the .cer file to atv and changed the dns , but now there is no internet or icons on the atv???
can you help me..


Please read the pinned thread "Read before posting" and post all the relevant information. Without it it's hard to know where to start

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