Configuring

Accessing the Zope Management Interface

To log in to the Zope Management Interface (ZMI):

  1. Open http://domain/manage in a browser, where domain is the domain and URL path where the Zope application is mounted. The login form appears.
  2. In the User Name field, enter admin.
  3. In the Password field, enter the admin password. You can find the automatically generated admin password in ~/webapps/zope/zinstance/adminPassword.txt, where zope is the name of the Zope application as it appears in the control panel.

Creating a Plone Site

  1. If you haven’t already, create a Zope application.
  2. Log in to the ZMI.
  3. In the Select type to add... menu, click to select Plone site. The Add Plone Site form appears.
  4. In the Id field, enter a unique identifier for the Plone site.
  5. In the Title field, enter a title for the Plone site.
  6. Click the Add Plone Site button. The Plone site is created.

To visit the new Plone site, open http://domain/id in a browser, where domain is the domain and URL path where the Zope application is mounted and id is the identifier you entered in the Add Plone Site form.

Configuring Plone to Send Email

To configure Plone to send email:

  1. Log in to your Plone site as an admin user.
  2. Click Site Setup. The Site Setup page appears with the Plone Configuration list.
  3. Click Mail. The Mail settings page appears.
  4. In the SMTP server field, enter smtp.webfaction.com.
  5. In the ESMTP username field, enter a mailbox name as it appears in the WebFaction control panel.
  6. In the ESMTP password field, enter the mailbox password.
  7. In the Site ‘From’ name field, enter the name you would like to have appear on emails sent by Plone.
  8. In the Site ‘From’ address field, enter an email address as it appears in the WebFaction control panel.
  9. Click Save. A confirmation message will appear at the top of the page.

Plone will now be able to send email for password resets, notifications, and other uses.

Configuring Zope and Plone Time Zone

To select a time zone for your Zope and Plone application:

  1. Open an SSH session to your account.
  2. Edit the Zope and Plone application’s buildout.cfg file.
    1. Open $HOME/webapps/application/zinstance/buildout.cfg in a text editor.
    2. Add the time zone setting. Under environment-vars =, add a line containing TZ Region/City_Name, where Region/City_Name is a time zone name from from the IANA Time Zone Database. For example, the United States Eastern time zone name is America/New_York and the Indian Standard Time name is Asia/Kolkata.
    3. Save and close the file.
  3. Switch to your Zope and Plone application’s zinstance directory. Enter cd $HOME/webapps/application/zinstance, where application is the name of the Zope and Plone application, and press Enter.
  4. Run buildout. Enter ./bin/buildout and press Enter.
  5. Restart the application application.

Creating an Emergency Admin User

If you have lost or forgotten the admin password for the Zope Management Interface (ZMI), you can create an emergency user from the command line. To create an emergency admin user:

  1. Open an SSH session to your account.
  2. Switch to the zinstance directory for your Zope and Plone application. Enter cd ~/webapps/application/zinstance, where application is the name of the Zope application as it appears in the control panel, and press Enter.
  3. Stop the Zope application. Enter ./bin/instance stop and press Enter.
  4. Create the emergency user. Enter ./bin/instance adduser username password, where username is a unique username for the emergency user and password is a temporary password for the emergency user, and press Enter.
  5. Restart the Zope application. Enter ./bin/instance start and press Enter.

You can now access the ZMI using the username and password you just created. You should remove the emergency user or change the password of the emergency user as soon as possible, as the user’s password may be visible in your shell history.

Enabling FTP

To enable FTP access for a Buildout-based Zope application:

  1. Create a Custom app (listening on port) application. Make a note of the port number assigned to the application, it will be required later.
  2. Open an SSH session to your account.
  3. Switch to the Zope application’s zinstance directory. Enter cd ~/webapps/application/zinstance, where application is the name of your Zope application, and press Enter.
  4. Open buildout.cfg in a text editor.
  5. In the [instance] section of the file, add a new line containing ftp-address = port, where port is the port number assigned to the Custom app (listening on port) application.
  6. Save and close the file.
  7. Run buildout. Enter ./bin/buildout and press Enter.
  8. Restart your Zope application.
  9. Open a support ticket to request external access to your FTP application’s port.

