Leaving Sun

As has been widely repor­ted, Sun Microsys­tems laid off a num­ber of people on Thursday. That num­ber included most of my pro­ject team and me, since the pro­ject I was man­aging was cancelled. 

Over the nearly four years I was at Sun I learned a lot, con­trib­uted what I could, and had fun work­ing with some excel­lent people. Some of them are still there; oth­ers, like me, are now fig­ur­ing out their next steps. These days it’s easi­er to keep in touch, for which I am grateful.

What’s next? I’m not really sure. First I’ll take some time off, help out with North­ern Voice, fin­ish off recon­fig­ur­ing my base­ment firewall/website sys­tem, do some house and cot­tage renov­a­tions, catch up on my crafts, and think about what I want to do next. Even­tu­ally some good oppor­tun­ity will come my way that I can­’t res­ist; ideas and leads are welcome.

Apache Virtual Hosts

Notes on installing Apache’s vir­tu­al hosts on OpenSol­ar­is 2008.11; part of a series that star­ted with Installing OpenSol­ar­is.

On Debi­an, you have to set up vir­tu­al hosts using sep­ar­ate files, called sites-enabled and sites-avail­able, part of the Debi­an Way Of Doing Things, which is not doc­u­mented on the Apache site. (I’ve writ­ten about this before; the link I refer to there is no longer avail­able, so try this one if you’re on a Debi­an or Ubuntu plat­form.) For­tu­nately, OpenSol­ar­is seems to use the stand­ard Apache meth­ods, so named vir­tu­al hosts can be set up using the doc­u­ment­a­tion at Name-based Vir­tu­al Host Sup­port (the meth­od you choose when you want to run mul­tiple web sites from one IP address). It’s easy to find the httpd.conf file, it’s in the Web Stack Options applic­a­tion, under Advanced Con­fig­ur­a­tion on the Apache2 tab (and even labelled “edit httpd.conf”).

I set up a vir­tu­al host for each web site on the devel­op­ment machine. This is a little more com­plic­ated than it is if you’re start­ing from scratch with a new site, since I want to be able to set up all the soft­ware and sys­tems on each web site on a test basis, before switch­ing the old serv­er off and the new one on. In the mean­time of course, the old serv­er is still serving those web­sites with the same URLs. So I needed a sys­tem that allows the com­puter I’m devel­op­ing on to see the new sites reached from those URLs, while the rest of the world sees the old sites.

The way to do this is to edit the hosts file on the devel­op­ment machine. In a ter­min­al win­dow, type pfexec vim /etc/hosts. After the bot­tom line, which should look some­thing like 127.0.0.1 machinename.local localhost loghost, add the line(s) 127.0.0.1 websitename. You don’t even need to reboot or restart the Apache serv­er, which is nice. If it does­n’t work (you don’t see what you expect in your browser), take a look at your /etc/nsswitch.conf file and make sure that the hosts line has the files dir­ect­ive before the dns dir­ect­ive, oth­er­wise the sys­tem will ask the DNS serv­er (which will return the site the rest of the world sees) before ask­ing the hosts file on your sys­tem. One way to check which IP address you’re look­ing at to make sure you’re look­ing at your test sys­tem, not the out­side one on the net, is to use getent hosts websitename. This should tell you the IP address is 127.0.0.1. The com­mon altern­at­ive com­mand, host websitename, asks the DNS serv­er and thus will tell you what the out­side world sees.

Debug­ging the httpd.conf file is the next step, to make sure you have those vir­tu­al hosts set up cor­rectly. In the end, I just added 

NameVirtualHost *:80

<VirtualHost *:80>
  ServerName domainname
  ServerAlias domainname www.domainname
  DocumentRoot "/var/apache2/2.2/htdocs/domain"
  CustomLog "/var/apache2/2.2/logs/access_log" combined
</VirtualHost>

to the end of the exist­ing httpd.conf file. 

Update: I also had to add

  <Directory /var/apache2/2.2/htdocs/domain>
         Options Indexes MultiViews FollowSymLinks
          AllowOverride FileInfo
          Order allow,deny
          Allow from all
</Directory>

to the vir­tu­al host dir­ect­ive (just above the cus­tom log line) to make Word­Press’s pret­ti­er permalinks work.

The one thing OpenSol­ar­is does that is dif­fer­ent to the Apache doc­u­ment­a­tion is put­ting things some­where dif­fer­ent, so instead of using /usr/local/apache2/bin/httpd -S to debug the vir­tu­al host con­fig­ur­a­tion, you use /usr/apache2/2.2/bin/httpd -S. I learned the hard way that if you want to use a default vir­tu­al host, you have to define a ServerName for it.

To-Do List for OpenSolaris Installation

The next step in the OpenSol­ar­is odys­sey (here’s the first post) is to come up with the to-do list. I will prob­ably for­get a few things, but this list will get me star­ted (and remind me when I have to do this again in the future). Since I’m doing this for my per­son­al web sites, I don’t have to be ter­ribly effi­cient about meth­od­o­logy, as long as it all works in the end.

  • fig­ure out which web sites I want to rep­lic­ate on the new sys­tem and their require­ments for soft­ware and lan­guages (Ruby? Perl?) [mostly done]
  • find out how to change the DynDNS set­tings auto­mat­ic­ally on OpenSol­ar­is, i.e., wheth­er the script I’ve used without touch­ing for years on Debi­an will work
  • fig­ure out how to con­fig­ure vir­tu­al hosts on OpenSol­ar­is Apache, which is bound to be dif­fer­ent to the Debi­an Apache way of doing things [done]
  • set up log file archiv­ing and roll-over [done]
  • down­load and install Word­Press, one for each Word­Press sys­tem I main­tain [done]
  • down­load and install the pack­ages for the oth­er sites I run

