No matter what language and operating system you use, web development typically means working with HTML files, graphic files, standalone programs, hybrid HTML/code templates and a connection to a relational database. Experienced developers can move easily from Perl to PHP to ASP because the concepts translate from one language to another with only minor variations. This convergence of paradigms has been convenient for developers, at the cost of complacency and laziness in the web development community.
Luckily, the open-source Zope application server is there to shake us from our complacency and open our eyes to new ways in which we can develop web applications. Zope, written and supported by Zope Corporation (formerly Digital Creations), changes everything that you ever knew about web development. You still can create dynamically generated content and work with relational databases, but Zope does so in very different ways from every other application server on the market.
This month, we begin to explore Zope as a web development platform. Along the way, I hope it becomes obvious that while Zope is different from other environments, its elegance and power make it a strong contender for open-source enthusiasts.
Part of the difficulty in understanding Zope is that it's actually several things at once. Simply put, Zope provides you with everything you need to create web applications. Installing Zope gives you a simple HTTP, FTP and Web-DAV server (known as the ZServer), an object database (known as ZODB) and a framework for creating server-side web applications.
Most of Zope is written in Python, which means that it is ported across platforms easily. And while it makes sense that a program written in Perl, Python or Java can run equally on Linux and Windows easily, it is still unusual for a prominent open-source system to run on Windows.
A typical web site has a mix of static HTML files, templates and graphic files. When the HTTP server receives a request, the server determines what kind of file was requested (by looking at the file's extension, location and MIME type), executes any necessary code inside the file and returns an HTTP response.
In Zope, nothing is stored on the filesystem. Rather, all site content and programs are stored inside of the ZODB object database. (The database itself typically is stored as a large disk file, which can be backed up or copied to backup Zope servers.)
To create a simple HTML file, you will need to create a “file” object in ZODB. To display an image on the web site, you will need to create an image object in ZODB. And to execute a piece of code when a certain URL is invoked, you must store the code in ZODB.
Luckily, storing and retrieving items in ZODB is quite easy. Zope takes care of most of this for you, allowing you to set high-level parameters at installation time. Moreover, Zope is designed so that it can be controlled completely via one web browser. You can use one of Zope's web-based tools, which makes it possible to create, edit and administer a web site using nothing more than your web browser. So you can create, modify or delete any content on the site (HTML, images or directories) using your browser.
If you prefer to edit text (and code) in Emacs rather than in a web text area, the ZServer supports FTP, displaying the objects in ZODB as if they were in a filesystem hierarchy. If you (and the nontechnical staff that you trained) previously were using FTP to transfer files to and from your web server, ZServer's FTP implementation will allow you to continue along that path almost seamlessly.
For all of its complexity, Zope is surprisingly easy to install. You will need to download the latest version from www.zope.org (see Resources). After you choose the version that you want to download, switch into your Zope directory (typically /usr/local/zope/, but anything will do), and unpack the Zope file:
mkdir /usr/local/zope cd /usr/local/zope tar zxvvf /downloads/Zope-2.4.3-linux2-x86.tgz
Opening up the Zope archive reveals a number of directories, including:
bin, where the Zope startup and shutdown scripts are located.
doc, where the complete Zope documentation is kept.
lib, where Python and all of the various Zope applications (known as products) are kept.
ZServer, which contains the classes necessary for the ZServer.
utilities, which contains several Zope-related utilities.
Before you can start Zope for the first time, you must install it with the install script. Only run this script after you have placed the Zope files in their final location, since install uses the current directory name to set several global configuration values.
After you have finished installing Zope, you can start it up by running the start script in the main Zope directory. By default, this script starts Zope's HTTP server on port 8080 (with an FTP server running on another port). You can change these values with a command-line switch; a full list is available by typing start -help.
While Zope is written largely in Python, Python does not need to be installed on your system. Zope comes with its own copy of Python, which it uses instead of whatever is on the operating system. This decreases the chances for version problems and errors. As of this writing, Zope uses Python 2.1 (the latest stable version), but Python 2.2 should be coming out in the near future. It will be interesting to see when Zope adopts it.
The install script not only sets up the initial Zope configuration, but also creates a hard-to-guess password for the system's “admin” user. We will need this password in just a few minutes, so be sure to write it down.
Practical Task Scheduling Deployment
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.View Now!
|The Firebird Project's Firebird Relational Database||Jul 29, 2016|
|Stunnel Security for Oracle||Jul 28, 2016|
|SUSE LLC's SUSE Manager||Jul 21, 2016|
|My +1 Sword of Productivity||Jul 20, 2016|
|Non-Linux FOSS: Caffeine!||Jul 19, 2016|
|Murat Yener and Onur Dundar's Expert Android Studio (Wrox)||Jul 18, 2016|
- The Firebird Project's Firebird Relational Database
- Stunnel Security for Oracle
- My +1 Sword of Productivity
- SUSE LLC's SUSE Manager
- Non-Linux FOSS: Caffeine!
- Managing Linux Using Puppet
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Parsing an RSS News Feed with a Bash Script
- Google's SwiftShader Released
- Doing for User Space What We Did for Kernel Space
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide