Difference between revisions of "Plex Media Server"

From Amahi Wiki
Jump to: navigation, search
 
(One intermediate revision by one other user not shown)
Line 76: Line 76:
 
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.
 
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.
  
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
+
  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
 
     1.2.3.4 plexms plexms.amahi.net
Line 148: Line 150:
  
 
Some users have reported that accessing the app by IP address resolves this issue.
 
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