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
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 :-)