loading
Let's face it. Discs are a thing of the past, and external hard drives are bulky and inconvenient. With this guide, I will show you how to create a Home Media Center, capable of streaming movies and music straight to you PC. The best thing is, this is free, or cheap, project!

Step 1: Gathering the Supplies

What we will need
  • An unused PC
  • Ubuntu 9.04 Desktop Edition
  • A DVD-R(optional)
  • Media

You can replace the DVD with a USB flash drive, but for this guide i will be using the DVD

Step 2: Download Ubuntu 9.04

Can be acquired here http://www.ubuntu.com/getubuntu/download. I have a fairly decent internet speed, so it took me about an hour to download. Download time may vary, so sit back, relax, grab a cup of coffee, or learn the metric system.

Step 3: Burning the ISO

After you are done downloading the file, we must burn it to a disc. http://www.imgburn.com/index.php?act=download is a pretty good program for the job. If you know how to burn an ISO, then you are on the right track. Once you have burnt the disc, it is time to install!

Step 4: Installing Ubuntu

I won't go over this step, for it is pretty self explanatory, but if you need assistance, it can be found here https://help.ubuntu.com/community/GraphicalInstall

Step 5: SSH

Once you have installed Ubuntu, it is time to configure you server! In the upper left-hand corner, click on Applications>Accessories>Terminal. A window should pop up, similar to Mac OS X terminal, or Windows CMD Prompt.

In this window, type

sudo apt-get update

Then

sudo apt-get upgrade

Reboot the install OpenSSH-Server in terminal using

sudo apt-get install openssh-server

Find your local IP address. MIne is under eth1.

On another Linux machine, ssh into the client using

ssh your_username@local_ip

On Ubuntu 9.04, ssh has been replaced with OpenSSH, which comes pre-installed
If you are using a Windows machine, or Mac, go grab a copy of putty http://www.chiark.greenend.org.uk/%7Esgtatham/putty/ which serves as a ssh client.

Step 6: Configuring Samba

Install Samba in terminal using,

sudo apt-get install samba

and

sudo apt-get install samba smbfs

Stop Samba

sudo /etc/init.d/samba stop

Move

sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.orig

Create

sudo touch /etc/samba/smb.conf

Edit

sudo pico /etc/samba/smb.conf

Copy this filehttp://rubbervir.us/projects/ubuntu_media_server/smb.txt into the window

Replace "YOUR_HOSTNAME" with "Media"

Replace "YOUR_WORKGROUP" with the name of your Windows workgroup

Replace "/media/samba/" with "/"

Replace "YOUR_USERNAME" with your username

Save

Hit CTRL+X, Y, Enter

Set permissions

sudo chmod 0777 /

Restart Samba

sudo /etc/init.d/samba start

Add/edit/delete network users

Add user

