June 14, 2022 at 9:23 pm #8236supadhyeParticipant
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’]
Are there any steps that I’m missing? Is there anything else I would need to do to prevent this error?
Thanks!June 14, 2022 at 10:37 pm #8237JeremyKeymaster
You will get this error if you set
"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
JeremyJune 17, 2022 at 3:33 am #8238supadhyeParticipant
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.June 21, 2022 at 9:41 am #8242JeremyKeymaster
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
PORTvariable in server_conf.py, since you are not running your experiment in stand-alone (toy) mode, as per the comments above the
# 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:3000without spinning up
server.pyin 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_MODEvariable 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
- This reply was modified 1 year, 5 months ago by Jeremy.
- You must be logged in to reply to this topic.