翻譯:taowen
以下的內容僅代表我個人的觀點并不代表其他的任何人。如果我犯了什么錯誤,請讓我知道,我會更正它的。在ZDP (Zope Documentation Project)和Faqts.com上都已經有Zope的FAQ了。我為什么要另外再作一個?他們的沒有以我作的方式來安排內容,并且他們沒有回答我是一個完全徹底的初學者的時候的一些問題。這個網站非常有助于我掌握Zope,因為它把知識從一個人傳遞到其他的人,通過建立我自己的FAQ,希望我自己能夠學習更多東西。我發(fā)現(xiàn)當我嘗試解釋什么東西的時候,發(fā)現(xiàn)我自己也沒有真正的理解它雖然我曾經認為我理解了。并且一旦我完成了某個實際的工作,我會傳授這我已經了解的主題,但是其他人不會。
一般性信息
什么是Zope?
為什么我要去使用Zope?
誰開發(fā)了Zope?
我在哪兒能夠獲得Zope?
有ISP支持Zope嗎?
如果我使用Zope,我能夠得到支持嗎?
Zope與哪些product競爭?
運行Zope我需要一臺快速的電腦嗎?我能夠使用我舊的486嗎?
Zope最適合的平臺是什么?Linux?BSD?Windows?MacOS X?Solaris?HP-UX?
Zope有多快?我能用它來建立Slashdot part deux嗎?
誰使用Zope?有哪個我聽說過的人評論過Zope嗎?
使用Zope我需要學習什么?
Zope有什么書嗎?
我不是nerd,我還能使用Zope嗎?
Zope有什么教程嗎?
給我一個Zopeproduct的例子。
Zope太復雜了。
或者我有其他我不喜歡Zope的理由。
其他相當?shù)南到y(tǒng)有哪些?
安裝和配置
我如何來安裝Zope?
當我載入Zope,他在我的屏幕上顯示文本并且我必須打開另外一個終端窗口。
我不能登陸進Zope — 它需要用戶名和密碼。
我想要我的站點看上去像 www.foo.com,不是www.foo.com:8080。
我已經登陸進Zope了,但是它不讓我創(chuàng)建任何東西。
log文件在哪兒?
我如何得到關于我的網站的統(tǒng)計數(shù)據(jù),進來的人的列表,以及其他的?
我使用Analog從我的log文件中創(chuàng)建stats并且我沒有看到任何有用的信息。
我懂Perl。我需要為了學習Zope學習Python嗎?
我即不懂Perl也不懂Python。
我要學習哪個?
我能在Zope上用哪些種類的數(shù)據(jù)庫?
在Zope中我為什么要使用另一個數(shù)據(jù)庫?
我想Zope本身包括一個數(shù)據(jù)庫?
我在Zope中能運行多于一個站點嗎?
我能作像Apache或者IIS那樣的虛擬主機嗎?
我嘗試在MacOS X上安裝Zope 2.4.0并且我得到關于ZSplitters這些東西的錯誤信息并且現(xiàn)在我的頭要裂開了。哪兒出問題了?
性能
我想要建立一個超級快的Zope服務器我需要些什么?
我已經建立了我的超級快的Zope服務器了。我如何測試它來確保當我鏈接到Slashdot時不會崩潰。
我如何測試和調試我的Zope服務器?
常見問題
我正在嘗試在Windows ME 或者 Windows 98上運行Zope而當我啟動Zope的時候我的電腦崩潰了。
我想要把Zope作為一項服務在Windows ME中運行。
我在Windows上安裝了一個新版本的Zope但是它不能作為服務來運行。
我啟動了Zope但是當我嘗試使用我的Web瀏覽器登陸的時候什么都沒有發(fā)生。但是FTP正在工作。
有什么辦法能夠在它down掉的時候自動重啟Zope嗎?
安全
Zope有多安全?
我聽說了一些壞的事情。我在哪兒能夠找到關于Zope的內建安全機制的更多信息?
一般性信息
1.1 What is Zope?
什么是Zope?
Zope is software you run on a server to publish dynamic web sites.
Zope是你在服務器上運行的軟件來發(fā)布動態(tài)的web站點的軟件。
(A dynamic web site is one where every page is assembled as it is requested, usually from a database.)
動態(tài)web站點是每個頁面都是被請求的時候才生成,并且通常是從數(shù)據(jù)庫中生成的站點。
It consists of a web and ftp server, a middle layer which coordinates getting things into and out of the database, and an object database.
它包含web和ftp服務器,一個中間層來協(xié)調把東西從數(shù)據(jù)庫中取出和存入,以及一個對象數(shù)據(jù)庫。
You can leave out the web server and run Zope behind Apache or IIS as a CGI.
你能夠不要web服務器并且在Apache或者IIS后臺以CGI的形式運行Zope。
Zope is designed to, and excels at, publishing dynamic content.
Zope被設計為,并且擅長于,發(fā)布動態(tài)內容。
If you have a three page web site, Zope is overkill.
如果你的web站點只有3個頁面,用Zope就是殺雞用牛刀了。
If you have hundreds and thousands of pages, lots of users, and impatient readers, Zope is a very good thing.
如果你有成百上千的頁面,許多用于,以及沒有耐心的讀者,Zope是一個很好的東西。
Zope is also open-source, which is crucial to its success.
Zope還是開源的,這對于它的成功至關重要。
(Zope is actually an acronym: it stands for Z Object Publishing Environment.
Zope實際上是一個所寫:它代表Z Object Publishing Environment。
But if a cute young person asks you at a party, just say "Zope is Zope."
但是如果一個聰明的年輕人在party上問你,就說“Zope就是Zope?!?br>
The programming languages used to develop Zope are Python and C. Most of Zope is written in Python, and any bits where performance is crucial have been written in C.
用來開發(fā)Zope的編程語言是Python和C。Zope的大部分是用Python開發(fā)的,但是一些性能至關重要的地方是用C寫的。
Zope has been described as Python’s killer application; that is, the one application that makes it well worth learning Python and which best shows off the power of Python.
Zope被描述為Python的殺手程序;是因為,這個程序使得Python值得去學習并且最好的展示了Python的威力。
Zope Corp. describes Zope as an "award-winning open source platform for building content management systems."
Zope公司描述Zope是說“獲獎的建立內容系統(tǒng)的開源平臺?!?br>
That is the marketing department’s way of saying Zope is a tool you use to make publishing web sites as easy as possible.
營銷部分的說法是Zope是用來使得發(fā)布web站點盡可能簡單的工具。
1.2 Why should I use Zope?
為什么我要使用Zope?
Zope is one of the most powerful and flexible web publishing tools available.
Zope是現(xiàn)有的web發(fā)布工具中最有威力和最靈活的。
There are few things that other products do better than Zope.
很少有能夠做得比Zope更好的。
While it has a reputation for being difficult to learn, it isn’t really. Well, if you want to master Zope completely, there is a lot of complicated stuff to learn.
雖然它有一個難于學習的名聲,但是那不是真的。當然,如果你想要完全掌握Zope,將會有許多復雜的東西要去學。
But, at the same time, a non-programmer can still use Zope to create a powerful and flexible web site that would be very difficult or impossible for them (non-programmer) to do with any other tool.
但是,同時,非程序員也能使用Zope來創(chuàng)建威力強大并且靈活的web站點,而這在其他工具中對他們(非程序員)來說是非常困難或者是不可能的。
Also, if you are already a competent Python programmer, Zope will best allow you to take advantage of your skills.
而且,如果你已經是一個有能力的Python程序員,Zope讓你能夠發(fā)揮你的技能到極處。
Some people, even brilliant Python programmers, never quite understand Zope and find it too difficult to use.
有些人,甚至是很好的Python程序員,從沒有很好理解Zope并且認為它難于使用。
Others, even people like me who are not terribly intelligent, find it easy to use Zope in a limited way.
其他的人,甚至是像我這樣并不是非常聰明的人,發(fā)現(xiàn)只使用Zope部分功能很簡單。
You may find another web publishing system like OpenACS easier to use and more powerful.
你可能發(fā)現(xiàn)其他的像OpenACS這樣的發(fā)布系統(tǒng)更容易使用并且更強大。
Or you may not.
或許你不會這么想。
1.3 Who develops Zope?
誰開發(fā)了Zope?
Zope is developed mostly by Zope Corporation, a web consulting company.
Zope大部分由Zope公司開發(fā),一個web咨詢公司。
Their main investor, once he saw Zope, convinced them to open-source it.
他們的主要投資者,他一看見Zope,就說服他們把它編程開源的。
They did so in 1998, and neither they nor Zope have looked back.
他們在1998年這么做了,他們和Zope都沒有后悔。
As Zope is open-source, the Zope developer community is spread all over the world.
因為Zope是開源的,Zope開發(fā)這社區(qū)遍布整個世界。
Even I have submitted successfully a patch for Zope.
設置我也成功提交了一個Zope的補丁。
But Zope Corporation maintains and controls the CVS server, and they release the official builds.
但是Zope公司維護和控制CVS服務器,他們發(fā)布官方的build版本。
1.4 Where can I get Zope?
我在哪兒能夠得到Zope?
You can download Zope from www.Zope.org/Products.
你能夠從www.Zope.org/Products下載到Zope
1.5 Do any ISPs support Zope?
有什么ISP支持Zope嗎?
Yes. For a list see: www.zope.org/Resources/ZSP.
是的。參考這個列表:www.zope.org/Resources/ZSP。
1.6 Can I get support if I use Zope?
如果我使用Zope我能夠得到支持嗎?
Yes. There is free support on the Zope mailing lists.
是的,在Zope的郵件列表上有自由的支持。
If you want paid support you arrange a support contract with Zope Corp..
如果你想要付費的支持,你應該協(xié)商與Zope公司協(xié)商一個支持合同。
You can also have Zope Corp. build your Zope site for you.
你還能讓Zope公司來給你建立你的Zope站點。
If you want support building or maintaining a Zope server, or both, you can get it from consulting companies like Tummy.com and iMeme.net.
如果你想要建立或者維護Zope服務器的支持,或者兩者都要,你能夠從像Tummy.com和iMeme.net這樣的咨詢公司得到這樣的服務。
The Zope community is large enough now that you can probably get the support you need from large companies to small one-person consulting companies.
Zope社區(qū)現(xiàn)在已經足夠大以至于你可能能夠從大型到個人小型的咨詢公司那兒得到支持。
1.7 What products does Zope compete against?
與Zope競爭的product有哪些?
If you are looking for open-source competition for Zope, have a look at OpenACS.
如果你要尋找一個開源的Zope的競爭者,卡看OpenACS。
In my opinion Zope and OpenACS stand well above the rest of the field.
在我看來zope和OpenACS差不多。
There are many other tools for building sophisticated web sites, some free and some commercial. All have their good and bad points.
還有許多構建復雜的web站點的工具,一些是免費的一些是商業(yè)的。所有的都有它們的有點和缺點。
1.8 Do I need a fast computer to host Zope? Can I use my old 486?
我是否需要一個快速的電腦來運行Zope?我能用我的舊486嗎?
As with all software, the faster your computer the happier you will be.
與所有軟件一樣,你的電腦速度越快,你會越開心。
Because Zope is written in Python, you will enjoy dramatic performance improvements using current computers rather than a three year-old computer.
因為Zope是用Python寫的,如果你時下的電腦你會享受戲劇性的性能改善比起3年前的舊電腦來說。
You can probably "run" Zope on a 486, but it would be too slow to host a public web site.
你可能在486上“運行”Zope,但是它可能會是太慢了以至于無法承載一個公開的web站點。
An old Pentium 133 will be sufficient for development or a small personal site.
一臺舊的奔騰133對于開發(fā)或者小型的個人站點來說是足夠的。
To serve a busy public web site using Zope you will probably want to look at least a P3-450 or better.
要給一個繁忙的web站點使用Zope提供服務,你可能至少需要p3-450或者更好一些的。
An iMac running Linux is a very capable Zope box.
運行Linux的iMac是非常合適的Zope主機。
The best computers I have used for running Zope have been built with AMD Thunderbird and Duron CPUs.
我用來運行Zope的最好的電腦是用AMD的速龍和毒龍CPU。
You can even run Zope on an IBM mainframe.
你甚至可以在IBM大型機上運行Zope。
1.9 Which platform is best for Zope? Linux? BSD? Windows? MacOS X? Solaris? HP-UX?
哪個平臺最適合Zope?Linux?BSD?Windows?MacOS X?Solaris?HP-UX?
The BSDs (eg, OpenBSD, FreeBSD) and Linux are excellent Zope platforms.
BSD(例如,OpenBSD,F(xiàn)reeBSD)和linux是極好的Zope平臺。
The Unix servers are far more flexible and easier to maintain.
Unix服務器更加靈活并且好維護得多。
On Windows it can be easier to do one thing or another, but when things get hairy, it is easy to find yourself stuck.
在Windows上,做這個或者那個可能要容易一些,但是當事情變得復雜起來,你自己很容易被煩惱糾纏上。
I have never experienced disaster under NT (by day I am an NT sysadmin), but I have had far fewer headaches on Linux and OpenBSD.
我在NT下從沒有遇到災難(時下我是一個NT系統(tǒng)管理員),但是在Linux和OpenBSD上頭痛的情況要少得多。
I use OpenBSD and RedHat for all of my Zope serving because I like them and have never had any problems.
我在我所有得Zope服務器上使用OpenBSD和RedHat因為我喜歡他們并且從沒有任何問題。
For a single public Zope server OpenBSD is ideal because it’s fast and very secure.
對于單個的Zope服務器,OpenBSD是理想的因為它很快并且非常安全。
Support for Unix is much easier to find and is of better quality.
對于Unix的支持更容易找到并且質量更好。
You also don’t have to worry about budgeting a lot of money for NT server and client licences.
你還不用為NT服務器和客戶端許可證的大筆預算擔心。
But keep in mind that if you are building a large site, the cost of NT and its licences will be tiny compared with the cost of bandwidth and administration.
但是如果你正在構建大型的站點記住,NT和它的許可證的價格比起帶寬和管理上付出的代價顯得微不足道。
I have personally run Zope on Windows 98, Windows ME, Windows NT, Windows 2000, Windows XP, OpenBSD, RedHat, and MacOS X.
我個人曾經在Windows 98, Windows ME, Windows NT, Windows 2000, Windows XP, OpenBSD, RedHat, 以及 MacOS X上運行過Zope。
My favourite is OpenBSD.
我的最愛是OpenBSD。
1.10 How fast is Zope? Can I use it to build Slashdot part deux?
Zope有多快?我能用它來建立Slashdot part deux嗎?
Zope is fast enough.
Zope足夠快。
What does that mean?
這意味著什么?
Zope is not now, and will not ever be, as fast as Apache, AOLserver, and IIS are when serving static pages.
在提供靜態(tài)頁面服務時,Zope現(xiàn)在不是,并且將來也不會,和Apache,AOLserver以及IIS一樣快。
But serving dynamic pages, where every single web page is assembled from scratch by the server, Zope can easily keep up with everyone else.
但是提供動態(tài)頁面服務,其中所有的web頁面都是由服務器從頭生成的,Zope能夠輕易的追上其他的所有選手。
Right now Zope is faster than Java Server Pages, but that is because JSP technology wasn’t very good to start with, but it is improving quickly.
現(xiàn)在Zope比Java server Page更快,但是這是因為JSP技術從開始就不是非常好,但是它正在快速的得到改進。
You can support a million page views a day, if you run a fast AMD-powered server with an excellent connection to the Net and you build your Zope pages intelligently.
如果你很好地建立Zope頁面,有一個極好的網絡接入并且運行在一個快速的AMD服務器上,你能支持每天一百萬的頁面瀏覽量。
You can probably support a site as popular as Slashdot or Kaliber 10000, provided you have the bandwidth and hardware.
給你提供足夠地帶寬和夠好的硬件,你可能支持一個如Slashdot或者Kaliber 10000一樣地站點,
For enterprise-level sites you can use ZEO, which is open-source.
對于企業(yè)級的站點,你能夠使用ZEO,它也是開源的。
ZEO (Zope Enterprise Objects) lets you put several servers in front of your main Zope server. Those servers then share the load of serving pages to visitors.
ZEO(Zope Enterprise Objects)讓你把幾個站點放在Zope服務器的前面。這些服務器平分了給訪客提供服務的負擔。
CBS New York is the largest known Zope site.
CBS New York是已知的最大的Zope站點。
Both NATO and the US Navy use Zope — they obviously aren’t going to tell anyone just how big their sites are.
NATO和US海軍都使用Zope —— 他們明顯不會告訴任何人他們的站點有多大。
1.11 Who uses Zope? Has anyone I’ve heard of reviewed Zope?
誰使用Zope?有沒有誰我聽說過的人評論過Zope?
Thousands of sites the world over are built with Zope.
全世界成千的站點使用Zope構建。
For a list of some Zope case study sites see: www.zope.org/Resources/CaseStudies.
要得到一些Zope案例學習的站點參見:www.zope.org/Resources/CaseStudies。
Jon Udell has reviewed Zope in his Byte.com column.
Jon Udell在他的Byte.com專欄中評論過Zope。
Bruce Eckel, the famous C++ and Java author, now uses Python for all of his personal programming projects, and he uses Zope to publish his web site.
Bruce Eckel, 著名的C++和Java作家,現(xiàn)在使用Python來完成它的所有個人編程項目,并且他使用Zope來發(fā)布他的web站點。
1.12 What do I need to learn to use Zope?
使用Zope我需要什么?
A computer, a web browser, Zope itself, and a desire to learn. You do not need to buy anything.
一臺電腦,一個web瀏覽器,Zope本身,以及求知的欲望。你不需要購買任何東西。
1.13 Are there any Zope books?
有沒有什么Zope的書?
Yes. The official Zope book, written by two Zope Corp. programmers, was published in July 2001. The Zope Book should seen be in a bookshop near you.
是的。官方的Zope book,由兩個Zope公司的程序員寫的,在2001年7月出版。Zope Book應該能夠在你附近的書店中看到。
If you are in Europe and speak French or German you can find a book in each language, published within a day or so of one another in June 2001.
如果你在歐洲并且說法語或者德語,你找到這兩種語言的譯本。
There are two more English Zope books being published, both in September 2001: Zope Web Application Construction Kit and The Book of Zope.
還有兩本英語寫的Zope的書,都是在2001年9月出的:Zope Web Application Construction Kit 和 The Book of Zope。
1.14 I am not a nerd, can I still use Zope?
我不是一個笨蛋,我還需要使用Zope嗎?
Yes. You can create some fairly sophisticated sites without having to do any complex programming. If I can do it, anyone can.
是的,你能夠創(chuàng)建一些相當復雜的站點而不要做任何復雜的編程。如果我能做到它,任何人都能。
1.15 Is there a Zope tutorial?
有什么Zope的教程嗎?
Yes. There is one built into Zope itself. From the management screen in Zope, select from the dropdown menu: Zope Tutorial.
是的。在Zope中內含了一份。從Zope的管理窗口,選擇下拉菜單中的:Zope Tutorial。
1.15 What is a Zope product?
什么是Zope Product?
A Zope product is a program that you add to Zope that out-of-the-box does something very powerful without you having to do any programming.
Zope product是一個你能夠添加到Zope中的程序。它能夠在封裝之外做一些非常強大的事情而你不需要做任何的編程。
Zope products must be written in Python.
Zope products必須用Python來編寫。
1.16 Give me an example of a Zope product.
給我一個Zope product的例子。
Squishdot. It is weblog software, modelled after Slashdot.
Squishdot. 它是一個weblog軟件,與Slashdot類似。
You can add it to a Zope installation and be ready to publish a sophisticated weblog within a few minutes.
你能夠添加到Zope中這樣就能夠在幾分鐘之內發(fā)布復雜的weblog。
This site is published using Squishdot.
這個站點就是用Squishdot發(fā)布的。
1.17 Zope is too complicated. Or I have another reason why I don’t like Zope. What other systems are there that are equivalent?
Zope太復雜了。或者我有其他我不喜歡Zope的理由。其他相當?shù)南到y(tǒng)有哪些?
Have a look at the OpenACS.
看看OpenACS。
They’ve ported ArsDigita’s ACS to make it fully open-source.
他們是 ArsDigita的 ACS的移植版本,為了使得它完全是開發(fā)源碼的。
The ACS is built around Oracle.
ACS是建立在Oracle之上的。
The OpenACS is built around PostgreSQL, which offers many of the features of Oracle but is open-source and free as in beer.
OpenACS是建立在PostgreSQL之上的,它提供了許多Oracle的特色但是是開放源碼和免費的。
The ACS is stable, well understood, and very powerful.
ACS是穩(wěn)定的,理解透徹了的,并且非常強大。
I simply prefer Zope.
我只是更喜歡Zope。
2. Installation and Configuration
安裝和配置
2.1 How do I install Zope?
我如何安裝Zope?
If you are installing Zope under Windows, Zope includes a GUI installer programme that will do all of the dirty work for you, including setting Zope up as a service if you are running Windows NT, Windows 2000 or Windows XP.
如果你在Windows下安裝Zope,Zope包括一個GUI的安裝程序,它將為你完成所有的臟活累活,包括如果你運行在Windows NT, Windows 2000或者Windows XP上時把Zope設置為服務。
You cannot run Zope as a service on Windows 95, Windows 98, or Windows ME.
你不能在Windows 95,Windows 98,或者Windows ME上把Zope運行為服務。
That is a limitation of those operating systems, not Zope.
這是這些操作系統(tǒng)的限制,不是Zope的。
If you run Unix you can download the source file.
如果你運行Unix,你能下載源代碼。
If you run an RPM-compatible version of Linux (eg, RedHat), you can download an RPM.
如果你運行RPM兼容的Linux版本(例如RedHat),你能夠下載RPM。
The best way to install Zope is to simply download the source file, unpack it (tar -xzvf Zope-2.4.0-src.tgz), type python wo_pcgi.py, wait a few minutes, write down the username and password it issues, then type start. It’s that easy.
安裝Zope的最好的辦法是下載源代碼,解開包(tar -xzvf Zope-2.4.0-src.tgz),輸入wo_pcgi.py,等待幾分鐘,輸入用戶名和密碼,然后輸入start。就是這么的簡單。
If you are new to Zope or new to Unix you might be tempted to try and install an RPM-based Zope package.
如果你是Zope新手或者對于Unix不熟悉,你可能會被引誘到嘗試和安裝基于RPM的Zope包。
But if it doesn’t work and you ask for help on the Zope mailing list, you won’t get very far when you say "I installed it I don’t know where any of the files are. It doesn’t seem to work." from the RPM.
但是如果它沒能工作并且向Zope郵件列表尋求幫助,你可能會說“我安裝了它,但是我不知道文件去哪兒了,它看上去沒有工作?!?br>
2.2 When I launch Zope (on Unix) it displays text on my screen and I have to open another terminal window.
當我載入Zope(在Unix上)它在我的屏幕上顯示文字并且我不得不打開另外一個終端窗口。
By default Zope starts with debug information turned on.
缺省的Zope啟動的時候顯示調試信息。
To get rid of it, edit the start file, which is found in your Zope root directory, and remove the -D option.
要去掉它們,編輯start文件,它在你的Zope的根目錄中,并且移除-D選項。
-D puts Zope into debug mode.
-D把Zope設置為調試模式。
2.3 I cannot log into Zope — it wants a username and password.
我不等登錄到Zope —— 它需要用戶名和密碼
At the end of the compile process, the superuser account and password are displayed on the screen.
編譯過程的最后部分,超級用于的帳號和密碼顯示在屏幕上。
If you miss that, you can compile the source again, this time paying attention to what is displayed on the screen.
如果你漏掉了它,你能重新編譯一次源代碼,這次注意屏幕上顯示的東西。
Or, you can type python zpasspwd.py inituser and follow the prompts.
或者你可以輸入python zpasspwd.py初始化用戶并且跟著提示做。
Once you log into Zope with the username and password noted above, create a new user with Manager permissions.
一旦你用用戶名和密碼登陸進了Zope,創(chuàng)建一個管理者權限的新用戶。
2.4 I want my site to look like www.foo.com, not www.foo.com:8080. How can I change that?
我想要我的網站看上去像www.foo.com,不是www.foo.com:8080。我如何改變它?
You need to edit the z2.py file, which is in the Zope root directory.
你需要編輯z2.py文件,它在Zope的根目錄中。
The port specified by default is 8080.
缺省指定的端口號是8080
You need to change it to 80.
你需要把它改成80。
(Under Unix you must be root to access ports below 1024.)
在Unix下你必須成為root來獲得低于1024端口的訪問權。
Then restart Zope as root, but you must set the permissions properly on the var directory, where the database file, log file, etc. are kept.
然后用root重啟Zope,但是你必須恰當設置了var目錄的權限,其中保存了數(shù)據(jù)庫文件,log文件等等。
If you don’t set the permissions correctly, Zope will not start.
如果你沒有正確的設置權限,Zope不會啟動的。
In my experience with Zope, you are better off running using Apache as a proxyserver to funnel requests to Zope and return them to the user.
在我使用Zope的經驗中,你最好用Apache作為代理服務器來過濾發(fā)往Zope的請求并且把它們返回到用戶那兒。
In this case you leave Zope running on port 8080.
在此例中你把Zope運行在端口8080中。
(See http://www.zope.org/Members/anser/apache_zserver)
(參考 http://www.zope.org/Members/anser/apache_zserver)
The definitive How-To for supporting virtual hosts through Apache is here:
權威的通過Apache支持虛擬主機的How-To在這兒:
How-To: Virtual Hosts via Apache (but nearly all content in Zope)
How-To: 通過Apache建立虛擬主機 (但是基本所有的內容在Zope中)
The advantage of the above approach is that you can have almost all content served from Zope, have some PHP content, and perhaps a few CGIs, but it looks as though it’s one web site, not a half-dozen.
上面的方法的有嗲那是你能夠把幾乎所有的內容用Zope提供,有一些PHP內容,以及可能少量的CGI,但是可能它看上去好像是一個web站點,而不是半打。
If you run Windows, you can simply edit the z2.py file, stop the Zope service, and restart it.
如果你運行Windows,你可以簡單的編輯z2.py文件,停止Zope服務,并且重啟。
2.5 I’ve logged into Zope, but it won’t let me create anything. Why?
我登陸進了Zope,但是它什么都不讓我創(chuàng)建。為什么?
The superuser account exists only to create users. You cannot manage and edit a Zope site using the superuser account.
超級用戶帳號的存在僅僅用于創(chuàng)建用戶。你不能管理和編輯Zope使用超級用戶帳號。
Log in as superuser, create a manager account, log out of Zope, then log in again using the manager account, not the superuser one.
用超級用戶登陸,創(chuàng)建一個管理者帳號,登出Zope,然后再次用管理者的帳號登陸,而不是用超級用戶那個。
2.6 Where is the log file?
log文件在哪兒?
The log file is stored in ZopeRootFolder/var For example, /home/sally/zope/var/Z2.log
log文件位于ZopeRootFolder/var 例如,/home/sally/zope/var/Z2.log
2.7 How do I get statistics on my site, a list of referrers, and so on?
我如何得到我的站點的統(tǒng)計數(shù)據(jù),瀏覽者的列表,以及其他?
You need to get a stats programme like Analog, which will go through your log file and produce a pretty web page showing you all sorts of curious details about your visitors.
你需要一個像Analog的stats程序,它瀏覽你的log文件并且產生一個漂亮的web頁面向你展示各種關于你的訪客的古怪的細節(jié)。
2.8 I used Analog to produce stats from my log file and I don’t see any useful information. What’s wrong?
我使用Analog來從我的log文件產生stats并且我沒有看到任何有用的信息。哪兒有問題了?
The Zope log file, Z2.log, is not very useful.
Zope的log文件,Z2.log,不是十分有用。
If you run Zope behind Apache, you can have Apache record the log file entries, which is much simpler.
如果你在Apache背后運行Zope,你能夠讓Apache記錄log文件,這要簡單多了。
2.9 I know Perl. Do I need to learn Python to use Zope?
我懂Perl。我需要學習Python來使用Zope嗎?
Not necessarily.
沒有必要。
Starting with Zope 2.3.0, you can create Perl methods.
從Zope 2.3.0開始,你能夠創(chuàng)建Perl method。
In the Zope order of things, you will create DTML methods, then Python Scripts if what you want to do cannot be done using DTML, and then Products if you are trying to do something complex.
在Zope中,你會創(chuàng)建DTML method,如果你要做的事情不能使用DTML完成,那么就是Python腳本了,再要么就是如果你要嘗試做一些復雜的事情,創(chuàng)建Product。
Products must be written in Python.
Product必須用Python些。
This is not likely to change any time soon.
這個看上去短期之內不會改變。
You can also use either Python or Perl to create DTML-equivalent methods, rather than using DTML.
你還能使用Python或者Perl來創(chuàng)建DTML等價的method,而不使用DTML。
With Zope 2.5.x, the preferred approach to managing code is not to use DTML but instead a mixture of Page Templates and Python Scripts, leaning heavily on Page Templates (they’re GoLive and DreamWeaver friendly).
在Zope 2.5.x中,更好的管理代碼的辦法不是使用DTML而是不把頁面模板和Python腳本混雜了,嚴重傾向于頁面模板(他們可以和GoLive和DreamWeaver相容)。
2.10 I don’t know either Perl or Python. Which should I learn?
我即不懂Perl也不動Python。我應該學習什么?
Python. It is easier to learn than Perl, and Zope is written in Python, so it would not make sense to learn Perl if you are convinced you want to master Zope.
Python。它比Perl更容易,而且Zope是用Python寫的,因而學習Perl沒什么意義如果你以及被說服要去掌握Zope。
2.11 Which databases can I use with Zope?
在Zope中我能使用哪些數(shù)據(jù)庫?
On Unix you can use Oracle, PostgreSQL, MySQL, Sybase, and InterBase. and DB2.
在Unix上你能使用Oracle,PostgreSQL,MySQL,Sybase,以及InterBase,還有DB2。
On Windows you can use any ODBC-compliant database, including SQL Server 2000.
在Windows你能使用任何ODBC-兼容的數(shù)據(jù)庫,包括SQL Server 2000。
Zope Corp. maintains the drivers for Oracle, Sybase, and ODBC. The Zope community maintains drivers for the other databases.
Zope公司維護Oracle,Sybase和ODBC的驅動程序。Zope社區(qū)維護其余的數(shù)據(jù)庫。
2.12 Why should I use another database with Zope? I thought Zope included a database?
為什么我應當使用另一個數(shù)據(jù)庫?我想Zope已經包含了一個數(shù)據(jù)庫了?
Yes, Zope includes as a fundamental component an object database.
是,Zope包含以基本組件的形式包含一個對象數(shù)據(jù)庫。
But the Zope Object Database is designed for lots of reading and little writing.
但是Zope對象數(shù)據(jù)庫設計為大量的讀,但是很少去寫。
That means if you expect 99 out of 100 viewers to read data and 1 to create data, you should be fine with Zope’s own database.
這意味著如果你預期100個瀏覽者中有99個是讀數(shù)據(jù)只有1個是創(chuàng)建數(shù)據(jù),用Zope自己的數(shù)據(jù)庫是可行的。
But if your users will do a lot of writing, then you are better off using PostgreSQL etc.
但是如果你的用戶會做許多寫的操作,那么你最好使用PostgreSQL等。
In that case you still store your scripts, templates, etc inside the Zope database, but you store the data that your users create in the SQL database.
在那樣的情況下,你仍然把腳本,模板等儲存在Zope數(shù)據(jù)庫中,但是你把數(shù)據(jù)儲存在你用戶創(chuàng)建的SQL數(shù)據(jù)庫中。
You will want to run that database on the same machine as Zope.
你會要運行Zope的同一臺機器上運行那個數(shù)據(jù)庫。
If you access a database server on another machine, your performance will most often disappoint you.
如果你訪問另外一臺機器上的數(shù)據(jù)庫,性能可能會時常讓你感到失望。
Accessing something in memory is a lot, lot faster than travelling along a network cable to another machine and back again.
訪問內存的東西要比通過網絡線纜到另一臺機器上然后要回來快許多許多倍。
2.13 Can I run more than one site inside Zope? Can I do virtual hosting like I can with Apache or IIS?
我能在Zope中運行多于一個站點嗎?我能像Apache或者IIS那樣做虛擬主機嗎?
Yes. Using a Zope product called SiteAccess you can configure Zope to treat foo.com and foobar.com as two different web sites.
是的。使用名為SiteAccess的Zope product,你能配置Zope為對待foo.com和foobar.com為兩個不同的web站點。
The best way to do this is to do it the way Zope.org does, using ProxyPass and SiteAccess. I do this myself on my own Zope box.
這么做的最佳辦法是和Zope.org一樣做,使用ProxyPass和SiteAccess。我在我自己的Zope服務器上這么做。
2.14 I’m trying to install Zope 2.4.0 or better under MacOS X and I’m getting error messages about ZSplitters etc. and now my head wants to split. What’s wrong?
我嘗試在MacOS X上安裝Zope 2.4.0并且我得到關于ZSplitters這些東西的錯誤信息并且現(xiàn)在我的頭要裂開了。哪兒出問題了?
There is a bug in the MacOS X tar program, and tar doesn’t unpack the Zope tgz file properly.
在MacOS X tar程序中有一個bug,并且tar不能正常的解開Zope的tgz文件。
OpenBSD's tar has the same issues.
OpenBSD的tar也有相同問題。
Use Gnu tar instead: gnutar -xzvf Zope-2.4.0-src.tgz.
使用Gnu tar來代替:gnutar - xzvf Zope-2.4.0-src.tgz.
Then python wo_pcgi.py and everything should be fine.
然后python wo_pcgi.py并且所有事情都搞定了。
You might want to upgrade to Python 2.1.1 first.
你可能需要先升級到Python 2.1.1。
I never could get any of the Zope 2.4 betas to install.
我還沒能安裝過Zope 2.4 beta版。
Then I upgraded to Python 2.1.1, used gnutar rather than tar to unpack the Zope file, and all went smoothly after that.
然后我升級到Python 2.1.1,使用guntar而不是tar來解開Zope文件,然后一切都很正常。
If you have both Python 1.5.2 and Python 2.1.1 installed, ensure that you are using Python 2.1.1 to compile Zope 2.4.x.
如果你即安裝了Python 1.5.2又安裝了Python 2.1.1,確保你正在使用Python 2.1.1來編譯Zope 2.4.x
Zope 2.4.x and higher require Python 2.1 or better.
Zope 2.4.x 以及更高版本需要Python 及以上。
You should use Python 2.1.3.
你應當使用Python 2.1.3。
Performance
性能
3.1 I want to build a superfast Zope server. What do I need?
我要建立一個超級快的Zope服務器。我需要些什么?
You need the fastest AMD CPU you can afford, an Ultra160 SCSI RAID subsystem, and the latest BSD or Gnu/Linux OS.
你需要你能夠負擔得了得最快得AMD CPU,一個Ultral60 SCSI RAID子系統(tǒng),并且至少是BSD或者Gnu/Linux操作系統(tǒng)。
In my experience OpenBSD 2.9 and RedHat 7.1 are much faster than earlier versions.
在我的經驗中OpenBSD 2.9和RedHat 7.1比早期的版本快得多。
There is more to it than that — you could write a small book on building the fastest Web server possible.
對于那些東西有更多的講頭 —— 你能夠就可能建造的最快的Web服務器寫一本小書。
An AMD ThunderBird 1.2 GHz-based server is almost twice as fast as an AMD Duron 800 MHz server when it comes to running Zope.
當運行Zope時,基于AMD 速龍 1.2GHz的服務器基本上比AMD 毒龍 800MHz的服務器快兩倍。
In my experience the AMD-based servers are faster than Intel-based servers, although I haven’t yet run Zope on a P4-based server.
在我的經驗中基于AMD的服務器比基于Intel的服務器要快,雖然我還沒有在基于P4的服務器上運行過Zope。
For a list of Python benchmarks visit: QubeQuorner Pystone listing.
要獲得Python速度測評的列表,訪問:QubeQuorner Pystone listing.
The benchmark results listed will give you a rough idea of the sort of Zope performance you can expect.
列出的速度測評結果將給你一個你能夠期望的Zope的性能的大概的概念。
You can never have too much RAM.
你永遠不會擁有過多的RAM。
You will probably run out of bandwidth before you exhaust a P3-500.
你可能在耗盡帶寬之前就讓P3-500不堪重負了。
A Pentium 100 can easily fill a T1 with traffic.
奔騰100能夠輕易的滿足T1的流量。
If you expect to make your AMD server work hard, you will need to colocate your server at a service like Peer1 where bandwidth is almost unlimited.
如果你想要使得你的AMD的服務器工作得努力些,你需要把你的服務器放在在帶寬幾乎無限的地方。
Keep in mind that your bandwidth charges could easily make the cost of your server irrelevant after a month or two of running your site.
始終在腦子里面記住你的帶寬費用能夠輕易的在一兩個月運營你的站點之后使得你服務器的花費無關緊要。
3.20 I’ve built my superfast Zope box. How do I test it to make sure it won’t melt when I am linked on Slashdot?
我已經建立了我的超級快的Zope主機了。我如何測試當我鏈接到了像Slahdot時不會被壓垮
Apache includes a benchmark tool called ab.
Apache包括一個成為ab的測速工具。
Run that with a high load setting and ensure that your server stays up until the load test finishes.
以一個高的負載設置運行那個工具以確信你的服務器能夠承受直到測試結束。
Load testing is, however, not always very accurate, so while your site may pass the ab load test swimmingly, you could get Slashdotted and fall over.
然而負載設置不是總那么精確的,因而當你的站點輕易地通過了ab負載測試,你可能加入Slashdot然后倒下去。
But it's a good start.
但是那是一個好地開始。
Test, test, and test again.
測試,測試,再測試。
Use a debugger and profiler to ensure that you’ve sorted out any bottlenecks in your code.
使用調試器和profiler來確信你已經在你的代碼中排序列出了所有的瓶頸。
3.3 How do I test and debug my Zope server?
我如何測試和調試我的Zope服務器?
ZPublisher comes with built-in support for working with the Python debugger and profiler.
ZPublisher是與Python調試器和profiler一起工作的內置的支持工具。
(Zope is written in Python.)
Zope使用Python寫的。
Read the Testing and Debuggin chapter in the Zope Developer’s Guide, the second, more advanced Zope book by Michel, Amos, and Chris.
閱讀Zope Developer's Guide的測試和調試章節(jié),然后是讀由Michel, Amos, 和Chris寫的更高級的Zope的書。
4. Troubleshooting
解決問題
4.1 I’m trying to run Zope on Windows ME or Windows 98 and when I start Zope my computer crashes.
我正在嘗試在Windows ME 或者 Windows 98上運行Zope而當我啟動Zope的時候我的電腦崩潰了。
You are probably running Norton Firewall.
你可能正在運行Norton防火墻。
Uninstall Norton Firewall and use ZoneAlarm or another product.
卸載Norton防火墻并使用ZoneAlarm或者其他產品。
ZoneAlarm is free for personal use and it isn’t as buggy as the Norton product.
個人使用ZoneAlarm是免費的并且它沒有Norton的產品那么多bug。
Norton sees Zope trying to run as a web server on port 8080 and it crashes rather than ask you if you want Zope to run unblocked.
Norton看到Zope嘗試在8080運行為web服務器然后它崩潰了而不是詢問你是否要Zope這么做。
This is Norton’s fault.
這是Norton的過錯。
It has nothing to do with Zope.
與Zope毫無關系。
4.2 I want to run Zope as a service under Windows ME.
我想在WindowsME下把Zope運行為服務。
You cannot.
你不能。
Windows ME, Windows 98, and Windows 95 are toy operating systems.
Windows ME, Windows 98,和Windows 95是玩具操作系統(tǒng)。
They do not support running a program as a service.
他們不支持把程序運行為服務。
If you insist on running Windows and want to run Zope as a service, upgrade to Windows NT, Windows 2000, or Windows XP.
如果你堅持要使用Windows并且想要把Zope運行為服務,升級到Windows NT, Windows 2000, 或者Windows XP。
4.3 I’ve installed a new version of Zope on Windows but it won’t run as a service.
我已經在Windows上安裝了新版的Zope,但是它不能運行為服務。
I’m assuming you’re using Windows NT, Windows 2000, or Windows XP.
我假定你正在使用Windows NT, Windows 2000,或者Windows XP。
You probably ran Zope as a service previously.
你可能以前已經把Zope運行為服務了。
When you install Zope as a service, the install program makes an entry in the Registry.
當你把Zope安裝為服務時,安裝程序在注冊表中添加了一個條目。
When you uninstall Zope, the uninstall program does not remove the Registry entry for the service.
當你卸載Zope時,卸載程序不會移除為服務添加的那個條目。
Either remove the Registry entry, or install Zope in exactly the same directory as your previous Zope installation.
要么移除注冊表中的那個條目,要么把Zope安裝在先前安裝過的同一個地方。
4.4 I start Zope but I nothing happens when I try to log in using my Web browser. But FTP is working.
我啟動了Zope但是當我嘗試使用我的Web瀏覽器登陸的時候什么都沒有發(fā)生。但是FTP還在工作。
You are probably running a proxy server or another web server on port 8080.
你可能正在運行代理服務器或者另一個web服務器在端口8080。
Stop Zope, edit the z2.py file and change the port from 8080 to 9080, then start Zope again.
停止Zope,編輯z2.py文件并且把端口從8080改成9080,然后再次啟動Zope。
You may have to wait several minutes, especially on an older machine.
你可能需要等待幾分鐘,特別是在老機器上。
Note that you can use almost any port you want above 1024 on Linux or BSD or OS X etc.
注意在Linux或者BSD或者OS X等上你能夠使用幾乎所有的高于1024的端口。
The default port Zope tries to use is 8080. You can use 7080 or 9080 or 9666 if you want.
Zope嘗試使用的缺省端口是8080。你能夠使用7080或者9080或者9666如果你要那么做的話。
4.5 Is there a way to automatically restart Zope if it goes down?
有什么辦法能夠在它down掉的時候自動重啟Zope嗎?
Craig Dunigan wrote a Perl script to restart his Zope instance if it hung.
Craig Dunigan寫了一個Perl腳本來在Zope掛起的時候重啟它。
"A while back there were many comments on the list about Zope hangs, and how to handle them.
不久前在列表上有許多關于如何在Zope掛起時處理它的評論。
If anyone is interested, I wrote a Perl script that checks for a response from Zope on localhost and restarts it if there is no response.
如果有人感興趣,我寫了一個Perl腳本檢查在localhost中從Zope來的回應并且在沒有響應的時候重啟它。
It uses the init script from http://www.zope.org/Members/markoer2/resources/howtos/redhat_startup, and a few Perl modules from CPAN.
它使用了http://www.zope.org/Members/markoer2/resources/howtos/redhat_startup的初始化腳本以及一些來自CPAN的Perl模塊。
It runs as a daemon so that it can started once and ignored.
它能夠運行在后臺因而它能一旦啟動了就不用去管了。
I haven’t done it, but you could probably write an init shell script for it, too."
我已經做完了,但是你可能還能給它寫一個init shell腳本。
There is some code within Zope itself that was intended to do the same thing, but it was never finished. See below.
在Zope中也有完成類似事情的代碼,但是它還沒有被完成。參考下面。
Michel Pelletier: A Python daemon to restart hung Zope "But if you look inside lib/python/zdaemon.py you’ll see a ’heartbeat()’ method with some stuff commented out.
Michel Pelletier:一個用來重啟掛起了的Zope的后臺的Python程序?!暗侨绻憧纯磍ib/python/zdaemon.py你可能看到用注釋注釋掉了的一個“heartbeat()”方法。
This is a heartbeat mechanism that we wrote into zdaemon.py.
這是我們寫入zdaemon.py的heartbeat機制。
The parent process can ’kick’ the child with an http request over time intervals.
父進程能夠用不斷的http請求“踢掉”子進程。
Probably nobody knows about it except me.
可能沒有人找到它除了我。
You can rewrite the heartbeat() function to restart the child on certain errors.
你能構重寫heartbeat()函數(shù)來在某種錯誤發(fā)生時重啟子進程。
In fact, this part of Zope was meant to do what you guys are doing, so if you actually finish it for me I’ll check it in."
事實上,Zope的這個部分是想要做你們這些家伙正在做的事情,因而如果你為我完成了它,我會把它包括進來?!?br>
5. Security
安全
5.1 How secure is Zope? I’ve heard bad things.
Zope有多安全?我聽到了壞的事情。
Zope is secure.
Zope是安全的。
There are no recorded instances of a Zope site being cracked.
沒有Zope站點被黑的記錄。
Various bugs were discovered within Zope itself that could have allowed a Zope developer to take control of objects he should not have had access to.
各種各樣的可能使得Zope開發(fā)者能夠控制他可能不能訪問的對象的bug在Zope中被發(fā)現(xiàn)。
Those were patched quickly and were never really a serious problem.
這些都被快速地打上補丁并且從來沒有嚴重的問題。
However, they way they were reported, people outside the Zope community assumed those security reports and patches meant that Zope itself was a cracker’s delight. Not so.
然而,據(jù)報到,人們在Zope社區(qū)之外認為這些安全報告和補丁意味著Zope本身是駭客的驚喜。不是這樣的。
However, just as Zope 2.4.0 was released, someone discovered a vulnerability in cgi.py, part of Python and an integral part of Zope itself, that allowed a malicious user to issue a Denial of Service attack against a Zope site.
然而,Zope 2.4.0剛發(fā)布,某些人發(fā)現(xiàn)在cgi.py中的一個弱點,它是Python的一部分并且是Zope本身的組成部分,使得惡毒的用戶能夠發(fā)起對Zope站點的拒絕服務的攻擊。
They couldn’t take over the Zope site or gain access to the filesystem on the remote Zope server, but they could cause Zope to soak up all available memory, effectively bringing down the site.
他們不能操控Zope站點或者獲得在遠程Zope服務器上的文件系統(tǒng)的訪問權,但是他們能夠導致Zope耗盡所有內存并且快速地down掉整個站點。
The bug was easily patched.
bug很輕易地得到了修補。
I’m not aware of any Zope sites that were attacked.
我不知道任何Zope站點受到過攻擊。
(Although I think ZopeNewbies was attacked — in the wee hous of the morning Python suddenly grabbed 90% of the memory on the box.
雖然我認為ZopeNewbies曾經受到了攻擊 —— 在早上的一小會兒Python突然使用了內存的90%。
Zope still managed to serve pages.
Zope仍然應付了頁面服務。
But I stopped Zope, installed the patch, and restarted Zope.
但是我停止了Zope,安裝了補丁,并且重啟了Zope。
Installing the patch took less than a minute.)
安裝補丁只花了不到1分鐘的時間。
Zope has never yet had issues on the scale of IIS or even Apache.
Zope還從沒有出現(xiàn)過IIS甚至是Apache那個程度的問題。
As far as I know, that is.
盡我所知,是這樣的。
5.2 Where can I find more information about Zope’s built-in security mechanisms?
我在哪兒能夠找到關于Zope的內建安全機制的更多信息?
Assuming you’ve already gone through the Zope Book’s chapter on security, you can get more detailed security-related information from Chapter 6 of the Zope Developer’s Guide.
假定你已經看過了Zope Book關于安全的章節(jié),你能夠從Zope Developer's Guide的第六章得到更加具體的安全相關的信息。
公告
浙公網安備 33010602011771號