On Friday 07 January 2005 11:58 am, you wrote:[...]
(cc'd to ZPUG list, since we've had several conversations about
Zope/Plone setup. This is just some info and scripts I use to make
site creation/startup/stopping/etc easier for my development box.)
The goal here is:
1) be able to create a new, working instance of Zope/Plone quickly, so
when I want to test things, answer questions, or start a new project,
I can create a new instance in 3 seconds, and not 10 minutes. Then, I
never re-use crufty "test" installations, etc.
2) be able to control (start/stop/debug) my Zope/Plone instances
easily w/o having go into the right directory and call zopectl/zeoctl
from there.
Ok, so here's the setup:
/usr/local/zope/ (dir for all Zope software versions)
/usr/local/zope/zope272 (installation of Zope 2.7.2)
/usr/local/zope/zope273b1 (installation of Zope 2.7.3b1)
... etc ..
/usr/local/zope/zope_current (softlink to "current" version. Let's me
quickly switch to a new/old Zope version w/o having to change any
instance setup.)
/var/zope/Products (all products I have downloaded!)
/var/zope/foo ("foo" $INSTANCE_HOME; have one for each Plone site)
$PATH/bin/mkzope: script to make a new Zope instance in /var/zope
$PATH/bin/zeoctl: script to control any ZEO server I have
$PATH/bin/zopectl: " " " Zope server " "
$PATH/bin/zbothctl: script to control both ZEO and Zope at once
zeoctl, zopectl, and zbothctl are actually same script, but
softlinked under different names.
So, I can create a new Zope instance as:
$ mkzope bootcamp "Bootcamp test site"
which creates /var/zope/bootcamp, using zope_current dir,
sets up ZEO, etc. The string in quotes is just dumped into the
file /var/zope/bootcamp/instance, so I can look there later on to
remember what this Zope instance was for (I tend to have dozens on my
machine at once from various presentations, conferences, etc.)
$ mkzope bootcamp "Bootcamp test site" plone_standard
Does the same, but copies everything
from /var/zope/plone_standard/Products
to /var/zope/bootcamp/Products--giving me the "usual" plone stuff. I
can use any site name instead of plone_standard to copy their
products.
$ mkzope -s bootcamp "Bootcamp site" plone_standard
Does the same, but also starts the site!
Then I just go to http://localhost:8080,
and it's there.
To control it, I can
zbothctl bootcamp start
zbothctl bootcamp fg
zbothctl bootcamp debug
zbothctl bootcamp stop
to start, start-in-foreground, debug, or stop both Zope and ZEO. Or I
can say "zeoctl" or "zopectl" to control only ZEO and Zope. So it
becomes easy for my to say things like:
$ zbothctl bootcamp stop
$ zbothctl foo debug
to quickly stop the bootcamp site, and start the "foo" site in debug
mode (assume they're on the phone with questions).
Anyhoo, you might find these helpful or not. They're **not** intended
for production (where it would be dumb to make it trivial to bring
down a site or change the Zope version for a running site!), but for
your development box/laptop. They're just little shell scrips, but
they save me lots of dorky typing.
- j.
P.S. Please don't make fun of my shell scripting mojo. I know I suck.
If you want to re-write these in Python, that would be awesome!
P.P.S. BTW: these assume you've changed
the /usr/local/zope/zope_current/skel/etc/zope.conf.in to reflect the
Zope setup you like. I always change this to (a) use ZEO (b) turn off
WebDAV (c) be a little less verbose in foreground mode, etc. I keep a
diff around of my changes to this file, and just apply it to new Zope
versions when I drop them into /usr/local/zope. This way, I don't
have to hand-edit zope.conf for each new site or for each new zope
version. Attaching that patch file, too.
[...]
|