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.

Related posts

Tagged with: , ,

  • Jacob sent me a link to this Linus is my Home Boy shirt, thinking I would like it. I think I do! Comments Off
  • Slashdot points to this article on Groklaw, which makes public a recently unnsealed email which states that the Linux Kernel is free of SCO intellectual property. Comments Off

SCO updates Unix product, open-source attitude | CNET News.com

From Slashdot:

SCO updates Unix product, open-source attitude | CNET News.com

For some reason I just have a problem with these guys filing lawsuits regarding Open Source software and then using it in their own product.

But that’s just me.

Related posts

Mandriva Aquires Lycoris

I received an announcement today on the Lycoris mailing list stating that Mandriva (formerly MandrakeSoft, creators of Mandrake Linux) have acquired Lycoris. Lycoris was started by Joseph Cheek in an effort to create a user friendly, Linux environment that was “easy for everyone”.

I actually bought the Lycoris system back when it was Redmond Linux - before the name change. I had taken cursory looks at it and thought they were on the right track. The main thing I didn’t like about it was the use of the KDE Desktop Environment. For some reason, I just find GNOME a much more comfortable environment to use.

For some reason, neither one of these distributions really caught on with me. I went from Debian to Redhat, with a brief stint of using Suse exclusively (version 9.0-9.2) before moving to Fedora, which I am very comfortable with and have been using since late last year.

That said though, it’s cool to see a guy start a company with good intentions and be bought without having gone bankrupt. I wish Lycoris luck under their new ownership. I’m definitely curious to see what new products come out of the merger.

Related posts

Tagged with:

Red Hat Magazine - The Patent Promise

There’s an article in this months Red Hat Magazine (new this month) called “The Red Hat Patent Promise: Encouraging Innovation” that is a good follow up reading on companies using patent law to protect open source software.

Kind of a “Rah Rah” article for Red Hat, but it does show one thing they’re doing right.

Related posts

Tagged with:

Mozilla FireFox 1.0

I downloaded Mozilla Firefox 1.0 today and browsed around with it a little this morning. Wow, what a difference! Speed wise it’s much better than the Mozilla browser. I was able to install the Flash Player Plugin without any human intervention whatsoever — on Linux!

While I’ve only goofed around with the browser a little bit this morning, I can definitely see, just from a short time living in the browser, what all of the “hubub” is about. This incarnation of the Mozilla browser may even give the Opera browser a run for its money.

Impressive. Now I’ll have to install it on my Windows machine …

Related posts

Novell Ships Enterprise Desktop Product

According to Novell.com, Novell has released their enterprise desktop distribution, Novell Linux Desktop.

You can read the press release on their web site.

I started running SuSE Linux when Redhat stopped doing retail distributions in lieu of the Fedora Project and never looked back. I had run SuSE 8 back in the day and wasn’t really impressed. They have done a great job on the distributions since Novell bought them, integrating the Ximian desktop into the product. I’m interested to see what the new desktop product looks like.

My reasoning for the switch at the time is that I just don’t like downloading distributions. I like being able to go to the store, buy a distribution, and install it without all the headaches of waiting hours for a download and burning the CD’s myself. I guess the whole CD burning thing is one thing that I haven’t really embraced yet.

It wound up for the best, as I think SuSE is one of the best distributions I have run thus far, from a “consumer wanting a desktop” perspective.

Related posts

Tagged with: