Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
blog:plex_virtual_hosting [2014/07/28 03:07] – brett | blog:plex_virtual_hosting [2019/12/13 21:18] (current) – [My solution] brett | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== PLEX virtual | + | ====== PLEX virtual |
- | I had googled all around trying to find a solution to the problem of virtual | + | I had googled all around trying to find a solution to the problem of setting up a virtual |
+ | |||
+ | Instead of typing this into a browser | ||
+ | < | ||
+ | http:// | ||
+ | </ | ||
+ | I want to be able to enter this | ||
+ | < | ||
+ | http:// | ||
+ | </ | ||
This was pretty damn close: http:// | This was pretty damn close: http:// | ||
- | However it did not completely work and required a small adjustment | + | However it did not completely work and required a small adjustment |
===== My solution ===== | ===== My solution ===== | ||
- | Modify my DNS server to setup a CNAME for cheese this already hosts a webserver on port 80 and its where I also want to run PLEX. | + | Modify my DNS server to setup a CNAME for cheese this already hosts an apache |
< | < | ||
cheese | cheese | ||
Line 32: | Line 41: | ||
ProxyRequests off | ProxyRequests off | ||
ProxyPreserveHost On | ProxyPreserveHost On | ||
+ | ProxyPass / ws:// | ||
+ | ProxyPassReverse / ws:// | ||
+ | ProxyPass / wss:// | ||
+ | ProxyPassReverse / wss:// | ||
ProxyPass / http:// | ProxyPass / http:// | ||
ProxyPassReverse / http:// | ProxyPassReverse / http:// | ||
Line 44: | Line 57: | ||
We need to preserve the host cheese so its webserver is not affected so we place this host first, then we define how the plex hostname works. | We need to preserve the host cheese so its webserver is not affected so we place this host first, then we define how the plex hostname works. | ||
- | The only crucial piece of the puzzle | + | The crucial piece of the puzzle |
+ | The inclusion of the WebSocket proxying is also crucial for activity feedback. | ||
+ | |||
+ | As I was running CentOS 6.5 x64 which only has apache 2.2.15 I had to compile this module up myself by following the instructions here: http:// | ||
+ | |||
+ | For your convenience the precompiled module {{: | ||
+ | |||
+ | Edit apache configuration to support websockets | ||
+ | < | ||
+ | # vi / | ||
+ | LoadModule proxy_wstunnel_module modules/ | ||
+ | </ | ||
+ | |||
+ | ==== CentOS 7 ==== | ||
+ | * Disable SELINUX | ||
+ | * Punch hole in firewall (or disable easier). | ||
+ | * No need to install mod_proxy_wstunnel. | ||
===== How it was debugged ===== | ===== How it was debugged ===== | ||
- | I find it useful | + | I find it useful |
This additional QUERY_STRING conditional was figured out by enabling debug on the rewrite rules by putting this into the virtual host rewrite section. | This additional QUERY_STRING conditional was figured out by enabling debug on the rewrite rules by putting this into the virtual host rewrite section. | ||
< | < | ||
- | RewriteLog "/ | + | RewriteLog "/ |
RewriteLogLevel 3 | RewriteLogLevel 3 | ||
</ | </ | ||
Line 65: | Line 94: | ||
41z4& | 41z4& | ||
02] | 02] | ||
- | < | + | </code> |
Once you see that its a small step to know you need a conditional that won't redirect / when a query string is present. | Once you see that its a small step to know you need a conditional that won't redirect / when a query string is present. |