sudo smbpasswd -a system_user (system_user, being the user you created in the installation"

sudo pico /etc/samba/smbusers

Insert following line into new file

system_username = "network username"'

Save

Edit user

sudo smbpasswd -a system_username (system username being the one you chose in the installation)

Delete user

sudo smbpasswd -x system_username

Reconfigure Sharing

sudo pico /etc/samba/smb.conf

and add this to the file

[Media]
path = /mediaserver
browseable = yes
read only = no
guest ok = yes
create mask = 0644
directory mask = 0755


Now Restart Samba

sudo /etc/init.d/samba stop

sudo /etc/init.d/samba start"'

Step 7: Add Media

Find you Media server over the network, login, find the folder "Media". And drag and drop the media you want into the folder.

Step 8: Adding Server Dependencies

First we must install some web-server dependencies.

Run each of these separately (DO NOT COPY AND PASTE THE WHOLE BLOCK OF TEXT!!!)

sudo apt-get install apache2

sudo apt-get install php5

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

sudo apt-get install php5-gd

Step 9: Getting the Files to Play Nice

In you ssh window, run this command

wget http://filenice.com/demo/fileNice.zip

Next we need to unzip the folder

unzip fileNice

Now we need to put it in the files at the web-root directory

sudo cp -a fileNice /var/www

you can now test your server by navigating to your server via web browser using the url

web_server_local_ip/fileNice
(replace web_server_local_ip with the ip assigned to your server by your router)

Step 10: Customizing You Prefs

Now to get you server working the way you want it, you must customize some code, allowing for certain file types and directories. To do so, run this command in the ssh terminal

sudo cd /var/www/fileNice/fileNice

then

sudo pico prefs.php

Find the line that says $embedTypes, and add the file extensions you want to the list.For mp3s, you simply remove it from the "$embedTypes" and add it to the "$miscTypes" list array. This makes it easier for a mobile device to use the mp3 file.

Press Ctrl+X, Y, then Enter

Step 11: Add Files

in the ssh terminal run this command

sudo /etc/samba/smb.conf

And add this block of text to the bottom of the file

[Streaming]
path = /var/www/fileNice
browseable = yes
read only = no
guest ok = yes
create mask = 0644
directory mask = 0755

[MediaStreaming]
path = /MediaStreaming
browseable = yes
read only = no
guest ok = yes
create mask = 0644
directory mask = 0755

Press Ctrl+X,Y,Enter
Restart Samba

sudo service samba restart

Now you can browse it over the network, and transfer files to your server. You make need the run these commands in the terminal to obtain the proper folder permissions.

sudo chmod 775 /MediaStreaming
sudo chmod 775 /var/www

Step 12: (optional)Create a Domain Name With No-ip

Go to http://no-ip.com and create a free account, and a domain for your server. Next in your ssh terminal type:

sudo apt-get install no-ip

then

noip2 -C

Follow the prompt, and then you should be able to use that domain name to connect to your server.

Step 13: Setting Up Darwin Streaming Server

Many of us have phones and iTouches, some like me are lucky enough to have an iPhone. In any case, Darwin Server will satisfy your general streaming needs. Unlike before in which we used progressive download, I believe that DSS will enable you to have true streaming capabilities.

First we must create the necessary user requirements

Enter these commands in the terminal
sudo addgroup -system qtss

and

sudo adduser -system -no-create-home -ingroup qtss qtss

This will add the user and user groups needed by DSS
Now enter the directory we need

cd /usr/local/src/

Download the latest version of DSS

http://github.com/lstoll/dss/tarball/master

Now decompress the file

tar -xvf lstol*

Enter the new directory

cd lstoll*

Build it!!

./Buildit install

Now sit back and enter the matrix, this step may take a while, so sit back, relax and enjoy. I recommend these comics here,here and here

When it is done

cd DarwinStreamingSrvr6.0.3-Linux

Then install (If you haven noticed, case sensitivity is important!)

./Install

Follow the prompts for a Admin username and pass. When it is completely installed, visit your new server at server_ip:1220, enter your username and pass you just created, and configure your server, making /MediaStreaming your streaming directory.

Step 14: Creating a Start/Stop Script

We must now create a script which will allow you to start/stop your sever. First, we must create the script file.https://www.instructables.com/id/edit?instructableId=E2YCHZ6FXA2ZASS#

sudo touch /etc/init.d/dss

Then edit it

sudo pico /etc/init.d/dss

Courtesy of ruman of Ubuntu Forums, we have a script to use. Paste this into your terminal
#-------------------------------------------------------------------------------------------
#!/bin/sh
#
# chkconfig: 35 92 12
# description: Quicktime Streaming Media Server
#
# init script to start up the quicktime (Darwin) streaming server

case "$1" in
start)
if test -r /var/lock/dssd
then
echo "Lockfile /var/lock/dssd exists. Server not started."
failure
else
echo "Starting Darwin Streaming Server: "
/usr/local/sbin/streamingadminserver.pl
touch /var/lock/dssd
echo "Darwin Streaming Server started..."
fi
;;

stop)
echo "Stopping Darwin Streaming Server: "
[-f /var/lock/dssd] || exit 0
echo "stopping..."
killall streamingadminserver.pl
rm -f /var/lock/dssd
echo
;;

restart)
$0 stop
sleep 1
$0 start
;;

*)
echo "Usage: $0 [start|stop|restart]"
exit 1
esac
exit 0
#--------------------------------------------------------------------------------------------------

Make it executable

sudo chmod +x /etc/init.d/dss

And make it start at boot

update-rc.d dss defaults

Like before, you can drag files from any computer on your network to your server, courtesy of samba, which will automatically show up on your servers.

Step 15: Adding Playlists to DSS

Go to server_ip:1220 in your browser, and in the left-hand bar, click "Playlists". Name it and add files, be sure to un-check Send this Playlist to a broadcast server, unless you plan to create a broadcast server, or already have one. After you finish, push the play button next to the playlist to stream it.