Feed Oddities

My blog feed is behav­ing oddly and I can­’t quite fig­ure out what’s going on. I’ll post when I’ve found out enough to give a sali­ent descrip­tion, and when I find a solu­tion. Hope­fully it won’t take too long.

Update: it turns out to have been the Bird­Feed­er plu­gin, com­poun­ded with a stub­born cache. Guess I have to do some more work on fig­ur­ing out how to get Mint to work prop­erly with the site, but that can wait until tomorrow.

Installing OpenSolaris

Up till now I’ve had a Linux box in the base­ment, run­ning Apache and serving up a couple of web­sites, as well as act­ing as a fire­wall. Giv­en the box is an old Pen­ti­um 3, bought some 12 years ago, I’ve been nervous that it’s about to die at any moment, leav­ing me fire­wall-less and with a big job to migrate the web­sites in a hurry (yes, they’re backed up on a dif­fer­ent box, just in case). Both are good reas­ons to upgrade. Since Sol­ar­is is meant to be robust, secure, and all those oth­er good things, I figured I may as well see if it’s ready for prime time for home use serving websites.

First, the hard­ware. Tim had a spare Ultra 20 (what can I say? We seem to accu­mu­late com­puters without really try­ing to). That should run Word­Press a little faster than the old Pen­ti­um 3…

Next, the soft­ware. Installing OpenSol­ar­is 2008.11 was a snap — burn the CD of the iso image, put it in, turn it on, fol­low the instruc­tions. When Sol­ar­is boots from the LiveCD, hit the “install” icon and wait a bit. Quick­er and easi­er than most oth­er OSes I’ve tried recently! I con­sidered using zones, but then decided I was going to use the entire sys­tem for serving a couple of web­sites and for me there was­n’t much bene­fit to secur­ing them from each oth­er. If I were allow­ing oth­ers access to the web­sites, or was­n’t sure what people would do with them, installing each in its own zone would be a good idea, but it would be overkill for me right now. I can always add a zone later (or a vir­tu­al OS, for that mat­ter) if I want to play around with oth­er stuff. I did turn on TimeSlider though, to make rolling back errors easier.

Now to the fun stuff, set­ting up Apache. I’m used to the Debi­an way of doing things (Debi­an always Has Its Own Way To Do Things), so I need to fig­ure out the Sol­ar­is Apache way. First, I installed the soft­ware. That’s easy, you just fol­low the instruc­tions at Set­ting Up Your AMP Devel­op­ment Envir­on­ment, using pfexec pkg install amp-dev. I have no need to save disk space, so I installed the lot and ini­tial­ized it per the instruc­tions. Next, I wanted to make sure it was up to date. It looked much easi­er than the last time I tried to update a Sol­ar­is install­a­tion; there’s a menu item under Sys­tem called Package Manager which brings up a pro­gram that looks easy enough to use. Update All should mer­rily go off and update everything. First it announced it would cre­ate a boot image, which seemed to suc­ceed, and then it tried to install the rest, res­ult­ing in an error message: 


An unknown error occured while installing
updating or removing packages

Please let the developers know about this problem by filing
a bug at http://defect.opensolaris.org

Exception value: 
[Errno 17] File exists: '/tmp/tmppGRerC'

(spelling mis­take theirs).

Just to be sure that the /tmp dir­ect­ory was cleaned out prop­erly, and noth­ing weird was going on, I rebooted. And was presen­ted with what looks like a GRUB menu with three items. Which should I choose? I don’t know, so I picked the bot­tom one, opensolaris‑1, since that was­n’t there last time I booted. This time, the Update Man­ager announced that updates were avail­able, if I clicked on the icon, which I did, but no updates appeared to be avail­able, which was a little weird. So I went back to the Pack­age Man­ager to try to install the updates I’d down­loaded last time, and it claimed there were no updates avail­able either. OK, maybe I’ll believe it.

Now it’s time to read the doc­u­ment­a­tion on set­ting up the web stack. I know, real pro­gram­mers don’t RTFM, but I nev­er claimed to be a real pro­gram­mer, so I’m allowed to.

More later…

Snow and snow

We spent Christ­mas and a few days either side in Sakat­chewan, land of ‑27 C days and even colder nights. But, as it turns out, little snow. Driv­ing along High­way 1 you could see the stubble of plants stick­ing out of the slim white cov­er­ing, giv­ing the hori­zon a green-brown tinge. There was more snow in sheltered places, dry and feath­ery, the sort of snow that does­n’t get you wet when you fall in it as it brushes off so easily.

Com­ing home to Van­couver it was a dif­fer­ent story. We missed out on being there for the almost-record snow­falls (I gath­er we only need anoth­er 2 cm to beat the record set in 1964), but enough remained on the ground to require lots of snow-shov­el­ling. Maybe next year I’ll break down and get a real snow shovel with bet­ter ergo­nom­ics; my back muscles are groan­ing using our emer­gency fold­ing one with its too-short handle. Snow at tem­per­at­ures around zero C is wet and sticky, not at all feath­ery, and it does­n’t brush off eas­ily. In places the snow has the choppy look of whipped egg whites that have star­ted to break down, in oth­ers like smooth piles of icing sug­ar, 60 cm (2 feet) or more thick. On the roads it’s a dirty grey col­our, piled high in spots, inter­spersed with pock­ets of water that can­’t make it to the storm drain and pock­ets of ice where the sun can­’t reach. 

It was the first coast to coast white Christ­mas since 1971, and we’re in the middle of anoth­er snow­fall warn­ing with snow fore­cast for the next three days (which should eas­ily break that record). I’m glad I work from home.