Another Server 2012 R2 IIS/Local DNS guide

I finally got Plex Connect working on my server 2012 R2 setup. Server 2012 R2 is running the Essentials role, meaning AD, DNS, and IIS. Unfortunately, this means Plex Connect doesn't work out of the box, as all three ports it needs (53, 80, and 443) are in use. I combined these two guides, plus some other stuff I found online and got this working. Here goes!

 

First, we'll solve the DNS problem. In my setup, I'm not using the Windows DNS Server for my network, so I don't mind messing with it a little. If you're using Windows DNS, just know that this will render inoperable whatever site you choose to hijack.

 

1. Open DNS manager in Windows:

 

 

2. Right click on the server and hit New Zone. You want a Primary, Forward Lookup Zone. The name of the zone should be the domain name you're trying to hijack. For example: trailers.apple.com.

 

3. Open your new Zone, right click and create a new A record. Leave the name blank and set the IP address to your server's IP address.

 

 

All done! Just point your Apple TV to this DNS server, and you've got the DNS hijacking working. Make sure your forwarders are set up correctly or you won't get any name resolution. But you've got a DNS server running, you already know that, right. ;-)

Just disable Plex Connect's DNS server in the Settings.cfg file (set enable_dnsserver = False) and you're good to go.

 

Next, we'll set up IIS. But in order to do so, we need a certificate.

 

1. Follow the cert creation guide here to create a certificate for your hijacked site (trailers.apple.com). After running the commands, run these. This will generate a pfx file needed for IIS:

copy c:	railers.pem c:	railers.crt
C:\OpenSSL-Win32\bin\openssl.exe pkcs12 -export -out C:	railers.pfx -inkey C:	railers.key -in C:	railers.crt

2. Open up mmc.exe and add the Certificate snap-in for the Local computer.

Import the pfx into the Personal Store and the crt into the trusted root store.

 

 

 

3. Run PlexConnect to generate the Settings.cfg. Set the following settings:

Run plexconnect for the first time to generate the settings.cfg file. Then make the following edits: (from here)

  • enable_dnsserver = False
  • hosttointercept = secure.marketwatch.com (or whatever you want)
  • port_webserver = 8090
  • port_ssl = 8091

 

4. Open up IIS Manager, click on your server, and hit the "Get New Web Platform Components" button. You might have to install the Web Platform Installer from Microsoft.

 

 

5. Search for "Application Request Routing" and install the newest version (v.3). Restart IIS Manager.

 

 

6. Now go create a new website in IIS by right clicking on the "Sites" folder and hitting "Add Website." Name it whatever, set the physical path to the PlexConnect folder (not actually super important, but might as well), and set the binding to http, with the Host name of whatever site you're hijacking. trailers.apple.com, in most cases.

 

 

7. Next, you need to add the https binding. Right click on the site and hit Edit Bindings. Change the type to https, set the hostname to the hijacked URL, tick the Require Server Name Indication (Important!), and select the SSL certificate you generated earlier and hit OK.

 

 

8. Click on the site and open the URL rewrite section. Hit Add Rule(s) in the top left corner.

 

 

Add a Reverse Proxy rule. Put in the IP address of your server, along with the port number you chose earlier (8090, if you're following this guide). Make sure Enable SSL Offloading is checked.

 

 

9. Click on "View Server Variables" on the right of the URL Rewrite window. Hit Add in the top right and add the following variable:

HTTP_PRX_HOST

10. Follow the AppleTV part of the guide here.

 

You should be done! Congrats!

 

 

 

This is definitely my first guide, and there's likely a few problems. Let me know if you run into any and I'll try and fix things up.

 

Edit: GAH! I just spent a few hours on this, getting screenshots all ready. Turns out this form doesn't accept base64 encoded pngs. Looks like it doesn't. If ya'll need screenshots, I'll go get some. But for now, I'm tired and I don't want to redo them.

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