server setup queries/issues

PennController for IBEX Forums Support server setup queries/issues


Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #8236

    Hi Jeremy,

    I’ve been following the guidelines to set up my experiment as a cgi application. I understood from reading the documentation as well as some of the earlier posts that all references to “webspr” are outdated, so I believe that the only major steps were supposed to be (i) changing the SERVER_MODE to “cgi” and optionally (ii) renaming the file. When I execute the python/cgi file after implementing these changes, I get the following error:

    Traceback (most recent call last):
    File “”, line 1850, in <module>
    for l in control(env, start_response):
    File “”, line 1493, in control
    ip = env[‘REMOTE_ADDR’]
    KeyError: ‘REMOTE_ADDR’

    Are there any steps that I’m missing? Is there anything else I would need to do to prevent this error?




    You will get this error if you set SERVER_MODE to "cgi" in but not actually run the experiment as CGI (which would involve visiting the URL of your experiment on a web server under, say, Apache) but instead run it in stand-alone mode using python If you run your experiment on your machine (and not on a web server) then you are running it in “toy” mode, so set SERVER_MODE to "toy"



    Thanks for the response! I’m still unsure of how to run it as cgi: I updated the SERVER_MODE to “cgi” and moved all the multimedia files to the www directory (which contains As I understand, I won’t need to run since I don’t intend to run the experiment in stand-alone mode, but would I need to run the script after updating the port in the file? When I visit the url, I get the ‘site can’t be reached’ error.


    You don’t need to run has this line execfile(SERVER_CONF_PY_FILE, CFG) which takes care of running itself

    All you need to do, when things are configured properly, is visit the URL that points to (eg. or to experiment.html (eg. — experiment.html itself invokes on several occasions, effectively executing it

    To reiterate my point, when running the experiment as a CGI application, you don’t need to run anything yourself: your webserver (if configured properly) will take care of running the script itself upon request (ie by visiting the experiment’s URL). Also, you don’t need to update the PORT variable in, since you are not running your experiment in stand-alone (toy) mode, as per the comments above the PORT line: # The port the server will run on if running in stand-alone mode.

    The “site can’t be reached” error is most likely unrelated to IBEX, but rather to some other configuration on the webserver or domain end, for example. Are you able to visit other resources served by your webserver? I’m afraid I can’t really help with that

    EDIT: it just occurred to me that Chrome does say “This site can’t be reached” if you try to visit localhost:3000 without spinning up in stand-alone (toy) mode. Do you mean to run your experiment in stand-alone (toy) mode on your machine? If so, you do need to run, but make sure the SERVER_MODE variable in is set to "toy" (and make sure you visit the same port that you set in, which is 3000 by default)


    • This reply was modified 11 months, 2 weeks ago by Jeremy.
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.