If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Plex Media Server on Minimal Centos 7.0

isomorphicisomorphic Posts: 12Members, Plex Pass Plex Pass
edited June 2015 in Linux

Hi All,

 
Well I decided to try something new after running Plex Media Server on my CentOS 6 successfully I thought I might try CentOS 7. I'm still testing this build, but it looks stable and so I thought I would share my current build steps on CentOS 7. 
 
The target audience for this guide are those that are new to a minimal build, specifically a build that is performed on the command line interface. I have tested these steps on CentOS 7.0 minimal installation media. I have tested these instructions purely in a VMWare instance, there are a few things I'm trying to get working before I install I build on bare metal.
 
This guide assumes that you are installing on a x86 64 bit architecture because, unlike CentOS 6, is only available in 64 bit. No Intel Atom installs with CentOS 7 :)
 
The scope will cover from downloading CentOS to basic application and server configuration to get Plex running and optionally connect to a Samba Share for media. Please feel free to suggest better solutions or steps - I'm no expert, but know a bit more than my first guide. 
 
[UPDATE: added section to setup the Plex server to connect to a NAS samba share for media]
 
Ok, enough talk, to the guide.
 
Obtain and Install Centos 7.x
 
First step is to download the Centos Minimal installation media. Go to https://www.centos.org/download/ and select the 'Minimal OS' button. This will load a page with links to your country mirrors and nearby mirrors. Click the desired link and get a coffee while the ISO downloads. Now burn a copy of the CD if you are installing via physical media if required, install on a USB key or leave the iso if you are going to install within a VM environment.
 
Boot up the PC using the Minimal CD or USB Key and perform the following steps: (this is verbose for completeness):
  1. (Optional) At the 'CentOS 7' Boot Menu select "Test thiss media and Install CentOS 7", yes it will take a couple of minutes, but it will save hours if the media is corrupt.
  2. At the Installation Language Menu select the appropriate system language and locale for the CentOS system and click 'Continue'
  3. At the 'Installation Summary' click on the 'Date and Time' section.
    • Click on the region and/or search for an appriopriate region and city.
    • I leave network time enabled that will automatically sync the date and time based on the region and city, or you can disable the network clock and set the date and time manually.
    • Click on the 'Done' button in the top left hand corner to close the 'Date and Time' window.
  4. Check that the 'Keyboard' and 'Language Support' have suitable choices and continue. Otherwise click on the sections and select the desired options.
  5. At the "Installation Summary" click on the 'Installation Destination' section - IMPORTANT: this installation assumes that you will be formatting and installing on the HDD completely using all available space. If this is not want you want then stop now, do not proceed unless you understand what you are doing. I will not be responsible for data loss.
    • Click on the target HDD that you wish to install CentOS onto. Make sure you know which drive you want to install to!
    • In the "Installation Destination" section you can accept the defaults; or
    • (optionally) You can encrypt the drive and/or manually partition the HDD
    • Finally, click the 'Done' button in the top left hand corner to accept the selected HDD and partitioning options
  6. Next select 'Network and Hostname'
    • Click on the Network Adapter (if not selected by default) and click on the 'Configure...' button in the bottom right hand corner of the screen
      • Click on the 'General' tab in the new window (just left of the 'Ethernet' tab)
        • IMPORTANT: Click on the 'Automatically connect to this Network when it is available', this we auto enable the network when the Server is rebooted
        • Leave the 'All users may connect to this network' - I don't know the effects of deselecting it  :rolleyes:
      • (optional but recommended) If you want a static IP address for the server, then click on the 'IPv4 Settings' tab (the one to right of the DCB tab), select 'Manual' from the Method drop down menu, click the 'Add' button and enter the required IP (i.e. 192.168.1.100), the netmask (usually 255.255.255.0) and the IP of your gateway/router (usually 192.168.1.1 or 192.168.1.254) and the DNS (again usually the IP of the router - you can use another PC and look at the network settings to get this information).
      • Once you have completed the Network configuration details, click the 'Save' button on the bottom right hand corner of the window to close the window and return back to the 'Network and Hostname' section.
    • Next, give the server a hostname, you can leave it as localhost.localdomain but I recommend changing it to something else to avoid a name conflict with other linux computers. I use pms.localdomain but you can call it whatever you want (this will not be the name of the plex server, just the name of the pc)
    • Finally click on the 'Done' button in the top left hand corner to close the 'Network and Hostname' window
  7. Finally at the 'Installation Summary' window, click the 'Begin Installation’ button to start the installation process and grab a coffee.
 
