Home > Weblog Archive >  2007 >  June >  8


       

Apache question

Friday, June 08, 2007 by Dave Winer.

The server that runs this site is running Windows 2000 and Apache for Windows. My CMS is the OPML editor. I use a desktop tool to communicate with the editor on the server via XML-RPC. Permalink to this paragraph

When I save the document locally, it sends a copy to the server, where it renders it in HTML and writes a file in a folder that Apache serves from. Permalink to this paragraph

There are two applications running on the server, one writes into the folder and the other serves from the folder. The first is the OPML Editor, the second is Apache. (There actually are other apps on the server, but I don't think they're part of the problem I'm describing.) Permalink to this paragraph

This usually works fine, but one in 20 times (or so) there's trouble. When the editor tries to write the file, it gets an error, saying the file can't be accessed. When you try to access the file in a web browser (the home page of this site) you get an access error. (I'll link in a screen shot next time it happens.) Permalink to this paragraph

The only way to clear the error is to quit the OPML Editor, restart Apache, and relaunch the OPML Editor. Then it all starts working, until it happens again. Permalink to this paragraph

My current theory is that the OPML Editor is trying to write the file while Apache is reading it, and somehow this puts both programs into an untenable condition (the latter part is really confusing). Permalink to this paragraph

So I guess the question is this -- is there any way for an app running on the same machine to lock a file, like a semaphore, to basically wait until Apache isn't using the file, causing Apache to stand by until the semaphore clears. There must be some way to avoid this, other than the manual workaround I've found. Permalink to this paragraph





© Copyright 1994-2007 Dave Winer Mailto icon.

Last update: 6/8/2007; 3:55:54 PM Pacific. "It's even worse than it appears."

Click here to view blogs commenting on  RSS 2.0 feed.