Advertisment

Build Web Apps with Zope

author-image
PCQ Bureau
New Update

Zope is an open-source application server that comes with a database, an HTTP and FTP server, WebDAV (Web-based Distributed Authoring and Versioning) and XML-RPC capabilities for Web services. It can be used with an external Web server and RDBMS, as well. There are applications built on Zope to cater to specific needs, such as content-management systems, e-commerce applications and publication systems. With some dabbling in the Zope environment and Python, you can write your own applications on it too. Hence, Zope can cater to various requirements very well. You can maintain a personal Website, an e-commerce site, a Web service, etc. We’ve given it on this month’s PCQ Essentials CD in the Linux section.

Advertisment

Here’s how to get started. 

Installation



Zope is written in Python, so you need Python 2.1 and upwards for installing and running it. You can get the binary or source distribution if you want to compile Zope for your platform on your own. We’re carrying the binary distribution of the latest (as of now) stable Zope release, namely v2.6.1. We have setup Zope on PCQLinux 8.0.

All you need to do is unpack the tar ball and run the install script. But, there are a few things you need to note. One, Zope comes with its own Web-server (Zserver) and its own database (ZODB). You can use Zope with your existing Web-server but that requires installation of PCGI (Persistent CGI) or FastCGI that Zope uses in place of regular CGI, which serves each request anew, non-persistently. There is a detailed document in the doc directory with Zope called WEBSERVER.txt, which you should go through to configure Zope with your existing Web server, say Apache.

Advertisment

You don't need to be the root user to install or run Zope if you use its default server. But, let's assume you are running as root.

Here is what you need to do on the terminal window:

First create a directory, say zope_home, where you will extract the Zope tar ball. Then copy the tar ball and extract it here as follows: 

Advertisment

# cp /cdrom/linux/Zope-2.6.1-linux2-x86.tgz /home/zope_home



# cd /home/zope_home


# tar -zxvf Zope-2.6.1-linux2-x86.tgz 


Now you will see a folder called Zope-2.6.1-linux2-x86, which contains the installation script. Run it as follows:

# cd Zope-2.6.1-linux2-x86



# ./install 

You can give options with the install script such as the username and groupname with which you want to intall Zope and the location for the generation of PCGI files. When the script runs, it will start compiling the Python modules and finish up by showing you the default username (admin) and the generated password, which you will need to log into Zope's management module. This password is again required to manage Zope from the browser. You can change this password by running the python script zpaaswd.py as shown:

Advertisment

# bin/python zpasswd.py -u admin -p password inituser

The zpaaswd.py script takes the username, password and a filename where these values have to be stored as arguments. The filename 'inituser' is a Zope default. 

Start Zope



If you're running Zope as root, you will have to do an important thing before you start Zope's server to access Zope. Set the sticky bit to the var directory so that users don’t have the right to delete files from the directory but have other ones as:

Advertisment

# chmod o+t var



Now you can start. 

# ./start -u root



Remember to start as root by specifying the -u option. 

Using Zope



The first thing to start using Zope is to go to the management interface. Connect to Zope on the IP address of the computer that is running Zope by entering it into the address bar of your browser. Zope’s server runs on port 8080 by default. The management interface is at :8080/manage

Advertisment

Once here, you will get a file browser-like interface with the left pane containing Control Panel, examples and users. 

Zope comes with a tutorial and lots of documentation. The Zope book can be accessed online and is also available on this month’s CD. 

Besides that, run the Zope tutorial. Click on the tab that says

Provide an Id, such as ‘Tutorial’. Now you can use the tutorial. This should get you started with

Zope. 

Shruti Pareek

Advertisment