While installing there will be a 'Configuration' window to prompt you to set the 'Root Password' and 'User Creation'. We will only need to set the root password for the installation step. We will create a user manually later in the guide.
 
  1. Click on the 'Root Password' section.
    • In the 'Root Password' window, type in the desired password in both the 'Root Password' and 'Confirm' fields. 
    • Click the 'Done' button to confirm the password and to close the 'Root Password' window. (note if your password is 'weak' you will have to click the 'Done' button twice)
 
After the 'Root Password' has set and the installation have been completed you will be able to click on the 'Finish configuration' button to finalise the installation and configuration.
 
When the entire installation and configuration has completed you will simply need to click on the 'Reboot' button to reboot the server with CentOS.
 
Congradulations you have installed CentOS 7!
 
Configure Centos 7.x
 
In this section we will update the system, create and configure the ‘plex’ user that will be used to install and setup Plex Media Server and slightly secure the system. This will be done all within the Command Prompt… but don’t be scared.
 
To start we need to log in with the ‘root’ user after the PC has restarted. Use the login of ‘root’ without inverted comma’s and the password you gave root during the installation.
pms login: root
password: <root’s password>
Firstly we are best to update the system to get the latest Centos packages using the following command:
> yum update
Yum will automatically download and update any package that is currently installed. Yum will prompt you with a few questions, just reply with ‘y’ or ‘yes’ for all questions and you should be OK.
 
After we have updated all packages next we need to create a ‘plex’ user. This is the user that will install and generally run activities for the Plex Media Server. This will be a general user, but will be setup to run commands as the ‘root’ user if required.
 
To create the ‘plex’ user we use the following command:
> adduser -c "Plex Media Server User" -d /home/plex -s /bin/bash plex
This command will create a user ‘plex’ that has a home directory of ‘/home/plex/‘ and will be setup with the ‘bash’ shell. Don’t worry if that means nothing to you.
 
Next we have to give a password to the ‘plex’ user to activate (?) the user. We use the following command to prompt to set a password:
> passwd plex
You will be prompted to set a password and then prompted to confirm the password. This command is also used to change the password of a Linux user. Congratulations, you have created a new user from the command prompt.
 
Next we need to configure the ‘plex’ user to be allowed to run commands as ‘root’ using ‘sudo’. To do this we need to add ‘plex’ to the list of users that can use the ‘sudo’ command. use the following command to open the configuration file to do this:
> visudo
This will open the /etc/sudoers file in vi, an standard editor in Linux. Vi is not friendly to new users of linux. If you stumble with vi, you can use ’nano’ which is a more friendly editor. To use nano you will need first install with ‘yum install nano’. After yum has installed nano you can open the sudoers file with ‘nano /etc/sudoers’ command without inverted commas.
 
To add plex to the users you need to find the two lines in the sudoer’s file:
 
“## Allow root to run any commands anywhere
root ALL=(ALL) ALL”
 
then you need to add the following line after the line that mentions 'root':
 
“plex ALL=(ALL) ALL” so the 3 lines look like:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
plex ALL=(ALL)  ALL
 
Save the file. That is it, the ‘plex’ user will now be able to use the ‘sudo’ command and run commands as a superuser.
 
