[Zope] using Zope on a third-party web hosting provider

Matthew Scott gldnspud@lab.net
Sat, 19 Feb 2000 19:29:23 -0600


After I evaluated Zope on my home machine and started using it to
develop a web site, I wanted to use it to revamp and improve upon
another web site I run.  The problem was, I only evaluated and started
using Zope on machines that I had full, administrator access to. The web
site I wanted to revamp is on a third-party hosting site where I don't
have much control.

I searched through mailing list archives but couldn't find a suitable
solution that would work on the provider I use (csoft.net).  I figured
out a solution that is only slightly awkward and works fine for my uses,
so I am posting it here for others to use.

Hopefully this will allow more people to evaluate Zope and more people
to use the product on third-party virtual hosts.




Some configuration details about csoft.net's servers before I outline
the solution. You'll have to take these into account if you adapt this
to another provider.

* telnet/ssh access is provided

* necessary compilers/interpreters (gcc and python) are installed

* CGI scripts can run anywhere in the www tree as long as they have the
.cgi extension

* scripts can be called with or without their extension -- i.e. as long
as there are no other files starting with "zope" you can call zope.cgi
with either zope or zope.cgi in the URL

* htaccess files can be used for authentication

* your CGI scripts are run under your UID




The solution (adapt to your provider):

* unpack zope into your home directory (I named my folder ~/zope)

* go into ~/zope and run:  python w_pcgi.py
  This will compile and prepare Zope for use

* edit your ~/zope/start script to read as follows (this turns off the
web, FTP, and monitor servers as well as turning off debugging)
#! /bin/sh
reldir=`dirname $0`
PYTHONHOME=`cd $reldir; pwd`
export PYTHONHOME
exec /usr/bin/python \
     $PYTHONHOME/z2.py \
     -w '' \
     -f '' \
     -m ''

* edit the "access" file (or create it if it doesn't exist yet) and put
in one line:
superuser:
(You can name the user whatever you like. Remember the colon after the
username; do not put anything after the colon though)

* cd ~

* htpasswd -c zopeusers superuser   (This will prompt you for the
superuser password. Change superuser to whatever name you want your
superuser to be)

* cd ~/www      (this is the root document folder on csoft.net accounts)

* cp ~/zope/Zope.cgi ./zope.cgi   (Copy the zope CGI script to your root
document folder. I actually called mine domain.cgi so I can go to
www.domain.cgi/domain/folder/etc but you can name it whatever you like

* mkdir manage; cd manage   (This will make a management folder that
will authenticate your password. This is where it gets just a tad
klugey)

* create a .htaccess file in this folder containing this:
AuthType Basic
AuthName Zope-realm
AuthUserFile /path/to/your/home/zopeusers
require valid-user

* cp ../zope.cgi .       (This provies your manage folder with access to
Zope)




I hope I didn't leave any steps out. Here is how you view and manage
your new Zope installation based on the instructions above:

* to view your Zope objects as normal, just go to
http://www.domain.com/zope/  (or http://www.domain.com/zope.cgi/ if you
cannot leave off the trailing .cgi)

* to view your Zope management interface, you need to go to
http://www.domain.com/manage/zope.cgi/manage and authenticate yourself.
You can actually view your Zope web here by leaving off the last /manage
but you will still need to authenticate yourself.




Some notes:

* if you want to add users to the Zope interface, add them there with no
passwords. Then, go to your home directory and type "htpasswd zopeusers
username" to add/change a user in the password list that apache uses.

* if you need to use Zope as your index file, use your index file in
your root document folder to redirect. For instance, since csoft.net
supports PHP, I can create a small one-line index.php3 file to
accomplish this very quickly:
<? Header('Redirect: http://www.domain.com/zope/'); ?>




Please let me know if there are any improvements you can see in this
setup, or any pitfalls I have not yet discovered.



Happy Zope smoking!



--
._-+$=%##########%=$+-_.
|#  Matthew R. Scott  #|
|#  gldnspud@lab.net  #|
`~-+$=%##########%=$+-~'