[ZDP] Euhm, forget previous mail about ZServer....
Tom Deprez
Tom Deprez" <tom.deprez@village.uunet.be
Thu, 20 May 1999 01:28:05 +0200
Hi,
Here is a rewrite of several parts :
II.3 Architecture
When a HTTP request comes into a HTTP server it is passed to the Zope
Publisher. The Zope Publisher in turn passes the request to the Zope Object
Request Broker. The ZORB breaks the request into several parts and finds
from this information the exact object to publish, which may be in the
requested location, or acquired from above. The object then is asked to
publish itself. It does this by returning a template which is passed back up
to the Zope Publisher, throught the ZORB. The Publisher renders the
template, calling the ZORB to render variables or make calls to other
objects, using the original environment of the object. This final
information is returned to the HTTP server.
Seeing at the architecture, we can see several modules in a layered
structure. Thanks to the layered approach, i.e. dividing the publishing
process into a number of discrete steps, the system is easily adjusted or
upgraded to new protocols. Changing one layer doesn't affect the others and
vice versa, because they aren't interwoven.
Please, remark that however we only speak of a HTTP server and its HTTP
Protocol, we're not totally correct to do so. We've only talked about HTTP,
because this is the first and most expanded protocol in Zope for the moment.
The FTP protocol is recently added, as WebDav.
II.3.1 ZServer
Previously we were talking that Zope could be used with almost every
WebServer (cgi enabled) on the planet and here we are, talking about a
server layer. Oh no, we weren't talking rubbish in the previous paragraphs.
It's still possible to use Zope with another webserver, although you might
loose some flexibility, like FTP. Now you may think that this the bottleneck
of Zope: 'You can use another webserver, but you loose some of the benifits,
so we push you to use the ZServer'... On the contrary! It is even possible
to make a construction so that ZServer acts as a layer between Apache and
ZServer. And this set-up, gives you the benefits of both worlds: i.e. with
Apache, you can still publish 'normal' web-sites and you can use the extra
benefits which Apache offers, like virtual servers etc. On the other hand
however, thanks to ZServer, you can access Zope through FTP and WebDav.
Isn't this a beauty? However, how beautifull it may sound at first, if
you're a beginner, I would advice you to wait for creating such
constructions... because it asks for several settings. So, at first I would
advise you to only use ZServer (or if you're already experienced with
another WebServer, use that instead). Why do I advise you to use ZServer if
you're a beginner? Well, ZServer is easy installed, almost no configuration.
And that's a releave if your a totally beginner. Ever installed Apache? It's
great, but you've to set several configuration files and therefor you need
to know what you're doing... So most of the time -seeing the tremendous
benefits of using ZServer- Zope will be installed to use it's own build in
server, as stand-alone webserver or acting as a layer. So, we can think of
the Z Server as the general first layer of Zope (see picture of our
architecture).
That said, we can actually talk about ZServer. ZServer wasn't there with the
first release of Zope. It's precessor is called ZopeHTTPServer which is a
simple Python based webserver. And, if I may give my advise, it would be
even better to install ZopeHTTPServer than ZServer. ZopeHTTPServer needs
totally no configuration! And it works immediately. Offcourse, there is also
another side of the coin: it lacks on performance and other feasabilities
compared to other web servers. For instance, it can only publish via HTTP
and can only publish one module at a time. And it has no support for thread
pools. To overcome these problems, a successor is created, named ZServer.
ZServer itself is based on Medusa, which is created by Sam Rushing and by
which the Zope creaters have an agreement with. Also Medusa is a Python
server framework. Besides getting rid of the limitations of ZopeHTTPServer,
ZServer gives HTTP, FTP, WebDav and PCGI access. Other protocols will
probably follow (eg. FastCGI). So, ZServer is not only an HTTP Server, like
Apache, it is more. But then again Apache is very specialised as a HTTP
Server.
If you need more information on the provided protocols, then you can read
the following paragraphs
FTP Support
What is so special about this FTP support? Well, FTP support can become very
handy when creating your website. Instead of getting the rendered document,
because that's what you get you use the HTTP protocol, you get the contents
of the document. Besides this benefit, you get all other FTP protocol
benefits (like navigating the object hierachy with 'cd' command), next to
the things you can also do when working with HTTP protocol (e.g. replacing
content of Documents, Images and files. Creating or Deleting them).
WebDav Support
At the moment, WebDav is a relative newly protocol. It's almost nowhere
implemented... that it is implemented in Zope, only gives you an idea how
fast Zope is growing and updated! Basically, WebDav is an extension to the
HTTP/1.1 protocol. It uses some extra HTTP commands, like 'OPTIONS' to
implement it's functionality. Traditional webservers block commands they
don't recognize (even Apache needs a patch to allow these extensions of the
HTTP protocpm), instead of propagating the command to Zope, resulting in
breaking WebDav. Note however, that blocking of unrecognised commands is a
good policy. It surely makes everything much safer. In simple words WebDav
means that you can open an URL as a Web Folder. Its just like you would open
a local folder on your computer, but now this folder resides somewhere on
the net.
PCGI Support
The PCGI support enables the possibility to forward request from another web
server to ZServer. The other web server is then in charge of controlling the
CGI environment and HTTP headers. So this means that you're not using
ZServer for HTTP requests. The speciality of PCGI is that it provides web
applications with a long-running server process in which to operate. Thus
alleviating performance problems associated with CGI programs. Do think
however that with this method, you've to manage the environment of the other
web server which can impose a large overhead if you're not acquinted with
that one. But ofcourse, it can give you the benefits of both worlds (ie. the
large support of protocols by ZServer with the specialities of the other web
server). PCGI was originally developed at Digital Creations, but leadership
of the project has now shifted to Jeff Bauer, a well-known Zope developer.
II.3.2 Zope Publisher
Z Publisher is the layer that communicates to the external environment,
which is usually, like explained in the previous paragraph the Z Server
itself (occasionally another web server), but may be any properly designed
program, or example, ZClient is a program which permits Z Publisher access
to be easily scripted without needing an active web server or HTTP calls.
There exists several protocols which can be used in conjunction with your
choosen web server. Among others, Zope can be accessed through CGI, PCGI,
FastCGI, Netscape's Web Application Interface (WAI), COM, Medusa (which
provides HTTP, WebDAV, and FTP), and the included ZopeHTTPServer. Zope can
even listen to different protocols simultaneously, into the same object
system. Zope is moving towards ZODB3, which will provide concurrency, and
allow truly multi-threaded access to the object database.
The Z Publisher itself contains several modules. One of these modules is the
Zope Object Request Broker. Because Z ORB is the mostly used module of Z
Publisher, most of the time, people use these two terms in one sentence. So
sometimes when speaking of Z Publisher, people mean the ZORB and vica versa.
Tom.