So lets confirm that the ‘plex’ user has been setup correctly. Logout using the following command:
> exit
This will return you to the login prompt, next enter ‘plex’ and the plex password to login in with the new user.
pms login: plex
password: <plex’s password>
If all is fine you will have a command prompt. Next we need to check that the ‘plex’ user can run the ‘sudo’ command. Try the following:
> sudo pwd
You will be prompted for a password… you need to use the ‘plex’ user’s password. You should get a response of ‘/home/plex’, the home directory of the plex user that was setup with the 'adducer' command. If you got an error then repeat the steps to update the /etc/sudoers file.
 
At this time you can use a SSH client to access you Plex Media Server, something like the Mac OS X ‘Terminal’ application or Putty on windows is fine. I usually perform the rest of the setup via SSH but you can perform all the steps on the Plex Server locally.
 
While using SSH to remotely access the Plex Server is helpful it is also recommended to block the ‘root’ user to use SSH remotely. To do this use the following command to open the SSH config file:
> sudo vi /etc/ssh/sshd_config
Again you can use ‘sudo nano /etc/ssh/sshd_config’ if you don’t like vi.
 
Search for the ‘# PermitRootLogin yes’, delete the hash (‘#’) character and change ‘yes’ to ‘no’. The result should be:
PermitRootLogin no
Save the file. After the next restart root will not be able to remotely login over SSH, but will be able to log in locally.
 
That is the ‘plex’ user set up!
 
 
Downloading and Installing Plex Media Server
 
Because we are using just the command prompt and Plex Media Service isn’t out of the box linked to a Plex Repository we can’t use the ‘yum’ command. There are ways we can use this but from the forums it appears that the latest version of Plex Media Server is not always available via this route. So we are going to use linux commands to get the latest version.
 
Before we can get the Plex, we need to install some applications to allow Centos to download the Plex Media Server package. Run the following command to install the wget application. Note: going forward it is assumed that you are logged in under the ‘plex’ user and is why you will see 'sudo' infront of commands.
> sudo yum install wget
This will install the wget application that can download files using a URL. We also need to get the latest URL for the current version of Plex to download.
 
I got the download URL by using another PC, going to the Plex downloads section and copying the Link to the current version. Now that we have the URL for the latest version it is time to download. I recommending creating a download’s folder in the ‘plex’ users home directory, but this is optional. To do this use the following commands to create and then open the download directory:
> mkdir ~/Downloads
> cd ~/Downloads
Next we want to download the Plex package using:
> wget <URL of the Plex Media Server RPM package>
i.e. (current as of 24th May): Important, please check the current URL, below is an example.
This will download the Plex package. 
 
After the download has completed it is time to install! As we have downloaded the package to our Plex Server we can use the ‘localinstall’ option in yum to install from the downloaded file.
 
To install plex from the download we use the following command:
> sudo yum localinstall <Plex Media Server RPM package>
Based on the filename from above this would be: (Again check the filename based on the current Plex package as of 24th May)
> sudo yum localinstall plexmediaserver-0.9.12.1.1079-b655370.x86_64.rpm
The installation will take a minute or two. That is it, Plex is installed…. but it is not running, and the Linux firewall will stop clients connecting - Doh! But first let’s check the install.
 
To start plex we need to start the service using the following command. We only have to do this once after we install, after we reboot the Plex Media Server should start automatically on your Plex Server.
> sudo systemctl start plexmediaserver.service
That should be it… Plex is running. But what about the firewall? At this time the firewall will block Plex ports.
 
We will disable the firewall for a moment to check that things are OK. In the final section we will configure the firewall to allow Plex to work as desired.
 
To disable the firewall temporarily use the following command:
> sudo systemctl stop firewalld.service
Caution: this will disable the firewall, after we have confirmed things are OK we will bring it back up.
 
