Commit 92d364ee authored by Hanno Schlichting's avatar Hanno Schlichting

Update docs.

parent 8a5af778
...@@ -10,6 +10,7 @@ If you wish to run Zope in debug mode, run zopectl in foreground mode:: ...@@ -10,6 +10,7 @@ If you wish to run Zope in debug mode, run zopectl in foreground mode::
You can also use it to inspect a Zope instance's running state via an You can also use it to inspect a Zope instance's running state via an
interactive Python interpreter by passing zopectl the 'debug' parameter on the interactive Python interpreter by passing zopectl the 'debug' parameter on the
command line. command line.
The 'top-level' Zope object (the root folder) will be bound to the name 'app' The 'top-level' Zope object (the root folder) will be bound to the name 'app'
within the interpreter. You can then use normal Python method calls against app within the interpreter. You can then use normal Python method calls against app
and use the Python interpreter normally to inspect results:: and use the Python interpreter normally to inspect results::
......
...@@ -9,10 +9,10 @@ This document describes how to get going with Zope using ``zc.buildout``. ...@@ -9,10 +9,10 @@ This document describes how to get going with Zope using ``zc.buildout``.
About ``zc.buildout`` About ``zc.buildout``
--------------------- ---------------------
`zc.buildout <http://www.buildout.org/>`_ is a powerful tool for creating `zc.buildout <https://pypi.python.org/pypi/zc.buildout>`_ is a powerful
repeatable builds of a given software configuration and environment. The tool for creating repeatable builds of a given software configuration
Zope developers use ``zc.buildout`` to develop Zope itself, as well as and environment. The Zope developers use ``zc.buildout`` to develop
the underlying packages it uses. Zope itself, as well as the underlying packages it uses.
Prerequisites Prerequisites
------------- -------------
...@@ -30,14 +30,7 @@ available: ...@@ -30,14 +30,7 @@ available:
headers installed which correspond to your system's ``zlib``. headers installed which correspond to your system's ``zlib``.
- A C compiler capable of building extension modules for your Python - A C compiler capable of building extension modules for your Python
(gcc recommended). This is not necessary for Windows as binary (gcc recommended).
releases of the parts that would need compiling are always made
available.
- If you wish to install Zope as a Service on Windows, you will need
to have the `pywin32`__ package installed.
__ https://sourceforge.net/projects/pywin32/
Installing standalone Zope using zc.buildout Installing standalone Zope using zc.buildout
...@@ -164,13 +157,13 @@ An example session:: ...@@ -164,13 +157,13 @@ An example session::
$ mkdir /path/to/instance $ mkdir /path/to/instance
$ cd /path/to/instance $ cd /path/to/instance
$ mkdir etc logs var $ mkdir etc logs var
$ wget http://downloads.buildout.org/2/bootstrap.py $ wget https://bootstrap.pypa.io/bootstrap-buildout.py
$ vi buildout.cfg $ vi buildout.cfg
$ /path/to/your/python bootstrap.py $ /path/to/your/python bootstrap-buildout.py
$ bin/buildout $ bin/buildout
$ cat eggs/Zope2--*/Zope2/utilities/skel/etc/zope.conf.in > etc/zope.conf $ cat eggs/Zope2--*/Zope2/utilities/skel/etc/zope.conf.in > etc/zope.conf
$ vi etc/zope.conf # replace <<INSTANCE_HOME>> with buildout directory $ vi etc/zope.conf # replace <<INSTANCE_HOME>> with buildout directory
$ bin/zopectl start $ bin/zopectl fg
In the ``bin`` subdirectory of your instance directory, you will In the ``bin`` subdirectory of your instance directory, you will
find ``runzope`` and ``zopectl`` scripts that can be used as find ``runzope`` and ``zopectl`` scripts that can be used as
...@@ -181,10 +174,6 @@ calling it without any arguments. Try ``help`` there and ``help <command>`` ...@@ -181,10 +174,6 @@ calling it without any arguments. Try ``help`` there and ``help <command>``
to find out about additionally commands of zopectl. These commands to find out about additionally commands of zopectl. These commands
also work at the command line. also work at the command line.
Note that there are there are recipes such as `plone.recipe.zope2instance
<https://pypi.python.org/pypi/plone.recipe.zope2instance>`_ which can be
used to automate this whole process.
After installation, refer to :doc:`operation` for documentation on After installation, refer to :doc:`operation` for documentation on
configuring and running Zope. configuring and running Zope.
......
...@@ -11,14 +11,14 @@ Create a Virtual Environment ...@@ -11,14 +11,14 @@ Create a Virtual Environment
.. code-block:: sh .. code-block:: sh
$ /opt/Python-2.7.9/bin/virtualenv z213 $ virtualenv --python=python2.7 zope
New python executable in z213/bin/python New python executable in zope/bin/python2.7
Installing setuptools, pip, wheel...done. Installing setuptools, pip, wheel...done.
$ cd z213 $ cd zope
Install the Zope2 2.13.22 Software Packages Install the Zope2 Software Packages
------------------------------------------- -----------------------------------
.. code-block:: sh .. code-block:: sh
...@@ -29,6 +29,7 @@ Install the Zope2 2.13.22 Software Packages ...@@ -29,6 +29,7 @@ Install the Zope2 2.13.22 Software Packages
... ...
Successfully installed ... Successfully installed ...
Creating a Zope instance Creating a Zope instance
------------------------ ------------------------
......
...@@ -3,7 +3,7 @@ Zope effective user support ...@@ -3,7 +3,7 @@ Zope effective user support
.. note:: .. note::
It is best practice to run Zope behind a reverse proxy like It is best practice to run Zope behind a reverse proxy like
Apache, Squid or Varnish. In this case, you do not need to run Apache, Nginx or Varnish. In this case, you do not need to run
or install Zope with root privileges, since the reverse proxy or install Zope with root privileges, since the reverse proxy
will bind to port 80 and proxy back all request to Zope running will bind to port 80 and proxy back all request to Zope running
on an unprivileged port. on an unprivileged port.
......
Running Zope2 as a WSGI Application Running Zope2 as a WSGI Application
=================================== ===================================
This document assumes you have installed Zope into a ``virtualenv`` (see This document assumes you have installed Zope into a ``virtualenv`` (see
:doc:`INSTALL-virtualenv`). :doc:`INSTALL-virtualenv`).
Install the Supporting Software Install the Supporting Software
------------------------------- -------------------------------
...@@ -91,6 +91,7 @@ rather than a bare ``FileStorage``): ...@@ -91,6 +91,7 @@ rather than a bare ``FileStorage``):
Because we will be running a separately-configured WSGI server, remove any Because we will be running a separately-configured WSGI server, remove any
``<http-server>`` configuration from the file. ``<http-server>`` configuration from the file.
Create the WSGI Server Configuration Create the WSGI Server Configuration
------------------------------------ ------------------------------------
...@@ -171,35 +172,3 @@ Start the WSGI Server ...@@ -171,35 +172,3 @@ Start the WSGI Server
$ bin/paster serve etc/zope.wsgi $ bin/paster serve etc/zope.wsgi
Starting server in PID 24934. Starting server in PID 24934.
serving on http://127.0.0.1:8080 serving on http://127.0.0.1:8080
Running Other Applications in the same WSGI Server Process
----------------------------------------------------------
You can use any of the normal ``Paste`` WSGI features to combine Zope and
other WSGI applications inside the same server process. E.g., the following
configuration uses the
`composite application <http://pythonpaste.org/deploy/#composite-applications>`_
support offered by ``PasteDeploy`` to host Zope at the ``/`` prefix,
with static files served from disk at ``/static``:
.. code-block:: ini
[app:zope-app]
use = egg:Zope2#main
zope_conf = %(here)s/zope.conf
[pipeline:zope-pipeline]
pipeline =
egg:paste#evalerror
egg:repoze.retry#retry
egg:repoze.tm2#tm
zope-app
[app:static]
use = egg:Paste#static
document_root = %(here)s/static
[composite:main]
use = egg:Paste#urlmap
/ = zope-pipeline
/static = static
...@@ -7,7 +7,6 @@ Contents: ...@@ -7,7 +7,6 @@ Contents:
:maxdepth: 2 :maxdepth: 2
WHATSNEW WHATSNEW
INSTALL
INSTALL-buildout INSTALL-buildout
INSTALL-virtualenv INSTALL-virtualenv
operation operation
......
...@@ -69,24 +69,9 @@ During startup, Zope emits log messages into ...@@ -69,24 +69,9 @@ During startup, Zope emits log messages into
tools (``cat``, ``more``, ``tail``, etc) and see if there are any errors tools (``cat``, ``more``, ``tail``, etc) and see if there are any errors
preventing Zope from starting. preventing Zope from starting.
.. highlight:: none
.. note:: .. note::
For this to work on Windows, the Zope instance must be installed as Running Zope as a daemon is not supported on Windows.
a Service. This is done with::
bin\zopectl install
If you later want to remove this Service, do the following::
bin\zopectl remove
For the full list of options available for setting up Zope as a
Windows Service, do::
bin\zopectl install --help
.. highlight:: bash
Integrating with System Startup Integrating with System Startup
...@@ -100,15 +85,6 @@ calling it without any arguments. Try ``help`` there and ``help <command>`` ...@@ -100,15 +85,6 @@ calling it without any arguments. Try ``help`` there and ``help <command>``
to find out about additionally commands of zopectl. These commands to find out about additionally commands of zopectl. These commands
also work at the command line. also work at the command line.
.. note::
On Windows, a Service can be installed and set to start
automatically with the following:
.. code-block:: none
bin\zopectl install --startup=auto
Logging In To Zope Logging In To Zope
------------------ ------------------
...@@ -136,17 +112,13 @@ If you haven't used Zope before, you should head to the Zope web ...@@ -136,17 +112,13 @@ If you haven't used Zope before, you should head to the Zope web
site and read some documentation. The Zope Documentation section is site and read some documentation. The Zope Documentation section is
a good place to start. You can access it at https://zope.readthedocs.io/ a good place to start. You can access it at https://zope.readthedocs.io/
Troubleshooting Troubleshooting
--------------- ---------------
- This version of Zope requires Python 2.6.4 or better. - This version of Zope requires Python 2.7 or better.
It will *not* run with Python 3.x. It will *not* run with Python 3.x.
- The Python you run Zope with *must* have threads compiled in,
which is the case for a vanilla build. Warning: Zope will not run
with a Python version that uses ``libpth``. You *must* use
``libpthread``.
- To build Python extensions you need to have Python configuration - To build Python extensions you need to have Python configuration
information available. If your Python comes from an RPM you may information available. If your Python comes from an RPM you may
need the python-devel (or python-dev) package installed too. If need the python-devel (or python-dev) package installed too. If
...@@ -154,42 +126,3 @@ Troubleshooting ...@@ -154,42 +126,3 @@ Troubleshooting
should already be available. should already be available.
- See the :doc:`changes` for important notes on this version of Zope. - See the :doc:`changes` for important notes on this version of Zope.
Adding extra commands to Zope
-----------------------------
It is possible to add extra commands to ``zopectl`` by defining *entry points*
in ``setup.py``. Commands have to be put in the ``zopectl.command`` group:
.. code-block:: python
setup(name="MyPackage",
....
entry_points="""
[zopectl.command]
init_app = mypackage.commands:init_application
""")
.. note::
Due to an implementation detail of ``zopectl`` you can not use a minus
character (``-``) in the command name.
This adds a ``init_app`` command that can be used directly from the command
line::
bin\zopectl init_app
The command must be implemented as a Python callable. It will be called with
two parameters: the Zope2 application and a list with all command line
arguments. Here is a basic example:
.. code-block:: python
def init_application(app, args):
print 'Initializing the application'
Make sure the callable can be imported without side-effects, such as setting
up the database connection used by Zope 2.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment