Apache and Logrotate

I use apache to serve a few sites from the fire­wall box in the base­ment and for some reas­on it kept dying on a reg­u­lar basis. This star­ted fairly recently, some time after I set up sep­ar­ate access log files for each of the sites.

The error logs showed entries like 

[Sun Jun 10 06:28:03 2007] [warn] child process 16516 still 
did not exit, sending a SIGTERM

which seemed bizarre and wer­en’t being spawned by any­thing obvi­ous in the access logs. I even­tu­ally remembered that I had set up log rota­tion for each of the vir­tu­al hosts, and went search­ing through the error logs to see if it was related. Sure enough, the shut-down was hap­pen­ing at the same time, and so the log rota­tion was likely to be related to the cause. But what could be the real cause? Surely not just rotat­ing logs…

A bit of pok­ing around the web found that oth­er people have had this prob­lem. I went down a bunch of dead ends (vir­tu­al hosts? apache2ctl restart vs apache2ctl start?) and even­tu­ally just turned error report­ing up to the max­im­um. The next week, after the serv­er went dead again, I found the fol­low­ing email in my sysad­min inbox.

/etc/cron.daily/logrotate:
(98)Address already in use: make_sock: could not bind to 
address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
error: error running shared postrotate script for 
/var/log/apache2/*.log
run-parts: /etc/cron.daily/logrotate exited with return 
code 1

Hunt­ing around more on the web, I found a recom­mend­a­tion to expli­citly set the TMPDIR envir­on­ment vari­able before run­ning logrotate. Apache has now been up for a few weeks without fall­ing over, prob­lem solved! I’m still not sure why this only star­ted to hap­pen after set­ting up sep­ar­ate log files for the sep­ar­ate vir­tu­al hosts, or even if that was more than a prox­im­ate coincidence.

Knitting and XML

Eve’s XML and knit­ting ana­logy got me thinking.

You can think of a writ­ten knit­ting pat­tern as being the schema, with a set of instruc­tions, just like the schem­a’s con­tent mod­el. Then each knit­ted item you make that con­forms to that knit­ting pat­tern is like the doc­u­ment instance that con­forms to the schema. Schem­as can be restrict­ive or allow lots of instance struc­ture vari­ations, as can knit­ting pat­terns. And, to tie it into my pre­vi­ous post on knit­ting and copy­right, a schema can be copy­righted (and often is). The ana­logy does have a few prob­lems when you start try­ing to fig­ure out the rela­tion­ship of the set of tags in a doc­u­ment instance and the con­tent with­in those tags; if you think of the knit and purl stitches as being the ele­ments, then the yarn would be the con­tent. Except for, yarn can­’t really be ori­gin­al in the same way as the con­tent in an XML doc­u­ment can be. Some people may dis­agree when it comes to hand-painted yarns, of course.

Virus Spam

Spams car­ry­ing vir­uses aren’t any­thing new but every now and again some­thing comes into my email box that is a bit dif­fer­ent. Like this one.

Dear user of textuality.com, mail system administrator of 
textuality.com would like to let you know the following.

We have detected that your account was used to send a 
huge amount of spam during this week.
Obviously, your computer was infected and now contains a 
trojan proxy server.

We recommend that you follow our instructions in the 
attachment in order to keep your computer safe.

Virtually yours,
textuality.com support team.

Since the email was­n’t from my ISP, and if there’s a “mail sys­tem admin­strat­or” that isn’t my ISP, it would be me, it’s obvi­ous that this is spam. Even without those clues, the email is sus­pi­cious. The wor­ry­ing thought is that it has per­haps just enough per­son­al­iz­a­tion to dupe some people into open­ing the attachment.

Privacy and Identity

One of the bet­ter pieces on iden­tity and pri­vacy that I’ve read recently, and well worth every­one read­ing, wheth­er you do any­thing much with iden­tity man­age­ment or not, is from Dav­id Wein­ber­ger. Iden­tity man­age­ment in an unequal world dis­cusses how when sign­ing up for things is easi­er, people can take advant­age of that to ask us to sign up more often, to give more inform­a­tion than we really need to. I’ve been well trained at Sun to ask now why any­one needs the inform­a­tion they’re ask­ing for. Can­’t they do with less inform­a­tion? What are they going to do with it? These are the basic ques­tions every­one needs to ask every time some web site or shop asks for per­son­al inform­a­tion of any sort, basic­ally why do they want it and why do I need to give it? If more people ask the reas­on why, maybe few­er com­pan­ies will be need­lessly intrusive.

Facebook

I got talked into join­ing Face­book last week; ok, I’m late to the party but not quite as late as Derek Miller. It’s an inter­est­ing place in many ways, feels like it has more or less achieved what Orkut (remem­ber Orkut?) was try­ing to do. 

The big dif­fer­ence to Orkut is the people who are there, or at least the people I can find who are there. Face­book seems to have three major groups of people:

  • recent and cur­rent uni­ver­sity and col­lege stu­dents (not sur­pris­ing, giv­en where it came from)
  • par­ents and rela­tions of the above, who want to see what their young rel­at­ives are up to
  • Web 2.0‑style web geeks

Not sur­pris­ingly, the lat­ter group are gen­er­ally tak­ing full advant­age of being able to add applic­a­tions on top of Face­book, and cus­tom­iz­ing their pro­file pages, and gen­er­ally show­ing the rest of us how much time you can spend doing these things. Me, I’m try­ing to think through some of the pri­vacy implic­a­tions before I hook up my Dopplr account, and the copy­right implic­a­tions before I start put­ting my blog post­ings up there.

I even­tu­ally deleted my Orkut account, des­pite hav­ing lots of con­nec­tions, because I just nev­er went there, the con­tent was­n’t inter­est­ing enough. Face­book is strangely com­pel­ling, it’s easy to browse through groups and rely on serendip­ity to take you inter­est­ing places. A bit like the web itself, in micro­cosm. It’ll be inter­est­ing to see how my usage develops.

Website Connections

One of the themes of the Gil­bane Report art­icle I wrote some time ago on Blogs and Wikis: Tech­no­lo­gies for Enter­prise Applic­a­tions? was that people can use blog soft­ware as an easy way to cre­ate a web site that does­n’t look like a blog. It’s easy to update the con­tent, easy to add more con­tent, and although some thought needs to go into the design of the site, it’s still a much more reas­on­able under­tak­ing than more “tra­di­tion­al” ways of cre­at­ing a com­mer­cial web site. Which enables even small com­pan­ies to under­take the task, although it’s still some­times a little nerve-wrack­ing for those who aren’t embed­ded in the com­puter world.

Recently I man­aged to con­vince Mair­in, who runs the Dianne Miller Pil­ates Cen­ter, where I do Pil­ates on a reg­u­lar basis, that the web site needed updat­ing, and that blog soft­ware would be the right way to do it. Then I put her in touch with Kim who did the actu­al work of installing Word­Press, installing some use­ful plu­gins, pick­ing a reas­on­able selec­tion of themes, then tweak­ing the chosen theme and plu­gins to make the site look just right. We both helped teach the people doing the con­tent how to enter the data. And now the site is live, has been for a couple of months, and it’s made life at the stu­di­o’s recep­tion a whole lot easi­er. People can find out what the stu­dio teaches, what the philo­sophy is, and then call to get more per­son­al­ized inform­a­tion, where pre­vi­ously the recep­tion­ists had to explain again and again all the basics on the phone.

It’s so easy for those of us in the soft­ware busi­ness to get car­ried away with the new­est and greatest and for­get just how much an applic­a­tion of even rel­at­ively simple soft­ware, where the basic prin­ciples have been around for ages, can help. And, incid­ent­ally, that com­puters are still nerve-wrack­ing for lots of people.