Personal tools
Navigation
Log in


Forgot your password?
New user?
 
Document Actions

WebPerfCache and apachectl

Folks,

Just one item this week, but it was a pain in the neck. I recently spent a couple of days banging my head against the keyboard trying to figure out why my website wasn't working right. Let me take a step back and explain how my website is set up.

  1. The front end Apache web server accepts an incoming request.
  2. The Apache web server requests the correct page via a rewrite rule and Apache's proxy module from the Plone application server.
  3. The Plone application server generates the actual page and returns it to the Apache web server.
  4. The Apache web server returns the page to the browser.


I tried going directly to my Plone app server from a browser. This worked just fine — the correct pages showed up no problem. I tried going through my web server, but I got the old version of my page. I flushed Plone's cache — same result. I flushed my browser's cache — still got the old page. I tried a different browser — still got the old page. I tried deleting all of the files in /var/run/proxy, which is where Apache's proxy module stores cached files — still got the old page. I tried turning the web server off (using the command line "sudo apachectl stop"), deleting the proxy cache files, then starting it up again (using "sudo apachectl start") — still got the old page. OK, what am I missing here?


I turned off the web server again by using "sudo apachectl stop", flushed my browser's cache, and tried to load the page — and I still got the old page! How in the world was I able to load a web page from a machine whose web server is off?! I flushed my browser's cache, so it can't be coming from there. OK, who's guessed by now what I missed?

That's right, the web performance cache that is a part of Mac OS X Server. Turning off the web server by using the apachectl tool does not turn off the web performance cache, and the web performance cache still had the old version of the web page. The Right Way To Do It is to use "sudo serveradmin stop web", followed by "sudo serveradmin start web". Alternatives are to use the Server Admin application to turn the web service off and then on again, or to kick the web performance cache directly with the webperfcachectl command line tool.

Here's hoping we all got a good lesson out of this — Mac OS X Server is not a straight-up Unix system. Apple has put in many useful additions, but we need to be careful about how we go about working with it.


--Paul


Powered by Plone, the Open Source Content Management System