Creating a self signed SSL Certificate – A Brain Dead Script

I have an SSL instance running in the house so that I can access my home Subversion installation remotely. The certificate I generated for this site expired a few months ago and I have procrastinated regenerating it because I seemed to remember it was complicated and I didn’t want to spend the time.

Well, it winds up its not that bad. I found a great summary of the commands necessary in order to do it, and threw together a very quick script to string them all together in order to create SSL certificates for a general host name and figured I’d throw it up here.

I generalized it thinking that I could have two certificates for the virtual hosts I have running on my home server. Unless I’m looking at old information, however, it doesn’t seem that you can have different SSL certificates for virtual hosts running on the same IP address under Apache 2. If you can, and someone knows how to configure Apache to do so, please let me know.

Here’s the script I used to generate the self signed SSL certificates for the house. Super simple. Now I just have to remember to source the script ;).

#!/bin/bash
# Cert4Host.sh - Generate SSL Certificates for a host name.

HOSTNAME="$1";

if [ -z "${HOSTNAME}" ]; then
echo "Usage : Cert4Host.sh HOSTNAME";
exit;
fi

if [ ! -e pass.key ]; then
openssl genrsa -des3 -out pass.key 1024
else
echo "Key already exists ... skipping ..."
fi

openssl rsa -in pass.key -out $HOSTNAME.key
openssl req -new -key $HOSTNAME.key -x509 -out $HOSTNAME.crt -days 999

sudo cp $HOSTNAME.key /usr/local/apache2/conf/ssl.key
sudo cp $HOSTNAME.crt /usr/local/apache2/conf/ssl.crt

Don’t forget to change your Apache SSL configuration to point to the new certificate and key (<hostname>.crt and <hostname>.key, respectively) and restart Apache.

Podcasts Moved To podcast.bieberlabs.com

I’ve been thinking for a while about moving the podcasts out of the main site in order to continue doing them but see what is going on from a traffic perspective. One of the things I wanted to do was change the feeds to use FeedBurner for the podcasts alone as I did with the main site.

On November 14, Tony Steidler-Dennison of The Roadhouse put up a show in which he was talking about how his feeds were split and asked all of his subscribers to resubscribe to the new feed so that he could get numbers to use in his talks to get permission from labels to broadcast music. As I listened to this, I was a little concerned at inconviencing the small amount of people who might have actually took the time to subscribe and listen to the drivel I’ve been putting out as I learn how to do this stuff. I didn’t want to have to make them resubscribe to a new feed, so I rethought my original plan to move the feeds to a different site.

Then I said to myself, “Self, there must be a way to redirect the feeds to a new feedburner feed from iTunes, and if there is, there must be a way to redirect them to a new site as well”. So I started playing around.

Luckily, before I submitted to iTunes, I thought ahead enough to use Apache URL rewriting to rewrite the URL http://www.bieberlabs.com/wordpress/podcasts to my WordPress RSS feed in order to provide a level of indirection to the podcast RSS feed. This is the URL that I then used to submit the podcast to iTunes. Since I had this level of indirection, once I moved all of the content and set up a FeedBurner feed, all I had to do was add this little section to my .htaccess file to redirect to the new feed:


RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^(podcasts)/?$ http://feeds.feedburner.com/bieberlabspodcast? [R]

This little block of instructions tells the Apache server to redirect any requests to http://www.bieberlabs.com/wordpress/podcasts over to the new FeedBurner feed, making the transition to the new site completely invisible (at least it is to me so far).

So, all of the podcasts are now finally moved to http://podcast.bieberlabs.com. This site will be used to only support my podcasts, which will be refocused on instrumental guitar music like the stuff that I played on the 7th show. I have always had a real passion for this type of music and I have to say, Rory’s music completely inspired me to refocus.

So, in addition to the new site, I’m putting a call out to instrumental rock guitarists. If you create this type of music, please send it to me (bieber.r_at_gmail.com) so that I can start creating shows highlighting this beautiful type of music. The great thing about podcasting is to be able to create shows around niches and aside from Satriani, you rarely hear this type of music on the radio. I’d like to be the place in which people come to find this kind of music and to be able to give the artists a place to have their music played. The frequency of the show, at least initially, will be dependant on the amount of music in this genre that I can find, but hopefully as people see this and submit their work, it will be more frequent.

I hope the new shows are to someones liking. I also hope this explanation of how I moved the content without interupting iTunes service is helpful to someone starting out. Until Apple gives us a way to modify a feed URL in the iTunes interface, this is most likely the way that moving content like this needs to be handled and I feel really good in figuring out how to get around this gap in the interface.

To those who are subscribed or listen to these shows periodically, thanks for being patient as I stumble through the learning process. This has been a lot of fun for me so far and I hope to get a lot better and have a lot more fun in the future.