Wednesday, January 18, 2012

Hosting a Mumble server with DynDNS on Windows 7

Last week my Mumble host decided to shutdown operations completely unannounced. Which was just awesome...but that aside I decided to try and host a server myself. Here's how I got it working on a dedicated Windows 7 box.

First, download and install Mumble. The server software, called Murmur is inside (something that wasn't obvious when I started). Install it and select the packages you want, Murmur for sure, Mumble if you want.

Once that's ready, head on over to DynDNS and setup an account. Once you've activated it, click on "My Services".

On that page, click "Add Hostname", and run through their process. This used to be free (no credit card), but it appears they require it now-a-days. After activation, simply cancel your order within 14-days and you won't be billed, but you keep your hostname. For this I selected

Continuing with DynDNS, make sure to download the client updater and install it on the machine hosting the Mumble server. The client looks like this once you login and synchronize:

Alright, so we have Murmur installed and DynDNS installed. Next we need to configure the "murmur.ini" file. There's quite a few settings in here, but the main ones you'll want to look into are these:

welcometext=The text I want to welcome someone with when they join my server! HTML can be used here.
port=64738 or whatever port you want to use for the server. This can be whatever you like, however make sure it's something you're not already using. You can find out what ports you're using by opening a command prompt and typing "netstat". Browse the listed ports and select something NOT listed.
#host=Keep this commented out so the server will bind to all available connections.
serverpassword=Set a password here if you don't want "randoms" joining without the password.
users=20 or whatever number of user slots you want. This will vary depending on your bandwidth. For my 20 mbps business line I have ran 10 concurrent users with no noticeable lag. I'll try and update this post in the future with more information about what I am able to handle.
registerName=My Mumble Server or whatever you want the main channel of your Mumble server to be called. This is generally what people associate with the actual name of the server. So for my website, my main channel name is The Spawn Room.

This is all I changed in the ini. If you want to mess with other settings look at the Mumble documentation for more information.

Note: make sure to double check if a line has the # sign. If it does, that means it's commented out and won't work!

Now let's make a SuperUser password before moving on. Open a command prompt and enter:

<path to murmur.exe> -ini <path to configuration file> -supw <password>

This is how mine looked:

"c:\Program Files <x86>\Mumble\murmur.exe" -ini "c:\Program Files <x86>\Mumble\murmur.ini" -supw mySuperUserPassword

Note: the quotes are needed this time.

Port forwarding time! I'm not actually going to go into detail here because everyone has different routers, but here's the general concept. You'll want to log into your router which is probably at an address like: or If you've never logged in before, the default username and password can be found through Google with a search like "my router name/model default password".

Once you've successfully logged in, find a section for Port Forwarding. Now you'll need to add an entry for Mumble/Murmur (name it whatever you like), with the appropriate information. IP of the machine (command prompt -> ipconfig /all -> 192.168.x.x), the port (or port range) you selected for the Murmur server, and whatever else it asks for.

Again, depending on your router, you may need to restart to apply the settings. Do this now.

Once you're back up and running, it's time to launch the Murmur server and see if everything's working. Find murmur.exe in your Mumble folder, launch it and right-click the icon in the taskbar. Select "Show Log".

If you get "Server listening on" that's fine. I thought this meant it wasn't working, but it does. If you're getting an IP with "failed: The address is not available" after it, then it's NOT working. Or at least it wasn't working for me. I tried changing the port and ensuring that the #host= line was commented out.

Another important note here is that, for whatever reason, I was ONLY able to connect over LAN. Trying to connect to my DynDNS IP from the local network DID NOT work. If anyone knows why, I would love to hear it. But for those of you just trying to get this working, don't waste a bunch of time wondering why it's not working. Ask a friend to try and connect to the server first before making assumptions.

That's it! I got it working this way and was able to have a number of friends join to play some games. You can proceed from here with the SuperUser account to create channels, add admins/mods, manipulate ACL's, etc. (I may cover these things more in future tutorials).

Thanks for reading! If you have any questions or want to point out something unclear/wrong, post a comment.

Wednesday, January 4, 2012

RSS feed(s) to MySQL database - a script using Simplepie and PHP in Codeigniter

A few weeks ago I was looking for a PHP script that would take RSS feeds and insert them into a MySQL database so I could manipulate them in my environment. There were a few examples here and there that were useful, but not one big example that suited my needs. Here's what I ended up doing.

First I needed to choose a RSS parser. A quick Google search revealed Magpie and Simplepie. I compared the two and ultimately chose Simplepie since it's being actively developed and the documentation seemed thorough and accessible.

After downloading the latest version (1.2.1 at the time of writing), I unzipped it and grabbed the "" file. This went in the root of my /CodeIgniter/scripts folder along with a new PHP file called "rss.php".

The Code


This allows the script to take advantage of Simplepie. Next:

// Create a new instance of Simplepie.
$feed = new SimplePie();

// There are two options to parse RSS feeds depending on your needs.
// The first is a single url:
// The second is an array of feeds, if you're parsing more than one:

// Only use one of the above ways. Comment out or delete the other.

// Set a folder where the cache can reside.
$feed->set_cache_location($_SERVER['DOCUMENT_ROOT'] . '/CodeIgniter/application/cache');

// If you're on Dreamhost like I am, you'll need to modify the cache location to something like this:
// This will ensure the output from the RSS feed matches the MySQL encoding, otherwise you end up with characters like this: รข€
// Initialize Simplepie.

// This makes sure that the content is sent to the browser as text/html and the UTF-8 character set (since we didn't change it).

Next we need to establish a database connection. For testing purposes, I ran this script on my local machine using XAMPP.

// Make sure to put in the proper server, username, and password information here.
$con = mysql_connect("localhost", "mysql_username", "mysql_password");
// Select the database you want to use.
mysql_select_db("myDB", $con);

// Then check if the connection failed. If it did, die with the error message.
if (!$con)
{ die('Could not connect: ' . mysql_error()); }

Now it's time to loop through the parsed items and load them to the database.

foreach ($feed->get_items() as $item)
// Here are some of the various items you can pull from an RSS feed:
        $permalink = $item->get_permalink();
$title = $item->get_title();
$content = $item->get_description();
$date = $item->get_date('Y-m-j g:i:s');

        // This next part will check for duplicated items by hashing the content and comparing it to the hashes in the database. This part is optional, but recommended.
        $content_hash = md5($content);
$result = mysql_query("SELECT * FROM my_posts WHERE content_hash = '" . $content_hash . "'");
$num_rows = mysql_num_rows($result);

if ($num_rows > 0) { }
        // If this item's hash doesn't match any in the database
// This part will check if the date has been set. Sometimes feeds don't post the date so I found this to be necessary. If it has a date, then INSERT everything, if not, set a default date in MySQL and don't INSERT the date.
                if (isset($date))
mysql_query("INSERT INTO my_posts (date, content, content_hash, url, title) VALUES ('" . $date . "', '" . $content . "', '" . $content_hash . "', '" . $permalink . "', '" . $title . "')");
mysql_query("INSERT INTO my_posts (content, content_hash, url, title) VALUES ('" . $content . "', '" . $content_hash . "', '" . $permalink . "', '" . $title . "')");


// Finally, remember to close the connection.

That's it. I can run this, parse feeds, grab the data and INSERT it into the MySQL database. There's probably a more elegant and simple way to do it, but this worked for my needs. From here you can access these posts and manipulate them on your site however you please. I added the ability to comment, rate them, modify and delete, etc.