Quote Of The Day

“Since so much of the Japanese candle terminology is grounded on military terminology, we will look at stops in this context as well. Each trade you make is a battle –and you will have to do what even the greatest generals have to do: Make temporary, tactical retreats. A general’s goal is to preserve troops and munitions. Yours is to save capital and equanimity. Sometimes you must lose a few battles to win the war. The Japanese have a saying. “A hook’s well lost to catch a salmon”. If you are stopped out think of it as you would a lost hook. Maybe you will catch your prize with the next hook.”

– Steve Nison

Installing Plex Media Server on Centos 7

I’ve been running Plex Media Server on an old desktop machine that runs in my closet for a few years now. It was running on Centos 5 and has performed beautifully, with the family using it constantly. Unfortunately, as it goes, hardware fails, and I lost two hard drives and the optical drive at the same time. With the new hardware in place, these are the steps I took to get the family fun center up and running.

Plex Media Server Step-by-step Installation Guide for Centos 7

  1. Download and install Centos 7. This is the latest version of the OS. I have done a minimal install. The install goes great, but Red Hat have removed support for 100mbps NIC’s in this latest version, so be sure your hardware is running a gigabit network card, or else Centos will not pick it up. I bought a Trendnet card from Amazon for $10, and Centos picked it up perfectly during the install.
  2. Once installed, log in and install a few packages that I find useful, namely
    1. net-tools
    2. nano
    3. wget
  3. Perform a system update – yum update
  4. Secure your server. Linode has got some great articles & tutorials, and their one on securing your server is a must. Follow their instructions for a secure Linux server. Just remember to check your permissions and ensure 0700 for ~/.ssh and 0644 for the authorized_key file in that folder.
  5. Disable SELinux by editing the file /etc/sysconfig/selinux I have found that SELinux messes with the media server, and in all honesty is not necessary for a media server.
  6. My media is on a NAS that I will be accessing via NFS, so I will install the NFS client – yum install nfs-utils nfs-utils-lib
  7. Connect to my NAS. I created a folder called /mnt/NAS and have added the following line to the /etc/fstab file: 192.168.1.110:/mnt/HD/HD_a2/media /mnt/NAS nfs defaults 0 0. To test it run mount -a
  8. Download Plex using wget
  9. Install Plex by running yum localinstall
  10. Open the appropriate firewall ports for PMS. See the following article for the list of ports. The command to open a port in Centos 7 looks like this: firewall-cmd --add-port=32400/tcp --permanent. (Those are double dashes in front of add and permanent) You can use nmap to check the open ports (sudo nmap -sT -O localhost) or firewall-cmd --query-port 32400/tcp
  11. Make sure Plex starts on system boot. You can check this with systemctl is-enabled plexmediaserver.service. If it returns “disabled” then turn it on with sudo systemctl enable plexmediaserver.service
  12. Now go to your Plex media server via a web browser on another machine and start adding libraries – http://192.168.1.231:32400/web/index.html

Troubleshooting

If you are having trouble, there are a few resources that may help.

  • DigitalOcean also have great articles on setting up a Centos 7 server.
    • https://www.digitalocean.com/community/tutorials/initial-server-setup-with-centos-7
    • https://www.digitalocean.com/community/tutorials/additional-recommended-steps-for-new-centos-7-servers
  • If you’re having permission issues – check out this page: https://support.plex.tv/hc/en-us/articles/200288596-Linux-Permissions-Guide

Plex Media Server

Centos 7