[Zope] - Zope with Apache

Andy Smith andy@verticality.com
Mon, 21 Dec 1998 03:02:08 -0500


>
> Dear All:
>
> I am unable to get Zope to work with Apache for the past
> week or so after multiple attempts (on Linux and Solaris).
> So i am going to email to the group one last time:


Hi Vincent...

Are you still having this problem?

I just downloaded and built Apache 1.3.3 and it works fine with Zope 1.9b3
on RHL5.1 Intel.

I stole the http.conf and start scripts from the recent 'Zap' release. The
only real change I made was to move the Rewrite rule from the 'start' script
into the httpd.conf.

I *was* getting the error message you were getting while playing around with
the configuration, but I found that killing the publisher as well as apache
in between restarts fixed the problem.

Cheers,

Andy.


httpd.conf ===========================================
# httpd.conf file pre-configured for Zope.  Note that
# most of the configuration is specified in the start script
# in the parent directory.

Port 8998

RewriteEngine On
RewriteCond %{HTTP:Authorization}  ^(.*)

RewriteRule ^/Zope/(.*) /home/andy/apache_1.3.3/cgi-bin/Zope.cgi/$1
[last,e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l]
=====================================================

start  ====================================================
#!/bin/sh

# Get script dir
if [ -n "`echo $0|sed -e 's%[^/]%%'`" ]; then
  dot=`echo $0 | sed -e 's%/[a-z.]*$%%'`
else
  dot=.
fi
sav=`pwd`
cd $dot >/dev/null 2>/dev/null
dot=`pwd`
cd $sav >/dev/null 2>/dev/null

# Modify this section to change the user that will run
# the web server by default if this script is run by root.
if (id | grep root >/dev/null); then
  usr='nobody'
  echo You are starting the web server as root - the server
  echo will be run as the user nobody. If you want the server
  echo to run as a different user, edit the start script.
  echo
else
  usr=`whoami`
fi

# Check to see if Zope var is writable.  If not, then
# the user running Apache won't be able to startup Princpia.

if [ ! -w $dot/../var ]; then
  echo Cannot write to Zope var directory.  Perhaps it
  echo was installed as a different user?
  exit 0
fi

# Archive old version of Apache log
if [ -f $dot/logs/error_log ]; then
  mv $dot/logs/error_log $dot/logs/error_log-`date '+%y-%m-%d.%H%M%S'`
fi

# If Zope has been started up before, then cleanup
if [ -f $dot/../var/Main.soc ]; then
  rm -f $dot/../var/Main.soc
fi
if [ -f $dot/../var/Main.pid ]; then
  rm -f $dot/../var/Main.pid
fi

ServerName=`uname -n`

# Try to startup Apache
$dot/httpd -d $dot \
-f $dot/conf/httpd.conf \
-C "User $usr" \
-C "ServerName $ServerName" \
-C "ServerRoot $dot" \
-C "DocumentRoot $dot/htdocs" \
-C "TransferLog $dot/logs/access_log" \
-C "ErrorLog $dot/logs/error_log" \
-C "PidFile $dot/logs/httpd.pid" \
-C "LockFile $dot/logs/accept.lock" \
-C "RewriteLog $dot/logs/rewrite_log" \
-C "RewriteLogLevel 9"

# Need to sleep a while to let Apache write its PID file and error_log
sleep 1

# If Apache didn't crank up, bail out
if [ -f $dot/logs/httpd.pid ]; then
  echo "Apache started successfully."
else
  echo "Apache DID NOT start successfully."
  if [ -f $dot/logs/error_log ]; then  # Display error log, if it exists
    echo "$dot/logs/error_log says:"
    tail $dot/logs/error_log
  fi
  exit 0
fi
====================================================