Now you can view your streaming in Quicktime Player by entering you streaming URL into the player, the URL should be in this format,

rtsp:// server_ip /MediaStreaming/ file_you_want_to_stream

Step 16: Enjoy

The sky is the limit, Google to find out more about streaming, and the potential things you can do. Your media is worldwide now, just create a proper firewall so that hackers do turn your friendly media server, into an evil hack machine. If you have stuck with this guide, kudos to you, it will prover to be worth it.
Now go outside, play some games, or do something fun, you'll probably need a pick-me-up after the tediousness of this guide.
I think u can find the smb.txt here:<br>http://ubuntuforums.org/showthread.php?t=1232464<br>the content is<br><br>[global]<br> ; General server settings<br> netbios name = YOUR_HOSTNAME<br> server string =<br> workgroup = YOUR_WORKGROUP<br> announce version = 5.0<br> socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192<br><br> passdb backend = tdbsam<br> security = user<br> null passwords = true<br> username map = /etc/samba/smbusers<br> name resolve order = hosts wins bcast<br><br> wins support = yes<br><br> printing = CUPS<br> printcap name = CUPS<br><br> syslog = 1<br> syslog only = yes<br><br>;[homes]<br> ;valid users = %S<br> ;create mode = 0600<br> ;directory mode = 0755<br> ;browseable = no<br> ;read only = no<br> ;veto files = /*.{*}/.*/mail/bin/<br><br>;[netlogon]<br> ;path = /var/lib/samba/netlogon<br> ;admin users = Administrator<br> ;valid users = %U<br> ;read only = no<br><br>;[Profiles]<br> ;path = /var/lib/samba/profiles<br> ;valid users = %U<br> ;create mode = 0600<br> ;directory mode = 0700<br> ;writeable = yes<br> ;browseable = no<br><br>[print$]<br> path = /var/lib/samba/printers<br> browseable = yes<br> guest ok = yes<br> read only = yes<br> write list = root<br> create mask = 0664<br> directory mask = 0775<br><br>[printers]<br> path = /tmp<br> printable = yes<br> guest ok = yes<br> browseable = no<br><br>;[DVD-ROM Drive]<br> ;path = /media/cdrom<br> ;browseable = yes<br> ;read only = yes<br> ;guest ok = yes<br><br>[MyFiles]<br> path = /media/samba/<br> browseable = yes<br> read only = no<br> guest ok = no<br> create mask = 0644<br> directory mask = 0755<br> force user = YOUR_USERNAME<br> force group = YOUR_USERGROUP
hi your link for smb.txt seems to be broken any chance of a new one <br>Thanks!
Site http://rubbervir.us is up for sale so no SMB.TXT file! <br> <br>Anyone have a copy? <br> <br>Please post the content here ...
This is a neat instructable - with better pictures and perhaps a guide (or at least a link to a guide) for setting up a firewall, it would be feature-worthy!
could you please change ubuntu 9.04 to 9.10 as support of 9.04 is over .By the procedures are same.
each is supported for 1.5 years. LTS versions have 3 years. it is supported, even now with me typing this on UNR 10.04
I'm confused.. Why don't you just use ubuntu server? And for the web server, instead of installing each one separately why don't you just use XAMPP?
I don't know about you, but I usually customize my own code which explains the separate installation of each, so that I can configure each separately. And Ubuntu server is less user-friendly, no GUI can intimidate people.
I understand that but your instructable only lists console commands :P
And you can still use that machine as a desktop PC if your streaming operations aren't using all of its resources... Linux isn't *just* for servers shoved in a closet somewhere.<br/>
That's true I have ubuntu on my main, but this server I built I do have shoved in a server somewhere.
I have Linux Mint on my laptop and ssh into my Ubuntu Server inside a vm. Doesn't need to be in a closet :P
i think it was designed for people who arnt comfortable using the console only, plus this way u can use it as a computer as well. If you want to just use the server version, you can do all the console commands on the local pc, using sudo. i think, its been a while since i set up my server.

About This Instructable

219,229views

71favorites

License:

Bio: I am
More by mdkelsh:Setup a VPN for your iPhone/iPad or Computer Creating a Home Media Streaming Center with Ubuntu Hot Fudge Pudding Cake 
Add instructable to: