• BU Home | 
  • News | 
  • Events | 
  •  | 
  •  

Web Services Wiki

Welcome Guest: Login

Deploy Silva Instance using Buildout

Using buildout

  1. For production, determine the server and the directory where the silva instance will be established.  For user instances, only the directory needs to be determined.
  2. Create the silva directory structure if necessary and navigate to that directory.
  3. Using SVN, checkout a copy of the Silva buildout from <svn repository>/buildout/silva/Silva-2.1.1 into the designated directory.

    Example:
    [zope@arwen Silva-2.1]$ svn co https://svn-web.bethel.edu/Zope-Projects/buildout/silva/trunk Silva-2.1
    

    The example checks out the silva buildout trunk into a directory named Silva-2.1.

Determine the Configuration

Prior to setting up the buildout, you need to determine what configuration file you will use.  A standard configuration file will be supplied with Silva buildout.  You will probably be using a test or production configuration for the environment you are developing.  You can extend multiple configurations in your setup.  Ultimately they will extend the base.cfg in the profiles directory.  Configuration files are maintained in the profiles directory of the buildout structure.

Bootstrapping the Buildout

Make sure that your server has the appropriate version of python installed.  Check the Silva version you wish to install to determine what version is required.  You may need to install a python version on the server you are developing.  Silva 2.1.1 still requires python 2.4.

Production
  1. Once you have determined the appropriate configuration file (see above), it can be identified in the --buildout-profile parameter.
  2. Using the required version of python (use the full path to the appropriate version on the command line if necessary), run the bootstrap.py script as the zope user.  Make sure you specify the appropriate version of the configuration in the --buildout-profile parameter.

    Example:
    [zope@arwen Silva-2.1]$ ~/python/bin/python  bootstrap.py  --buildout-profile profiles/rodstest.cfg
User Instance
  1. In the base directory of the buildout there should be a file called buildout.cfg.in.  Copy this file to buildout.cfg.

    Example:
    [Silva-2.1]$ cp buildout.cfg.in buildout.cfg
    
  2. Edit and modify the buildout.cfg file to point to the appropriate determined configuration file (see above).

    Example:
    extends = profiles/rodstest.cfg
    
  3. Using the required version of python (use the full path to the appropriate version on the command line if necessary), run the bootstrap.py script.

    Example:
    [Silva-2.1]$ python bootstrap.py
    

Prior to Running Buildout

Two remote svn servers have security certificates which aren't initially trusted.  Use 'svn' to do a checkout from each, to permanently accept the server's certificate:

[zope@arwen Silva-2.1]$ svn co https://codespeak.net/svn/kupu/tag/kupu-1.4-silva kupu
[zope@arwen Silva-2.1]$ svn co https://svn.infrae.com/Formulator/trunk Formulator

Once the certificates have been accepted the directories can be deleted:

[zope@arwen Silva-2.1]$ rm -rf kupu
[zope@arwen Silva-2.1]$ rm -rf Formulator

Run Buildout

[zope@arwen Silva-2.1]$ ./bin/buildout install mxzopeda-licenses
[zope@arwen Silva-2.1]$ ./bin/buildout

After Running Buildout

Structure the buildout directories for editing.

Since you can not "edit" the product files as the zope users, it is a good idea to add write permission at the group level on the files created in the buildout.  From the base directory of the buildout run the following command:

[zope@arwen Silva-2.1]$ chmod -R g+w *

Configure Instance for Active Directory

If this instance will be integrated with Active Directory (which is very likely as AD is used to get person information for usernames), two steps need to be taken:

  1. Setup username/password for Active Directory

    1. The username and password are stored in a file in the home directory of the user that is running the instance.
    2. Edit (creating if necessary) the file: ~/.active-directory-ws-pwd
    3. Locate this file on a system/server which is already setup, copy the contents of that file into this new one.
    4. This file should be one line, in the format <username>:<password>
  2. Instruct the ldap library to not verify server certificates:

    1. If you have access as root, edit /etc/openldap/ldap.conf (on a mac this may be /opt/local/etc/openldap/ldap.conf).  Otherwise edit ~/.ldaprc (~ is the home directory of the user running the instance)
    2. add the following:

      TLS_REQCERT     never

Startup zope (using 'instance fg'), and try to access using your web browser.  If you get an error like:

CONNECT_ERROR: {'info': 'error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed', 'desc': 'Connect error'}

This means that the setting in ldap.conf isn't being read.  Try placing this in the following file in the user's home directory: ~/.ldaprc, restart zope and try again.

Starting the Zeoserver and the Server Instance

If you are using a zeo-server configuration (standard configuration) and no server instance exists on the server you are configuring, you will need to start the zeoserver.  Run the following command from the bin directory:

[zope@arwen Silva-2.1]$ bin/zeoserver [start, stop, status]


It is always a good idea to check the status of the zeoserver prior to actually running the command with the start parameter.