Next is to check that we can use a Web Browser on another PC (or tablet, etc) to access Plex. For the purpose of this guide lets assume that the Plex Media Server has an IP of 192.168.1.100. Please change 192.168.1.100 with the IP of your Plex Server
 
Open a supported Web Browser and enter the following address, for example of the Plex Server having an IP of 192.168.1.100.
If all is OK then Plex should start. WooHoo. If not, well check the steps above to make sure you haven't missed anything. I would double check that you have disabled the firewall.
 
OK, lets reboot the server to ensure that Plex starts up automatically and that the firewall also turned back on. Use the following command to restart:
> sudo reboot
The command will immediately restart the server.
 
Once restarted, login with the ‘plex’ user. Now to configure the firewall.
 
 
Configuring the Firewall
 
The last step is to configure the firewall so the Server doesn’t block Plex traffic. I found this to be tricky, but this was my first attempt too :)
 
NOTE: This is my first attempt with firewalld configuration, I’m assuming that people will have other recommendations and I will gladly update the following to ensure the best configuration.
 
First step is to log into the server using the 'plex' user.
 
We want to stop the Plex Media Server whilst we config the firewall, use the following command to stop plex media server:
> sudo systemctl stop plexmediaserver.service
 
Next we want to switch user to root. You could just log into the server as root, unless you are trying to log in via ssh (which we disabled). The guide will use the switch user command to cater for both cases. This works over ssh as you have logged into the server using a non-root account.
 
To switch the user we use the 'su' command, specifically:
> su
Next you will need to enter the 'root' password NOT the plex user password that you can use with sudo. This is because you are effectively logging into the server as root, not trying to run a command as root.
 
Next we want to create a plexmediaserver set of firewall rules, this will open the ports required for the plexmediaserver service. Using vi (or nano) create a new file with a suffix of 'xml':
> vi /etc/firewalld/services/plexmediaserver.xml
Next we need to populate the file with the following lines:
 
<?xml version="1.0" encoding="utf-8"?>
<service version="1.0">
  <short>plexmediaserver</short>
  <description>Plex TV Media Server</description>
  <port port="1900" protocol="udp"/>
  <port port="5353" protocol="udp"/>
  <port port="32400" protocol="tcp"/>
  <port port="32410" protocol="udp"/>
  <port port="32412" protocol="udp"/>
  <port port="32413" protocol="udp"/>
  <port port="32414" protocol="udp"/>
  <port port="32469" protocol="tcp"/>
</service>
Save the file.
 
This configuration will allow the Plex ports 32400, 32410, 32412, 32414 open. By default port 22 should be open from the base Centos installation. 
 