To enable FTP access for other Zope applications:

  1. Create a Custom app (listening on port) application. Make a note of the port number assigned to the application, it will be required later.

  2. Open an SSH session to your account.

  3. Open ~/webapps/application/Zope/etc/zope.conf in a text editor, where application is the name of your Zope application.

  4. Add:

    <ftp-server>
      address port
    </ftp-server>
    

    where port is the port number assigned to the Custom app (listening on port) application.

  5. Save and close the file.

  6. Restart your Zope application.

  7. Open a support ticket to request external access to your FTP application’s port.

Enabling WebDAV

To enable WebDAV access for a Buildout-based Zope application:

  1. Create a Custom app (listening on port) application. Make a note of the port number assigned to the application, it will be required later.
  2. Open an SSH session to your account.
  3. Switch to the Zope application’s zinstance directory. Enter cd ~/webapps/application/zinstance, where application is the name of your Zope application, and press Enter.
  4. Open buildout.cfg in a text editor.
  5. In the [instance] section of the file, add a new line containing webdav-address = port, where port is the port number assigned to the Custom app (listening on port) application.
  6. Save and close the file.
  7. Run buildout. Enter ./bin/buildout and press Enter.
  8. Restart your Zope application.
  9. Open a support ticket to request external access to your WebDAV application’s port.

To enable WebDAV access for other Zope applications:

  1. Create a Custom app (listening on port) application. Make a note of the port number assigned to the application, it will be required later.

  2. Open an SSH session to your account.

  3. Open ~/webapps/application/Zope/etc/zope.conf in a text editor, where application is the name of your Zope application.

  4. Add:

    <webdav-source-server>
        # valid keys are "address" and "force-connection-close"
        address port
        force-connection-close off
    </webdav-source-server>
    

    where port is the port number assigned to the Custom app (listening on port) application.

  5. Save and close the file.

  6. Restart your Zope application.

  7. Open a support ticket to request external access to your WebDAV application’s port.

Installing a Python Package

Many Plone packages are distributed as Python eggs through the Python Package Index. To install such packages into a Plone application:

  1. Open an SSH session.

  2. Switch to the Plone application’s zinstance directory. Enter cd ~/webapps/plone_application/zinstance, where plone_application is the name of the Plone application as it appears in the control panel, and press Enter.

  3. Open buildout.cfg.

  4. In this portion of the file:

    # Add additional eggs here
    eggs =
    

    enter the name of the package to be installed as it appears on the Python Package Index on a new line beneath eggs =, indenting four spaces.

    For example, suppose new.package were to be installed. buildout.cfg would be edited to contain:

    # Add additional eggs here
    eggs =
        new.package
    
  5. Save and close the file.

  6. Complete the installation with the buildout script. Enter ./bin/buildout and press Enter. The package (or packages) will be downloaded and installed.

Installing a Zope Product

Some Zope products can be installed to the products directory in your Zope application. To install such a Zope product:

  1. Upload the product to ~/webapps/zope/zinstance/products, where zope is the name of the application as it appears in the control panel.
  2. Restart your Zope application.

Packing the Zope Object Database

The Zope Object Database (ZODB) stores a continuous history of transactions; as a result, the ZODB can grow indefinitely large, consuming increasing memory and disk storage, unless it is periodically packed. Packing trims the size of the Data.fs file by removing older history items. To pack the database:

  1. Log in to the Zope Management Interface.
  2. In the tree view, click Control_Panel. The Control Panel appears.
  3. Click Database Management. The Databases list appears.
  4. Click main. The Database Management page appears.
  5. In the days field, enter the number of days’ history to retain.
  6. Click the Pack button. Depending on the size of the database, this may take some time. You may even see an Internal Server Error; do not be alarmed. The database packs in the background.
  7. Wait until the ZMI resumes responding normally.
  8. Restart Zope.

Serving Plone at a Root URL Path

