Archive for October, 2008

Virtual Host configuration on Apache2 and Windows

Sunday, October 26th, 2008


For a long time I have had an ongoing battle in my head about whether to use Linux or Windows as my webserver OS. Linux seems to be able to provide speed and stability while Windows seems to provide manageability. Can you hear the Linux goofs whining about how powerful Linux is? That's great, let me know when you are done explaining why video is so painful in X… why I can't simply open a remote video session… why daily tasks require knowledge that the vast bulk of Windows users will never even think of having… OK, I'm done for now.
So this weekend I was screwing around and testing out some "stuff" at home. I now have a Windows box that seems to be workin' pretty good but it was a bit of a bitch when it came to the virtual hosts part of the Apache config. I wanted to setup Apache so that it would have a default web page that would appear if someone tried to access the server without using one of the domain names I actually own. I quickly ran through my httpd.conf file and threw in some virtual hosts, but it was not doing what I expected. It would always show me the FIRST virtual host that I defined. My searches returned a number of people having similar issues but it turned out that I had a combination of their multiple problems. Here is a sample clip of a httpd.conf file and some tips to get your Apache working (if this is what you have screwed up too).

# Use name-based virtual hosting.
NameVirtualHost *:80
# Default Website
DocumentRoot C:/path/to/files
CustomLog C:/logs/default.log combined
# Entry for site001.com
ServerName site001.com
DocumentRoot C:/path/to/site001
CustomLog C:/logs/site001.log combined
# Entry for site002.com
ServerName site002.com
DocumentRoot C:/path/to/site002
CustomLog C:/logs/site002.log combined
# Entry for site003.com
ServerName site003.com
DocumentRoot C:/path/to/site003
CustomLog C:/logs/site003.log combined

Tip #1 – See how the first directive starts off with NameVirtualHost *:80 and each subsequent VirtualHost directive has *:80 after it? Apparently this is required syntax for Apache2. I am under the impression that you did not have to match the *:80 part in Apache1 but that ain't the case anymore.
Tip #2 – Notice that all the backslashes are not BACKslashes? I have noticed that you can use either slash in the Windows version of Apache but it seems to work better if you consistently use the forward slashes. You can choose to use either one but I would suggest choosing one and sticking with it. If you have PHP installed it likely added itself to the bottom of your httpd.conf using forwardslashes.
Tip #3 – If you have a ServerName directive in your config file (and you probably do have one near the top somewhere) then it can't be the same as any of your virtual host ServerName or ServerAlias directives. If you installed Apache with the Windows installer (and you may very well have) then you might find a ServerName site001.com statement that is screwing you up. This one might be hard to track since it will only screw up ONE of your virtual hosts.

MediaWiki

Thursday, October 23rd, 2008


You know what? MediaWiki kind of rocks. Realistically speaking, I don't see any wiki coming along and being more popular than the big fat WikiPedia but it is still pretty flexible software. Can you call it software? Well, whatever you want to call it, the point is that it works pretty good and the price rocks.
I am going to create a wiki for my house. I live out in the woods and I have some fairly major renovations to my house. I have a few items (like a hot tub and a generator) that are not what you might find at your typical house. Hell, maintenance of any house can be overwhelming if you are not familliar with the parts of it. So my wiki will have pages describing things like how to put the dock in and how to operate the generator. A buddy of mine mentioned that it may not actually contribute to the resale value of my home but it sure might make it more sellable. That would be friggin sweet!
If you want a personal wiki of your own you can have one for free, you just need to download and install things like Apache, MySQL, PhP and MediaWiki itself. It takes a little knowledge but if anyone asks [nicely] I might just write up a guide on setting this up on a Windows Virtual Machine.

Ottawa Pizza

Friday, October 3rd, 2008


It has come to my attention that people are stupid and have no idea what they are talking about when it comes to pizza. People frequently enough claim to know where to buy the best pizza in town… and are also frequently wrong. I've heard that Colonnade Pizza is the cat's ass here, too bad they keep the oven too hot and it ruins the cheese. Or how about Gabriel’s Pizza? I don't even know what they do to their cheese but it ain't good.

Do yourself a favour and get a pizza from:

- Georgies (The one on Carling, NOT House of Georgie's)
- H&R Pizza & Wings (Woodroffe and Norrice)
- Merivale Pizza (Guess where)

Don't order other stuff, just get a friggin' pizza and move on.