Ok now we have to register the new service firewall rules with the firewall deamon. We do this using the firewall command tool. But first lets confirm that the firewall is up to accept commands, use (note we are still logged on as root, so we don't need sudo):
> systemctl start firewalld.service
OK, not the firewall is up, we can register the service specific rules using the following command:
> firewall-cmd --permanent --add-service=plexmediaserver
 
Next we need to do is register the server to the default public zone. To be honest I don't know all the details of zones :)  but I know I have to add the service to the zone to work. We do this with the following command:
> firewall-cmd --permanent --zone=public --add-service=plexmediaserver
OK the last step is to restart the firewall and start the plex media server service, use the following commands:
> systemctl restart firewalld.service
> systemctl start plexmediaserver.service
Again open a supported Web Browser on another PC and check you are able to connect to http://<IP address of Plex Server>:32400/web/ . If so - awesome. If it doesn't work, then stop the firewall and retry. If it works after disabling the firewall then go through the firewall steps again to confirm you didn't miss anything.
http://192.168.1.100:32400/web/

If that works then congratulations you have a up and running minimal Plex Media Server!

 
[Optional] Setup Plex Server to connect to media on a NAS server using Samba
 
A default minimal CentOS 7 build will not be able to mount SMB\CIFS shares. We’ll need to install a package onto the server that allows it to understand the SMB protocol.
 

1. First we need to Install the cifs-utils package from the default CentOS yum repository. This will install the applications and libraries required to support Samba/CIFS.

> sudo yum install cifs-utils
 
2. Next we have to open the firewall to allow connections to Samba shares:
> sudo firewall-cmd --permanent --zone=public --add-service=samba
> sudo firewall-cmd --reload
 
3. Next, we need an account on the CentOS server that will be dedicated for Samba Shares. We’ll create a service account named usr_smb_core with a user id (uid) of 5000.
> sudo useradd -u 5000 usr_smb_core
4. We also want a group on the CentOS server that will map to the share. This group will contain all of the Linux accounts that will need access to the share. Our account will be called share_smb_core and it will have a group id (gid) of 6000.
> sudo groupadd -g 6000 share_smb_core
 
5. Finally, add any Linux accounts that require access to the SMB share to the newly created Linux group. Will add the plex user to the share_library_core group.
> sudo usermod -G share_smb_core -a plex
 
6. Next we have to create a directory to mount the SMB share into. We’ll mount the share in a directory called /mnt/nas/media. This means that when the Samba/CIFS share is setup it will be accessible from this directory.
> mkdir /mnt/nas
> mkdir /mnt/nas/media
7. Let’s test the details to ensure we can connect, you will have to type in the password when prompted, assuming:
  • 192.168.1.200 is the IP of the NAS/Samba Server
  • shareName is the name of NAS/Samba share 
  • /mnt/nas/media is the directory on the plex server that you want to map the share to
  • SambaShareUserName is the NAS user name that you want to use to connect to the NAS/Samba server
> sudo mount.cifs \\\\192.168.1.200\shareName /mnt/nas/media -o user= SambaShareUserName,uid=5000,gid=6000
note: I was connecting to a Unix based NAS, I don’t know if this will be different for Windows PC / server.
 
If no errors appeared, the share should successfully be mounted. The verify this, use the 'df' command, this command displays all mounted drives.
 
You should see your HHD partitions and the share, note this assumes that the NAS share is called ‘media’:
Filesystem               1K-blocks       Used Available Use% Mounted on
\\192.168.1.200\shareName   2147422700 2141280606   6142094 100% /mnt/nas/media
If that works we are half way there. But lets set it up to automatically mount the NAS share in a secure way, that is not expose the user credentials for the Samba Share. We will do this by creating a credentials file that only root can read and set up the mount command to read this file.
 
8. Create a credentials file in Root’s home directory, you can put this somewhere but for this guide I’m just having it here. The ‘touch’ command essentially creates an empty file.
> sudo touch /root/creds_smb_library_core
9. Modify the credential file’s permissions so that only the Root account is granted read permissions using the ‘chmod’ command. No groups or other users should have access to the file. Not even the plex user.
> sudo chmod 0600 /root/creds_smb_library_core
10. Next we need to edit the file to inject the username and password that we will use to connect to the Samba share.
> sudo vi /root/creds_smb_library_core
 
The file will contain 2 lines, one for the username and the last for the password, it should look something like this:
username=NasUserName
password=NasUserPassword
11. OK, Let’s test this credential file, first we have to un-mount the share, assuming that it is still mounted from step 7. We simply use the ‘umount’, the unmount command, and reference the directory that the share is mapped to, (note you need to change director to / to ensure you can unmount the share)
> cd /
> umount /mnt/nas/media
 
12. Next lets remount with Samba share the credentials file using, that is to not use the username as shown in step 7:
> sudo mount.cifs \\\\192.168.1.200\\shareName /mnt/nas/media -o credentials=/root/creds_smb_library_core,uid=5000,gid=6000
Note: The extra backslashes (\) are not typos. Backslashes are used to escape certain characters. Because of this, we have to double up on them when accessing Microsoft shares.
 
Ok, Let’s verify this again, use the df command, this command displays all mounted drives.
 
You should see details as before. If so, woohoo, the credentials file works!
 
Now to set up the ‘fstab’ file, the ‘file-system table’ file. This will automatically mount the share at startup.
 
13. Open the fstab file 
> vi /etc/fstab
 
Next add the following line at the end of the file:
 
Again this is assuming:
  • 192.168.1.200 is the IP of the NAS/Samba Server
  • shareName is the name of NAS/Samba share 
\\\\192.168.1.200\\shareName /mnt/nas/media cifs credentials=/root/creds_smb_library_core,uid=5000,gid=6000 0 0
The file should look something like this:
# /etc/fstab
# Created by anaconda on Mon May 25 10:52:37 2015
#
/dev/mapper/centos-root  /                       xfs     defaults        0 0
UUID=9d33fce4-de21-4a3a-925b-1014ab2ffed0 /boot                   xfs     defaults        0 0
/dev/mapper/centos-swap  swap                    swap    defaults        0 0
\\\\192.168.1.200\\shareName  /mnt/nas/media cifs credentials=/root/creds_smb_library_core,uid=5000,gid=6000 0 0
Save the file.
 
14. OK, the last step is to restart the server. After the server has restarted we just want to log on and check that the share has been mounted using the ‘df’ command.
 
Fingers crossed it has all worked! if so congratulations you have configured your server and the share that holds your media now automatically mounts. 
 
 
Add you media to your server
 
Finally time to add your media to your server, and something I will leave up to you. Just remember that the plex user needs to have the right permissions to access your media if you are installing it locally as per the Plex Linux Guide in the FAQs.
 
 
Conclusion
 
I hope this guide is helpful for some people, at the very least this post will backup my steps if I need to reinstall :) . Please let me know if you have any other suggestions to improve this process too!
 
Cheers,
Isomorphic
Tagged:
«13

Comments

  • oneshot719oneshot719 Posts: 39Members, Plex Pass Plex Pass

    dang at this point a shell script might be proper to install and configure it but this is a great thread!

  • leecrammanleecramman Posts: 1Members
    edited June 2015

    Thanks for the guide - it all worked well for me except that I can't configure remote access  :huh:

    Where I would expect to see internal and external IP addresses there is nothing except: Private Unknown IP   Public Unknown IP  :( 

    The firewall rules must be OK because I am able to browse to the server on port 32400...

    I've tried both uPnP and manual port forwarding, neither work but I suspect that isn't the problem - I think it's something to do with those missing IP's.

    edit: Managed to fix it by doing 2 things - not sure which it was that worked!

    1. I manually added a default gateway to the network configuration.

    2. I mapped a different external port (32401) to 32400 - for some reason my router may have been blocking 32400.

  • RyGuy1860RyGuy1860 Posts: 5Members ✭✭

    This was all very good. One question I have is, can/should I use my Plex login rather than the "plex" user that you are describing? Is that just a standin?

  • RABCORABCO Posts: 122Members, Plex Pass Plex Pass

    @RyGuy1860
    The "plex" user described in the article is the local user account on CentOS that runs the PMS service. It has nothing to do with your MyPlex account if I understand what you are asking. There is no place on the WebUI where you would ever reference this local account.

  • RyGuy1860RyGuy1860 Posts: 5Members ✭✭

    @RABCO Thanks. I went ahead and guesses (great for production) and found that you were exactly right! Very clear, works remotely out of the box. Nice

  • kbrnsrkbrnsr Posts: 2Validating, Plex Pass Plex Pass

    @RyGuy1860
    Just for future reference, you can change the plex user by checking out this support article: Linux: User and Storage configuration (https://support.plex.tv/hc/en-us/articles/200273978-Linux-User-and-Storage-configuration)

  • david.munger@gmail.comdavid.munger@gmail.com Posts: 3Members, Plex Pass Plex Pass

    I installed plex server and temporarily shut down the firewall, as you described. But when I load http://[ip addr]:32400/web from a client browser I see no Server tab; only Web, Users, and Devices. I checked the status of the firewall and it is definitely shut down. I don't know what troubleshooting step to take next?

  • devo8604devo8604 Posts: 1Members, Plex Pass Plex Pass
    edited October 2015

    @david.munger@gmail.com said:
    I installed plex server and temporarily shut down the firewall, as you described. But when I load http://[ip addr]:32400/web from a client browser I see no Server tab; only Web, Users, and Devices. I checked the status of the firewall and it is definitely shut down. I don't know what troubleshooting step to take next?

    If you are accessing it from a different computer, you need an SSH tunnel. The process is described here: https://support.plex.tv/hc/en-us/articles/200288586-Installation

    If you have one set up already, restart the plex service..that should fix it up.

  • pandapiedpandapied Posts: 26Members ✭✭

    How did you guys add media ??
    I have PMS up and running and configured remote networking through SSH tunnel.
    However when i want to add media and press my home folder where the media folders are. My home folder is totally empty. Any ideas ?

  • ADMiNZADMiNZ Posts: 17Members ✭✭
    edited November 2015

    [plex@mm home]$ sudo mount.cifs \\10.1.1.10\Video /mnt/nas/Video -o credentials=/root/creds_smb_library_core,uid=5000,gid=6000
    mount error(13): Permission denied
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

    Every secret becomes obvious.© ADMiNZ

  • ADMiNZADMiNZ Posts: 17Members ✭✭

    Fix. add ,sec=ntlm

    sudo mount.cifs \10.1.1.10\Video /mnt/nas/Video -o credentials=/root/creds_smb_library_core,uid=5000,gid=6000,sec=ntlm

    Every secret becomes obvious.© ADMiNZ

  • wmurrowwmurrow Posts: 1Members, Plex Pass Plex Pass

    This is perfect! Thanks to the OP and everyone else that commented!

  • mmbbachmmbbach Posts: 2Members, Plex Pass Plex Pass

    I'm trying to follow these steps, but get stuck on step 6, configuring a static IP address. When I set Method to Manual on the IPv4 Settings tab, the Save button is disabled and remains so after adding the IP address (with Netmask and Gateway) and the DNS server.

    Is there anything else required for configuration? Search domain? Routes?

    Thanks in advance for any guidance.

  • mmbbachmmbbach Posts: 2Members, Plex Pass Plex Pass

    @mmbbach said:
    I'm trying to follow these steps, but get stuck on step 6, configuring a static IP address. When I set Method to Manual on the IPv4 Settings tab, the Save button is disabled and remains so after adding the IP address (with Netmask and Gateway) and the DNS server.

    Is there anything else required for configuration? Search domain? Routes?

    Thanks in advance for any guidance.

    Never mind. I figured this out. Was using an IP address that was out of range.

  • DigitalArtifexDigitalArtifex Posts: 1Members

    I appreciate the fact that you took the time to write the tutorial for the community. There are a few things, however, that should be handled differently.

    1) Is the plex user setup required? The user was generated for me with installation, much like installing Apache. This was tested on a fresh install of CentOS 7

    2) Sudo should not be needed and should not be used. This is a potential security issue. Plex will be executed as a service, and therefore will have a sudo context. Allowing the plex user to have sudo itself would make it pretty easy for intruders as dummy accounts usually have dummy passwords. Post-installation check does not have plex in sudoers, with a working server

    3) Plex should not have a shell, itself. The plex user is a dummy user and being able to login is a potential security issue, especially when combined with #2. This should be changed to /bin/false for immediate login failure or /sbin/nologin for failure with message. /sbin/nologin is defaulted with the plex installation.

  • jamesmacwhitejamesmacwhite Posts: 76Members, Plex Pass Plex Pass
    edited February 2016

    @DigitalArtifex

    I echo similar points you've made when I originally followed this.

    Firstly, thank you to OP for writing this guide. I used it to help migrate my Plex install from Windows Server 2012 R2 to CentOS 7. There were some areas I did differently based on my own views/security.

    Plex doesn't need to be root

    The Plex user does not need to have root elevation or even have the ability to login. In newer versions of PMS the rpm package will automatically created a Plex user account. By default it has its shell set to /bin/false, meaning you can't login into the user via SSH or console. You should really consider keeping it this way. Unless you are running some really bespoke setup and understand the risks, the Plex user does not need to be elevated to root or have a shell for login abilities at any point.

    If you want SSH access, create a separate user account for general management/maintenance that isn't root.

    Additionally, as Plex Media Server runs as a proper service (unlike Windows), the permissions and elevation will be handled by systemd. No jacket sudo required. The only thing to ensure is all Plex related directories are assigned to the plex user plex:plex. You can use:

    chown plex:plex <directory> # Directory only
    chown -R plex:plex <directory> # Recursive
    

    Note: You do not need to use chown on CIFS shares, as the UID and GID controls the ownership.

    You can modify the default paths after Plex Media Server is installed such as the Plex home directory (default /var/lib/plexmediaserver) which is totally fine. Changes to these paths and other configs values can be done in /etc/sysconfig/PlexMediaServer.

    Samba shares

    Regarding samba shares part, the special user and group created is not necessary. You can directly mount CIFS shares via the UID and GID of the plex user without any issues and in fact I would recommend doing so.

    As the user is auto created by the rpm you can simply run the following and use numeric values reported back in /etc/fstab

    id -u plex # Get UID
    id -g plex # Get GID
    

    I actually had problems using the mentioned samba groups with the Optimised Versions feature. I got various permission and write errors every time I tried to use it, turns out its because of permissions on the CIFS mounts, despite adding the plex user assigned the group. Mounting with the plex user directly resolves the issue.

    Additional firewall issues with firewalld

    In addition to the well documented Plex ports required to be opened, firewalld didn't play nice with RasPlex and blocked the ability to connect to Plex HT for remote control. This is likely due to multicast filtering and its a pain in the butt to add a rule for these data packets. In the end I gave up and essentially whitelisted my RasPlex device outright.

    firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" source address="xx.xx.xx.xx" accept'

    Hope this helps in addition to excellent guide written.

  • mufidaymufiday Posts: 1Members

    Very straightforward, thanks for the effort. great comments as well.

  • tempohousetempohouse Posts: 6Members ✭✭

    Nice guide, many thanks. I always do a 'systemctl enable plexmediaserver.service' as well, just ensure it's set to auto-start (don't know if it is by default?).

    I've run PMS on a minimal Centos7 for a year or so now and it's been absolutely bulletproof - I can highly recommend it to anyone thinking of a Linux PMS build :)

  • isomorphicisomorphic Posts: 12Members, Plex Pass Plex Pass

    Wow thanks for the comments guys!

    It has been over 9 months since I have logged back on the forums. Probably because Centos and Plex has been extremely solid for over 18 months :)

    Thanks @DigitalArtifex and @jamesmacwhite for your feedback. In hindsight I totally agree now that I know more about linux now.

    I would update the original post, but it looks like the new forum software post limit is less than previous and it won't allow me to update without truncation of much of the post.

    Cheers
    Iso

  • isomorphicisomorphic Posts: 12Members, Plex Pass Plex Pass

    Ok, so I tried to update to Plex Media Server v1-0-3 with 'yum localinstall' and was unable to start the service. I jinxed myself with my 'extremely solid' comment above :) .

    This turns out to be a know issue - the details and solution to get you back up and running can be found in this post https://forums.plex.tv/discussion/225366/cant-start-plexmediaserver-after-yum-localupdate-plex-rpm.

    Cheers,
    Iso

«13
Sign In or Register to comment.