krypted.com

Tiny Deathstars of Foulness

On Sunday, I mentioned making your forward and reverse DNS entries match up. But I didn’t really discuss what to do if they don’t. For those readers moving into Ubuntu from Mac OS X Server, you’ll note that at installation time, if the hostname doesn’t match the A record and PTR for your server then it will install DNS and make them match up. The reason for this is that host names are a critical aspect in how many of the network services that modern services run. If you don’t have DNS or if you want to fire up DNS in the same manner that Mac OS X Server does it then let’s look at doing so here. First up, let’s get the packages that we’ll need installed using apt-get, which includes bind9 and dnsutils:
apt-get install bind9 dnsutils
Once those are installed, let’s define our zone and reverse zone in /etc/bind/named.conf.local:
zone “krypted.com” { type master; file “/etc/bind/zones/krypted.com.db”; }; zone “210.168.192.in-addr.arpa” { type master; file “/etc/bind/zones/rev.210.168.192.in-addr.arpa”; };
Note: If you’re cut/copy/pasting here, the double-quotes are going to need to get replaced with unformatted ones. If you have other forward or reverse zones then you will need to add them using the same format as above. Once you’re done, save the file. Next, let’s tell the server where to look when attempting to resolve names that it does not host. This information is stored in the options array in /etc/bind/named.conf.options. This is currently commented out (commented lines start with //) so let’s uncomment the forwarders section (by removing the // in front of the lines) and change the IP of that forwarder from 0.0.0.0 to the IP address of your server. It should look similar to the following when complete:
forwarders { 4.2.2.2 };
Next, we’re going to create our
mkdir /etc/bind/zones touch /etc/bind/zones/krypted.com.db touch /etc/bind/zones/rev.210.168.192.in-addr.arpa
Now that we’ve created our files, let’s edit them. First, open /etc/bind/zones/krypted.com.db and look for all instances of krypted.com, replacing them with the domain name that you would like to use. Also, look for all of the records and make sure that they match with the name and IP that you would like to use, creating new lines for each new record:
krypted.com. IN SOA ns1.krypted.com. admin.krypted.com. ( 2007031001 28800 3600 604800 38400 ) krypted.com. IN NS ubuntu08.krypted.com. krypted.com. IN MX 10 mail.krypted.com. www IN A 192.168.210.2 home IN A 192.168.210.2 mta IN A 192.168.210.2 ubuntu08 IN A 192.168.210.254
Next, we’ll populate the reverse zone file. You’ll need to replace my instances with your own as in the previous section. Open /etc/bind/zones/rev.0.168.192.in-addr.arpa in your favorite text editor and edit away:
@ IN SOA ubuntu08.krypted.com. admin.krypted.com. ( 2007031001; 28800; 604800; 604800; 86400 ) IN NS ubuntu08.krypted.com.
1 IN PTR krypted.com
Next, we’ll restart the DNS services to accept these massive changes we’ve made:
/etc/init.d/bind9 restart
Next, edit the /etc/resolv.conf file to set the DNS server and (optional) search domain. Then change it to look something like the following:
search krypted.com nameserver 192.168.210.254
Finally, you can use dig and nslookup to test the lookups and make sure they work. For example:
nslookup ubuntu08.krypted.com

November 22nd, 2010

Posted In: Ubuntu, Unix

Tags: , , , , , , , , , ,

OK, so you don’t necessarily call rtsp on Ubuntu QuickTime Streaming Server. Instead, you call it Darwin Streaming Server (DSS). But the end result is basically what you have exposed in Mac OS X Server, but running on Linux. You don’t have the same functionality in Server Admin, but it does work. And the key to what it does is use the rtsp protocol to stream supported files from the server to clients. It is a little tougher than just clicking on the start button, but too much tougher provided you follow these directions (thanks to the good folks of the DSS list that I’ve been a member of for a few years for taking such good notes, making this much simpler to write when I just have to move from Ubuntu 7 to 10.04). To get started (most all of this is going to need sudo or su), let’s use wget to download all the files that we’re going to need (except 1):
wget http://static.macosforge.org/dss/downloads/DarwinStreamingSrvr6.0.3-Source.tar wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-6.0.3.patch wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-hh-20080728-1.patch
Now let’s extract the tar file:
tar -xvf DarwinStreamingSrvr6.0.3-Source.tar
Now let’s create our qtss user and group:
addgroup –system qtss adduser –system –no-create-home –ingroup qtss qtss
We’re going to need the build-essential package from apt-get, so let’s install that before moving on:
apt-get install build-essential
The base 6.0.3 installer was only built for Mac OS X, so let’s apply the patches we used wget to pull down:
patch -p0 < dss-6.0.3.patch patch -p0 < dss-hh-20080728-1.patch
Now let’s cd into the actual dss installer directory and then grab a patched installer file, get rid of the old Install script and then grab a new one:
cd DarwinStreamingSrvr6.0.3-Source mv Install Install.old wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/Install
Then we’ll make the Install script executable and run the Buildit (no, not Configure) then Install scripts:
chmod +x Install ./Buildit ./Install
Finally, fire up the DSS:
/usr/local/sbin/DarwinStreamingServer
Now you should be able to go to a standard Mac OS X client and run a port scan of the rtsp port, 554 using stroke (swap the 192.168.210.254 IP here with whatever IP or hostname that you’re using):
/Applications/Utilities/Network Utility.app/Contents/Resources/stroke 192.168.210.254 554 554
DSS installs some sample movies into /usr/local/movies. Provided that the port is open, let’s open Safari and provide the following link to see if one of the stock sample movies will open:
rtsp://192.168.210.254/sample_h264_300kbit.mp4
Provided that you see the sample movie from Apple then you can move the sample movies elsewhere and drop your own in here. You’ve now got a fully functional DSS. The DSS will stream .mov, .mp4 and .3gp files. If you enable the QTSSHttpFileModule you can also stream mp3 files. If you go into the /etc/streaming folder you will see a number of files that look similar to what you have been working with on Mac OS X Server (assuming you’ve been working with Mac OS X Server). In here, you’ll find the qtusers and qtgroups files for managing users and groups in rtsp as well as the streamingserver.xml file, which is where the modules are loaded and unloaded. In /var/streaming you’ll also find a directory called logs, which is interestingly enough where the logs reside and another directory called playlists, which is where you will drop playlists in the event that you decide to make your own radio station. My music tastes are bad enough where I’ve never really considered this, but feel free to get all WKRP in Cincinnati if you so choose, I promise not to judge (or maybe just a little)… You’ll also end up likely looking to embed these rtsp streams (that seems to be what everyone does). If so, get to know the XML structure:
<?xml version=”1.0″?> <?quicktime type=”application/x-quicktime-media-link”?> <embed src=”rtsp://192.168.210.254/sample_h264_300kbit.mp4″ autoplay=”true” />
Ultimately, building and using QuickTime Streaming on Mac OS X Server is far superior in a number of ways to doing so in Linux. For starters, the steps here are all done by clicking on a Start button in Mac OS X Server. But even further than that, updates are even more rare to DSS. If you’re in the rack density game, a number of Mac mini servers in the right sized rack might just get you more bang for your square inch!

November 20th, 2010

Posted In: Mac OS X Server, Ubuntu, Unix

Tags: , , , , , , , , , , ,