server setup queries/issues

PennController for IBEX Forums Support server setup queries/issues

Tagged: 

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

    Hi Jeremy,

    I’ve been following the guidelines https://github.com/addrummond/ibex/blob/master/docs/manual.md#setting-up-the-server 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 server.py file. When I execute the python/cgi file after implementing these changes, I get the following error:

    Traceback (most recent call last):
    File “server.py”, line 1850, in <module>
    for l in control(env, start_response):
    File “server.py”, 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?

    Thanks!

    #8237
    Jeremy
    Keymaster

    Hi,

    You will get this error if you set SERVER_MODE to "cgi" in server_conf.py 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 server.py. 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"

    Jeremy

    #8238
    supadhye
    Participant

    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 server.py). As I understand, I won’t need to run server.py since I don’t intend to run the experiment in stand-alone mode, but would I need to run the server_conf.py script after updating the port in the file? When I visit the url, I get the ‘site can’t be reached’ error.

    #8242
    Jeremy
    Keymaster

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

    All you need to do, when things are configured properly, is visit the URL that points to server.py (eg. https://my.domain.xyz/myxp/server.py?withsquare=0) or to experiment.html (eg. https://my.domain.xyz/myxp/experiment.html) — experiment.html itself invokes server.py 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 server_conf.py, 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 server.py 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 server.py, but make sure the SERVER_MODE variable in server_conf.py is set to "toy" (and make sure you visit the same port that you set in server_conf.py, which is 3000 by default)

    Jeremy

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