Version 9 (modified by lawrence, 15 years ago) (diff)


How to Install the NDG Browse Code

[This page is NOT FINISHED ... and is not a real guide to do anything YET, further, I *KNOW* this doesn't work as of January 25th]

(Intended for *full* NDG data providers: that is, data providers who *do* have their own browse repository of MOLES documents.)

Note that the new browse and discovery code is integrated using paste, so you will need to ensure you have all the paste code installed in your python. In the following instructions, I'll assume you have access to your python, and that it exists at /your/path/bin/python. You may not need all these steps depending on the state of your system, and you may have needed to ensure that you have a http proxy variable set! Note also that much of this will be vastly simplified when we eggify the installation!

  1. Setup fastcgi. Your apache configuration should have something like this in it:
    <IfModule mod_fastcgi.c>
      Alias /retrieve "/var/www/fastcgi/ndg"
      Alias /browse "/var/www/fastcgi/ndg"
      Alias /discovery "/var/www/fastcgi/ndg"
      Alias /layout "/var/www/fastcgi/ndg"
      <Directory /var/www/fastcgi>
        SetHandler fastcgi-script
        Order allow,deny
        Allow from all
      # following socket ought to be setup by paste via ndg.ini (bnl)
      FastCgiExternalServer /var/www/fastcgi/ndg -socket /tmp/ndg_fastcgi.soc
  2. Make sure the pieces we need from paste are installed:
    /your/path/bin/easy_install paste
    /your/path/bin/easy_install PasteDeploy
    /your/path/bin/easy_install PasteScript
    /your/path/bin/easy_install flup
    /your/path/bin/easy_install wsgiutils
  3. If your python is 2.4 or less (it comes as standard in 2.5), you'll need elementtree:
    /your/path/bin/easy_install elementtree
  4. And now for the big one, we need a recent version of ZSI. I've used the default today, which pulled ZSI-2.0RC3. Watch out for this one because a later one might break. Let me know how this goes!:
  5. Get the contents of TI07-MOLES/trunk/PythonCode/wsgi and put them into a suitable directory on your webserver, and change the ownership of the directory to apache (or whatever account you run your website under).
  6. cd into that directory!
  7. Modify so that MYPYTHONBIN points to your python:
  8. Modify the contents of ndg.ini so that the socket matches the description in your fastcgi setup, so it has this in the server.main section:
    use = egg:PasteScript#flup_fcgi_thread
    socket = /tmp/ndg_fastcgi.soc
  9. Create a passwords.txt file and make sure it exists in the directory from which you run the deploy script (and check that you can't get access to that directory via the web!). It is for allowing the browse code access to your exist repository and should have the following format: exist_access_usercode password
  10. x
  11. ...


If you have trouble setting up wsgi and fastcgi, see if you can get the wsgiEnvTest code working. You will need to modify for your python path, possibly your web server user and modify wsgiEnvTest.ini for your wsgi server environment, but you should then be able to point your browser at  http://yourhost/browse, and see the wsgi environment variables!