Skip to content. | Skip to navigation

Navigation

Personal tools

Web Applications

This guide shows how to build several web applications and servers. The basic concept is that of an Apache 2 webserver fronting several application servers (such as Apache Tomcat and Plone). We'll be hosting several domains and handling SSL. To avoid unnecessary rebuilding we'll attempt to reuse existing infrastructure.

Zope

Zope is required for Plone.

Note

Extract with GNU tar.

and use GNU make (gmake if /usr/sfw/bin is on your PATH)

cd .../Zope-2.8.4-final

# force a particular python (configure complains otherwise)
./configure --prefix=/usr/local/${PWD##*/} --with-python=/usr/local/Python-2.4.2/bin/python

LDFLAGS="-L/usr/local/Python-2.4.2/lib -R/usr/local/Python-2.4.2/lib" make
make install

We now need to create a Zope instance. Each Zope instance is (for our purposes) a server and will be listening on a particular port. The mkzopeinstance.py script will be asking for a top-level directory for that instance to live in. This guide uses a directory based on the Zope version and port number, eg. /www/zope/2.8.4-7070:

/usr/local/Zope-2.8.4-final/bin/mkzopeinstance.py

The only thing you need worry about immediately is editing the configuration file .../etc/zope.conf to optionally restrict which interfaces the server will listen on (default is all) and what port number the server will listen on (default is 8080).

  1. look for the section with the attribute ip-address. You might change it to just listen on localhost:

    ip-address 127.0.0.1
    

    Which would be a good idea for a non-firewalled server.

  2. look for the section with the attribute http-server. Very simply change the port number from 8080 to whatever you're happy with:

    <http-server>
      # valid keys are "address" and "force-connection-close"
      address 7070
      # force-connection-close on
    </http-server>
    

Zope doesn't like being run as root (and in fact won't) so we need to sort out a new user.

Note

Solaris' rules mean you must both:

  1. Give zope a home directory so its crontab can run
  2. lock the passwd entry with -N rather than -l
su

groupadd zope
useradd -g zope -d /www/zope zope

# zope needs write permission to the hierarchy!
cd /www/zope
chown -R zope:zope

passwd -N zope

Finally, we need some startup/shutdown/backup scripts to keep everything nicely automated.

Note

This section is incomplete (I haven't uploaded the scripts!) and the startup/shutdown should be migrated to an SMF service.

su zope
crontab <<EOF
0 5 * * * /www/zope/backup-zopeinstances full >/var/tmp/zope-cron 2>&1
EOF

# create the backup directory
mkdir /www/zope/version-port/var/backup

cat <<EOF >/etc/init.d/zope
#! /bin/ksh

ZOPE_ROOT=/www/zope
LOG=/var/tmp/zope.log

exec 3>&1 >\${LOG} 2>&1

PATH=\$PATH:/usr/local/bin:/usr/sfw/bin:/opt/sfw/bin

action=\$1

case "\${action}" in

start|stop)

    su zope -c "\${ZOPE_ROOT}/startzopeinstances \${action}"

    ;;

esac
EOF
chmod +x /etc/init.d/zope
ln /etc/init.d/zope /etc/rc3.d/S60zope
ln /etc/init.d/zope /etc/rc3.d/K60zope

Document Actions