Difference between revisions of "Plex Media Server"

From Amahi Wiki
Jump to: navigation, search
 
(29 intermediate revisions by 5 users not shown)
Line 2: Line 2:
 
image =Warning.png|
 
image =Warning.png|
 
heading =WARNING|
 
heading =WARNING|
message = The upgrade may not work with the current Amahi 7/8 app. 
+
message = Manually upgrading <b>may break the Amahi 7 or greater Plex Media Server app</b> or your HDA.
<br />
 
Manually upgrading <b>may break the Amahi 7/8 app</b> or your HDA.
 
  
 
<b>Amahi or Plex Inc. cannot provide support to help or correct any issues resulting from this upgrade if you chose to do it.</b>}}
 
<b>Amahi or Plex Inc. cannot provide support to help or correct any issues resulting from this upgrade if you chose to do it.</b>}}
 +
 +
= Recent "White Page" Issue =
 +
There is an issue in recent releases of the Plex Media Server app. If reaching the server yields a white page, please access it with this work-around link until (Plex fixes the issue): [http://hda:32400/web http://hda:32400/web].
  
 
= Source Install =
 
= Source Install =
 
<b>WARNING:</b>  This is a user contributed tutorial.  Proceed with this guide at your own risk.  If it breaks your HDA or you need assistance, Amahi cannot provide support.
 
<b>WARNING:</b>  This is a user contributed tutorial.  Proceed with this guide at your own risk.  If it breaks your HDA or you need assistance, Amahi cannot provide support.
  
This is a quick guide on how to install manually the PlexMediaServer (not the Amahi web app) on Amahi 7/9 (Fedora 19/21).  Find out the latest version by checking [https://plex.tv/downloads https://plex.tv/downloads] and copy the link under the Fedora icon.
+
This is a quick guide on how to install manually the PlexMediaServer (not the Amahi web app) on Amahi 7 or greater (Fedora).  Find out the latest version by checking '''<nowiki>https://plex.tv/downloads</nowiki>''' and copy the link under the Fedora icon. Note that PlexPass users occassionally have access to preview versions of Plex that may contain additional functionality not yet released to other users.  Use the toggle to download the preview release if you have a PlexPass.
 +
 
 +
* Install the current Plex server version from the link above, where x.x.x.x-xxxxxxx is the current version (1.2.2.2857-d34b464 at October 2017)
 +
 
  
* Install the Plex server
 
 
:<u>64-bit</u>
 
:<u>64-bit</u>
<pre>wget <nowiki>https://downloads.plex.tv/plex-media-server/0.9.12.4.1192-9a47d21/plexmediaserver-0.9.12.4.1192-9a47d21.x86_64.rpm</nowiki>
+
<pre>wget <nowiki>https://downloads.plex.tv/plex-media-server/x.x.x.x-xxxxxxx/plexmediaserver-x.x.x.x-xxxxxxx.x86_64.rpm</nowiki></pre>
sudo yum localinstall plexmediaserver-0.9.12.4.1192-9a47d21.x86_64.rpm</pre>
+
 
:<u>32-bit</u>
+
:''Fedora 19 or older''
<pre>wget <nowiki>https://downloads.plex.tv/plex-media-server/0.9.12.4.1192-9a47d21/plexmediaserver-0.9.12.4.1192-9a47d21.i386.rpm</nowiki>
+
sudo yum localinstall plexmediaserver-x.x.x.x-xxxxxxx.x86_64.rpm
sudo yum localinstall plexmediaserver-0.9.12.4.1192-9a47d21.i386.rpm</pre>
+
 
 +
:''Fedora 21 or newer''
 +
sudo dnf -y install plexmediaserver-x.x.x.x-xxxxxxx.x86_64.rpm
 +
 
 +
:<u>32-bit (Amahi 7 or older '''ONLY''')</u>
 +
<pre>wget <nowiki>https://downloads.plex.tv/plex-media-server/x.x.x.x-xxxxxxx/plexmediaserver-x.x.x.x-xxxxxxx.i386.rpm</nowiki>
 +
sudo yum localinstall plexmediaserver-x.x.x.x-xxxxxxx.i386.rpm</pre>
  
 
* Start the service:  Next up we actually have to start Plex, the following command will do just that as well as create a symlink to always start Plex at boot.
 
* Start the service:  Next up we actually have to start Plex, the following command will do just that as well as create a symlink to always start Plex at boot.
Line 39: Line 48:
 
:<b>NOTE:</b>  Don't forget if you are using Greyhole, that in this case you have always to use your files "inside" from the [[Mount_Shares_Locally|mounted local files]]
 
:<b>NOTE:</b>  Don't forget if you are using Greyhole, that in this case you have always to use your files "inside" from the [[Mount_Shares_Locally|mounted local files]]
  
* Either by auto update (done so around midnight), or if you ask manually for updating the system, amahi will replace the original PlexMediaServer package with it's own amahi-plex (webapp). In order to prevent that you have to exclude the auto-update in the amahi-repo.  Edit /etc/yum.conf (as root) and add the following at the bottom:
+
* Either by auto update (done so around midnight), or if you ask manually for updating the system, Amahi will replace the original Plex Media Server package with it's own amahi-plex (webapp). In order to prevent that you have to exclude the auto-update in the Amahi repo.  Edit (as root) ''/etc/yum/yum.conf'' (Amahi 8 older) or ''/etc/dnf/dnf.conf'' (Amahi 9 or newer) and add the following at the bottom:
 
  exclude=amahi-plex
 
  exclude=amahi-plex
  
Line 47: Line 56:
 
If you want to enable this feature you should [[Mount_Shares_Locally|mount your shares locally]] on your HDA and point [http://www.amahi.org/apps/plex-media-server Plex Media Server] to these mount points instead. Otherwise deletes could cause orphan files in the storage pool since only the symlink would actually be deleted and not the actual file.
 
If you want to enable this feature you should [[Mount_Shares_Locally|mount your shares locally]] on your HDA and point [http://www.amahi.org/apps/plex-media-server Plex Media Server] to these mount points instead. Otherwise deletes could cause orphan files in the storage pool since only the symlink would actually be deleted and not the actual file.
  
= Locally Mounted Shares (Ubuntu & Fedora) =
+
= Locally Mounted Shares (Ubuntu ONLY) =
 
If you access your media files using [https://wiki.amahi.org/index.php/Mount_Shares_Locally locally mounted shares] (eg if you are a [https://wiki.amahi.org/index.php/Greyhole Greyhole] user as suggested above), you will need to change the permissions of your plex server user.  The Plex Media Server is run by a special user <i>plex</i> who doesnt have access to the local shares by default.
 
If you access your media files using [https://wiki.amahi.org/index.php/Mount_Shares_Locally locally mounted shares] (eg if you are a [https://wiki.amahi.org/index.php/Greyhole Greyhole] user as suggested above), you will need to change the permissions of your plex server user.  The Plex Media Server is run by a special user <i>plex</i> who doesnt have access to the local shares by default.
  
for <b>Ubuntu</b>
 
 
To fix, open terminal as root user and type:
 
To fix, open terminal as root user and type:
 
  sudo usermod -a -G users plex
 
  sudo usermod -a -G users plex
 
for <b>Fedora</b>
 
To fix, open terminal as root user and type:
 
sudo gpasswd -a plex users
 
  
 
You may need to restart Plex.  Now when you want to add directories using the web interface all your shares should be accessible.
 
You may need to restart Plex.  Now when you want to add directories using the web interface all your shares should be accessible.
Line 64: Line 68:
 
* If you have installed manually by source the PlexMediaServer, it now has the ability to update itself through the settings' webpage
 
* If you have installed manually by source the PlexMediaServer, it now has the ability to update itself through the settings' webpage
  
* If you are using amahi-plex it will auto update itself as soos as the developers push the new version into amahi's repo. Don't try to update the amahi-plex web app although in the setting's webpage it will inform you that a new version of PlexServer is available. Most probably it will fail or it will brake down your system !!!
+
* If you are using amahi-plex it will auto update itself as so as the developers push the new version into Amahi's repo. Don't try to update the amahi-plex web app although in the setting's webpage it will inform you that a new version of Plex Media Server is available. Most likely it will fail or it will break your system!
  
 
= Troubleshooting =
 
= Troubleshooting =
  
== PMS not showing data if logging in from the main page ==
+
== Request cannot be recognized -- treating a request as not-local ==
 +
 
 +
When the web app (http://plexms) is working but the server cannot be seen ... it could be due to some DNS issues. You can see the logs indicating that the requests arrive but the name (hda or plexms) is for some reason not recongnized as a local request, so it's labelled as a non-local request.
 +
 
 +
  Request came in with unrecognized domain / IP 'plexms' in header Host; treating as non-local
 +
 
 +
To make it recognize requests as local, you can add your HDA's IP address mapping plexms to your HDA's IP and also plexms with full domain in /etc/hosts, for example (assuming 1.2.3.4 is your HDA IP):
 +
 
 +
    1.2.3.4 plexms plexms.amahi.net
 +
 
 +
Then restart httpd as root or sudo with: <code>systemctl reload httpd</code>
 +
 
 +
You can see the logs (in both 32 and 64 bit machines) on the Linux side at this location:
 +
 
 +
  /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/
 +
 
 +
under these files
 +
 
 +
  Plex Media Server.log
 +
  Plex Media Service.log
 +
 
 +
== Server Setup v Player Login ==
 +
After install the Plex server still needs to be configured and logged into a [http://www.plex.tv Plex.tv] account. Before the Plex server has been named properly, going to [//plexms.amahi.net //PlexMS.Amahi.Net] from your LAN will bring you to a Plex.tv login then redirect you to a player-only page. To get around this, visit your [HDA's static IP]:32400/web/
 +
    example:<br /> 192.168.0.1:32400/web/ <br />
 +
This should bring you to the same log in page, but redirect you to the server setup.
 +
 
 +
The default server name is LocalHostLocalDomain, change this to PlexMS. Now the address [//plexms.amahi.net //PlexMS.Amahi.Net] should bring you to the server page (with player too).
 +
 
 +
Also, visiting your Dynamic DNS name followed by port 32400 (example.yourhda.com:32400) will bring you to a player from anywhere on the internet. Port forwarding is required at your router's firewall.
 +
 
 +
== Data not shown with Main page login ==
  
 
We noticed that when logging in to <nowiki>http://plexms/</nowiki> plex does not seem to list any data from the plex server, allow you to set up libraries, or allow logins going through this front-door. It does not seem to "be able to connect to this server" on the left side. However, going through <nowiki>http://hda:32400/web/index.html</nowiki> it all works well.
 
We noticed that when logging in to <nowiki>http://plexms/</nowiki> plex does not seem to list any data from the plex server, allow you to set up libraries, or allow logins going through this front-door. It does not seem to "be able to connect to this server" on the left side. However, going through <nowiki>http://hda:32400/web/index.html</nowiki> it all works well.
Line 87: Line 121:
 
Start by finding your ####-plexms.conf file in /etc/httpd/conf.d/ Open this file up in a text editor like vi or nano and remove (or comment out) the following two lines:  
 
Start by finding your ####-plexms.conf file in /etc/httpd/conf.d/ Open this file up in a text editor like vi or nano and remove (or comment out) the following two lines:  
  
  ProxyPass / <nowiki>http://hda:32400/manage/</nowiki>
+
  ProxyPass / <nowiki>http://hda:32400/web/</nowiki>
  ProxyPassReverse / <nowiki>http://hda:32400/manage/</nowiki>
+
  ProxyPassReverse / <nowiki>http://hda:32400/web/</nowiki>
  
 
<u>Option 1</u><br />
 
<u>Option 1</u><br />
Line 94: Line 128:
 
  RewriteEngine On
 
  RewriteEngine On
 
  RewriteCond %{SERVER_PORT} 80
 
  RewriteCond %{SERVER_PORT} 80
  RewriteRule (.*) <nowiki>http://%{HTTP_HOST}:32400/manage/</nowiki> [R,L]
+
  RewriteRule (.*) <nowiki>http://%{HTTP_HOST}:32400/web/</nowiki> [R,L]
  
 
:After completing the changes, restart httpd
 
:After completing the changes, restart httpd
Line 103: Line 137:
  
 
  <html>
 
  <html>
  <head><meta http-equiv="refresh" content="0; url=<nowiki>http://hda:32400/manage/</nowiki>" />
+
  <head><meta http-equiv="refresh" content="0; url=<nowiki>http://hda:32400/web/</nowiki>" />
 
  </head>
 
  </head>
 
  <body></body></hmtl>
 
  <body></body></hmtl>
Line 111: Line 145:
  
 
The Plex Media server page should now load when you click on the icon or link in the dashboard.
 
The Plex Media server page should now load when you click on the icon or link in the dashboard.
 +
 +
== Looking For Servers ==
 +
Can logon to the app, but displays "Looking for Servers" is the top left corner of screen.
 +
 +
Some users have reported that accessing the app by IP address resolves this issue.
 +
 +
:Example:
 +
<pre>http://x.x.x.x:32400/web</pre>
 +
 +
  
 
[[Category:apps]]
 
[[Category:apps]]

Latest revision as of 14:23, 10 November 2018

Warning.png WARNING
Manually upgrading may break the Amahi 7 or greater Plex Media Server app or your HDA.

Amahi or Plex Inc. cannot provide support to help or correct any issues resulting from this upgrade if you chose to do it.



Recent "White Page" Issue

There is an issue in recent releases of the Plex Media Server app. If reaching the server yields a white page, please access it with this work-around link until (Plex fixes the issue): http://hda:32400/web.

Source Install

WARNING: This is a user contributed tutorial. Proceed with this guide at your own risk. If it breaks your HDA or you need assistance, Amahi cannot provide support.

This is a quick guide on how to install manually the PlexMediaServer (not the Amahi web app) on Amahi 7 or greater (Fedora). Find out the latest version by checking https://plex.tv/downloads and copy the link under the Fedora icon. Note that PlexPass users occassionally have access to preview versions of Plex that may contain additional functionality not yet released to other users. Use the toggle to download the preview release if you have a PlexPass.

  • Install the current Plex server version from the link above, where x.x.x.x-xxxxxxx is the current version (1.2.2.2857-d34b464 at October 2017)


64-bit
wget https://downloads.plex.tv/plex-media-server/x.x.x.x-xxxxxxx/plexmediaserver-x.x.x.x-xxxxxxx.x86_64.rpm
Fedora 19 or older
sudo yum localinstall plexmediaserver-x.x.x.x-xxxxxxx.x86_64.rpm
Fedora 21 or newer
sudo dnf -y install plexmediaserver-x.x.x.x-xxxxxxx.x86_64.rpm
32-bit (Amahi 7 or older ONLY)
wget https://downloads.plex.tv/plex-media-server/x.x.x.x-xxxxxxx/plexmediaserver-x.x.x.x-xxxxxxx.i386.rpm
sudo yum localinstall plexmediaserver-x.x.x.x-xxxxxxx.i386.rpm
  • Start the service: Next up we actually have to start Plex, the following command will do just that as well as create a symlink to always start Plex at boot.
sudo systemctl enable plexmediaserver.service && systemctl start plexmediaserver
NOTE: If you get an error with the above command while connected to the server with SSH through a terminal, it seems you have to relogin as root.
  • Run at least once the PlexMediaServer (and do nothing, just run once), from any browser in your network enter
http://localhost:32400/web/index.html#!/dashboard
  • Stop the PlexMediaServer (preferably log in with a terminal):
sudo systemctl stop plexmediaserver
  • File permissions and access: Our first big problem (although it’s not really) is to allow Plex to access any of our files. PMS runs as it’s own user (surprisingly a user called plex), not you by default. So we need to give that user access to your files. The easiest way to do this is to add the plex user to your users group. Type the following command in a terminal:
sudo gpasswd -a plex users
  • Restart the PlexMediaServer, wait 1-2 minutes and log in again to edit your libraries:
sudo systemctl start plexmediaserver
NOTE: Don't forget if you are using Greyhole, that in this case you have always to use your files "inside" from the mounted local files
  • Either by auto update (done so around midnight), or if you ask manually for updating the system, Amahi will replace the original Plex Media Server package with it's own amahi-plex (webapp). In order to prevent that you have to exclude the auto-update in the Amahi repo. Edit (as root) /etc/yum/yum.conf (Amahi 8 older) or /etc/dnf/dnf.conf (Amahi 9 or newer) and add the following at the bottom:
exclude=amahi-plex

Use with Greyhole

If you add a library section connected to a folder that is part of your drive pool and thus handled by Greyhole, you should NOT check the option to allow clients to delete media in the Plex Media Server preferences dialog.

If you want to enable this feature you should mount your shares locally on your HDA and point Plex Media Server to these mount points instead. Otherwise deletes could cause orphan files in the storage pool since only the symlink would actually be deleted and not the actual file.

Locally Mounted Shares (Ubuntu ONLY)

If you access your media files using locally mounted shares (eg if you are a Greyhole user as suggested above), you will need to change the permissions of your plex server user. The Plex Media Server is run by a special user plex who doesnt have access to the local shares by default.

To fix, open terminal as root user and type:

sudo usermod -a -G users plex

You may need to restart Plex. Now when you want to add directories using the web interface all your shares should be accessible.

Update Plex Media Server

  • If you have installed manually by source the PlexMediaServer, it now has the ability to update itself through the settings' webpage
  • If you are using amahi-plex it will auto update itself as so as the developers push the new version into Amahi's repo. Don't try to update the amahi-plex web app although in the setting's webpage it will inform you that a new version of Plex Media Server is available. Most likely it will fail or it will break your system!

Troubleshooting

Request cannot be recognized -- treating a request as not-local

When the web app (http://plexms) is working but the server cannot be seen ... it could be due to some DNS issues. You can see the logs indicating that the requests arrive but the name (hda or plexms) is for some reason not recongnized as a local request, so it's labelled as a non-local request.

  Request came in with unrecognized domain / IP 'plexms' in header Host; treating as non-local

To make it recognize requests as local, you can add your HDA's IP address mapping plexms to your HDA's IP and also plexms with full domain in /etc/hosts, for example (assuming 1.2.3.4 is your HDA IP):

   1.2.3.4 plexms plexms.amahi.net

Then restart httpd as root or sudo with: systemctl reload httpd

You can see the logs (in both 32 and 64 bit machines) on the Linux side at this location:

 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/

under these files

  Plex Media Server.log
  Plex Media Service.log

Server Setup v Player Login

After install the Plex server still needs to be configured and logged into a Plex.tv account. Before the Plex server has been named properly, going to //PlexMS.Amahi.Net from your LAN will bring you to a Plex.tv login then redirect you to a player-only page. To get around this, visit your [HDA's static IP]:32400/web/

    example:
192.168.0.1:32400/web/

This should bring you to the same log in page, but redirect you to the server setup.

The default server name is LocalHostLocalDomain, change this to PlexMS. Now the address //PlexMS.Amahi.Net should bring you to the server page (with player too).

Also, visiting your Dynamic DNS name followed by port 32400 (example.yourhda.com:32400) will bring you to a player from anywhere on the internet. Port forwarding is required at your router's firewall.

Data not shown with Main page login

We noticed that when logging in to http://plexms/ plex does not seem to list any data from the plex server, allow you to set up libraries, or allow logins going through this front-door. It does not seem to "be able to connect to this server" on the left side. However, going through http://hda:32400/web/index.html it all works well.

The work-around is this: going to

http://hda:32400/web/index.html#!/settings/server/

Then login to plex on this page and give it a friendly name there."My Amahi server" or similar should do.

After that, it should show up under http://plexms/.

Dashboard Link Workaround

If the launch icon and link for Plex Media Server in the dashboard does not properly load the server, you may need to try a workaround.

First, try just restarting httpd.This should hold for as long as your server is running.

systemctl restart httpd

If that does not work, or you are restarting your server often, this longer workaround also works. Start by finding your ####-plexms.conf file in /etc/httpd/conf.d/ Open this file up in a text editor like vi or nano and remove (or comment out) the following two lines:

ProxyPass / http://hda:32400/web/
ProxyPassReverse / http://hda:32400/web/

Option 1

Add the following three lines below the two you commented out above:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) http://%{HTTP_HOST}:32400/web/ [R,L]
After completing the changes, restart httpd
systemctl restart httpd

Option 2

Create a text file called "index.html" and save that file in /var/hda/web-apps/plexms/html The contents of the file is a simple redirect. It should read:
<html>
<head><meta http-equiv="refresh" content="0; url=http://hda:32400/web/" />
</head>
<body></body></hmtl>
Set the file ownership permissions:
chown apache:users index.html;

The Plex Media server page should now load when you click on the icon or link in the dashboard.

Looking For Servers

Can logon to the app, but displays "Looking for Servers" is the top left corner of screen.

Some users have reported that accessing the app by IP address resolves this issue.

Example:
http://x.x.x.x:32400/web