How To: Netflix style streaming site for your home

Currently I have a data server using unRaid that is also used to store media.  I run the PS3 Media Server on my computer to allow android and other devices stream media using DLNA, but I wanted to try something more pleasing to the eye.  I started searching for DLNA players with a nicer interface and couldn’t find anything.  So, I started searching for other options.  During my search, I came across a post labeled, “Make your own Netflix website!” .  So, I decided to fire up VMWare Player and give it a test before I built another server or decided to see if I could add it to the unRaid server.  Here are the steps to get a LAMP (Linux, Apache, MySQL, PHP) server up and running.  I know I don’t kneed MySQL, but it’s become a standard for web servers, so I’m going to install it anyway.

I’m also going to use CentOS 6.4 because I’m more comfortable with it.

 

1) Install CentOS 6.4

– Turn off the firewalls

# chkconfig iptables off

# chkconfig ip6tables off

# service iptables stop

# service ip6tables stop

– Turn off SELINUX

# vi /etc/sysconfig/selinux

change to SELINUX=disabled

Enable SSHD so you can ssh into the machine.

# chkconfig sshd on

# service sshd start

 

Turn on NIC, for some reason

#vi /etc/sysconfig/network-scripts/ifcfg-eth0

ONBOOT=yes

#ifup eth0

 

Update yum (and the rest if you wish)

# yum update yum

 

Install Apache, MySQL and PHP

# yum install httpd mysql-server php php-myslq

# chkconfig httpd on

# chkconfig mysqld on

# service httpd start

# service mysqld start

 

Install VLC

# yum localinstall –nogpgcheck http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm

# yum localinstall –nogpgcheck http://download1.rpmfusion.org/nonfree/el/updates/6/i386/rpmfusion-nonfree-release-6-1.noarch.rpm

# yum install vlc

# service httpd restart

 

Setup the netflix site

# unzip netflix\ look-a-like\ archived\ 3-15-2015.zip

# cd netflix

# mv * /var/www/html

# cd /var/www/html

# chmod 777 data

# chmod 777 pics

#chmod 777 includes/settings.ini.php

# vi includes/settings.ini.php

Change the password to whatever you want.

Open a browser and go to http://your-ip and you should see your site.  Click on the “Administration” tab, enter your password, and you can edit the settings.ini.php file.

 

Now, by default it will index files in the “videos” folder, so if you plan on having the files on this server, you can copy them there now, click on “Data” and tell it to check for new files.  Once it is complete, if you click on the “Video Library” tab, it will populate pics and data from IMDB.  If you have a ton of videos, this step could take a long time.

 

Now, in theory, if you click on a video and select “Play”, it should play in a new window automatically.  But, what I’ve found is that VLC is extremely picky about the media type using the defined playing methods.  I have yet to get it to play ANY of my video files.. so I borrowed the test video from the site listed above and it played the file fine, so I know it’s working.

 

Next, I just need to figure out what needs to be changed or added to allow VLC to transcode more codecs on the fly.

 

Also, since all my media is stored on another server, after playing around for a while, it doesn’t appear to like directories very much.  So, during my testing, I have configured the following mounts:

 

# yum install cifs-utils

# vi /etc/fstab

//data-server-ip/sharename/path/to/videos1 /var/www/html/videos/videos1 cifs credentials=/root/.smbuser,uid=48,gid=48

//data-server-ip/sharename/path/to/videos2 /var/www/html/videos/videos2 cifs credentials=/root/.smbuser,uid=48,gid=48

 

where 48 = apache (taken from /etc/passwd file)

 

Details for this can be found in my other post, Automount smb share with r/w for a user

 

And then editing the settings to look in videos/videos1 and videos/videos2