Feb 23 2003

Me likes Apache 2.0

Published by Andrew at 12:07 AM under Uncategorized

So I’m building a new server to replace forge.
Ok, more specifically, the server is built. I’m just migrating domains to it. But before I migrate any customer domains, I’m testing with my own domain. If something doesn’t work right with my domain, only I get annoyed. A customer, potentially a paying one, pissed off, is not a good thing.
I’m also playing around with Apache 2.0, since that’s what comes with Red Hat 8, which is what hammer is built on. It is /b much easier to implement virtual hosting with 2.0 than 1.3.x. The old way wasn’t bad: I just created a file in /etc/httpd/conf/Vhosts for the new host, then linked it into ../vhosts, then have Apache read in all of conf/vhosts. (I have to have it read vhosts instead of Vhosts because while Apache can be told to read all files in a directory, it can’t be told to ignore the RCS subdir, which created havoc.)
The new way is even easier: just add a VirtualDocumentRoot and VirtualScriptAlias directive to a single VirtualHost block in the main config. It then looks for a directory in the vdocroot and creates a virtual host with that directory’s name. Easy as pie. Don’t have to touch the config files or add a new one and don’t even have to SIGHUP the server. Just create a directory and make the appropriate DNS entry. Done.
And it works beautifully. If you go to http://andrew.pure-chaos.com, you’ll see my old web page on the new server. And there isn’t a single reference to pure-chaos.com anywhere in Apache’s config files. I LIKE it!

Now I just have to finish configuring Sendmail and add all the user accounts to the new server (I found out the hard way that just copying /etc/passwd,shadow,group over to the new machine doesn’t work real well. Red Hat added a few new system user accounts that aren’t in the old files. Good thing I backed up the original files on the new machine first.)