A Plone site, by default, is served on a subpath of a domain. For example, if a Zope application is hosted at http://example.com/, a Plone site running on that instance of Zope will be available at http://example.com/plone_site. It is possible, however, to serve that Plone site at the root of the domain such that the Plone site is available at http://example.com/.

To serve a Plone site at a root URL path, create an appropriate Virtual Host Monster (VHM) mapping:

  1. Log in to the Zope Management Interface (ZMI).

  2. Click virtual_hosting. The Virtual Host Monster’s About page appears.

  3. Click the Mapping tabs. The mapping form appears.

  4. Enter the mappings you need in the text area. Mappings take the form of query/path and are limited to one per line.

    • To redirect a root domain to a Plone site, enter domain/plone, where domain is the domain and plone is the Plone site. For example, to direct http://example.com/ to my_plone, enter example.com/my_plone.

    • To direct multiple domains, use a wildcard (*). For example, to direct all subdomains of example.com to my_plone, enter *.example.com/my_plone.

      Warning

      When using a wildcard, be sure to preserve an entry point to the ZMI. For example, enter admin.example.com/ to turn off mappings for the admin subdomain.

  5. Click the Save Changes button.

Starting, Stopping, and Restarting Zope

To start, stop, or restart a Zope application:

  1. Open an SSH session to your account.

  2. Switch to the ~/webapps/zope/zinstance/bin directory, where zope is the name of the Zope application. Enter cd ~/webapps/zope/zinstance/bin and press Enter.

  3. Issue a zopectl command.

    • To stop Zope, enter ./instance stop and press Enter.
    • To start Zope, enter ./instance start and press Enter.
    • To restart Zope, enter ./instance restart and press Enter.

    A confirmation message will appear.

Using Zope Over HTTPS

Because Zope does not respect the X-Forwarded-SSL header provided by front-end servers, Zope must be modified to ensure that HTTPS connections are not redirect to HTTP. There are two methods to resolving this problem.

Method 1: WebFaction SSL Patch for Zope

One easy method to enabling HTTPS support for Zope on WebFaction web servers is to the install the WebFaction SSL Patch for Zope.

  1. Open an SSH sesion to your account.
  2. Switch to the products subdirectory in your Zope application. Enter cd ~/webapps/zope/zinstance/products, where zope is the name of the application as it appears in the control panel, and press Enter.
  3. Download the patch archive. Enter wget -O patch.tar.gz http://wiki.webfaction.com/attachment/wiki/WebFactionSslPatch/WebFactionSSLPatch-1.0.tar.gz?format=raw and press Enter. The archive is downloaded.
  4. Extract the archive. Enter tar -zxvf patch.tar.gz and press Enter.
  5. Delete the archive. Enter rm patch.tar.gz and press Enter.
  6. Restart your Zope application.

Method 2: Modify HTTPRequest.py

  1. Open an SSH session to your account.

  2. Open ~/webapps/zope/Zope-X.Y.Z-final-pyA.B/lib/python/ZPublisher/HTTPRequest.py in a text editor.

  3. Replace:

    if have_env('HTTPS') and (
        environ['HTTPS'] == "on" or environ['HTTPS'] == "ON"):
        protocol = 'https'
    elif (have_env('SERVER_PORT_SECURE') and
        environ['SERVER_PORT_SECURE'] == "1"):
        protocol = 'https'
    else:
        protocol = 'http'
    

    with:

    if have_env('HTTPS') and (
        environ['HTTPS'] == "on" or environ['HTTPS'] == "ON"):
            protocol = 'https'
    elif (have_env('SERVER_PORT_SECURE') and
        environ['SERVER_PORT_SECURE'] == "1"):
        protocol = 'https'
    elif have_env('HTTP_X_FORWARDED_SSL') and (
        environ['HTTP_X_FORWARDED_SSL'] == "ON" or
        environ['HTTP_X_FORWARDED_SSL'] == "on"):
        protocol = 'https'
    else: protocol = 'http'
    
  4. Save and close the file.

  5. Restart your Zope application.