Developers' Forum

Jobe server with Nginx

 
Picture of KiranKumar Rama
Jobe server with Nginx
by KiranKumar Rama - Wednesday, 22 August 2018, 2:12 AM
 

Hi,

As part of another server model, we use Nginx as the web server to which the other solutions are integrated. In the same server, we would like to install the Jobe Server but it fails for installation and asking whether "is web server running?"

Can we use Nginx as web server for jobe server deployment?

If not, then is there any other way to resolve this issue as we cant enable Apache in this server.

On the other note, if Apache is must, and if it is made to run on other port instead of 80 like 8090 port, then how can we deploy / integrate jobe server with coderunner in moodle?

Appreciate your kind suggestions and help in this regard.

Thanks and Regards,

KiranKumar Rama

Picture of Richard Lobb
Re: Jobe server with Nginx
by Richard Lobb - Wednesday, 22 August 2018, 10:06 PM
 

Hi

I hadn't ever used nginx, so I just fired up a droplet on DigitalOcean and tried to get Jobe working on it. I had no trouble getting the Jobe install script to work. Just replace the entire contents of the get_webserver() function in the script with

def get_webserver():
    return 'www-data'

I then got PHP working, using this website. So far so good, but Jobe still didn't work. It appears that the CodeIgniter framework that Jobe uses doesn't work directly with nginx. It looks like there's plenty of web documentation on how to get it to work, but I'm sorry I don't have time to figure it all out. And I don't wish to get into supporting this as an option.

To get yourself going, for a start at least, I recommend running Jobe on a server in the cloud. I've fired up several Jobe servers on Digital Ocean servers and prepared a video on how to do it. It only takes about 20 minutes to get it up and running and costs as little as $5 per month for a minimal system.

It should be possible to run both Moodle (via nginx) and Jobe (via Apache) on the same server but I really don't recommend that. It's fundamentally unsafe. Jobe is pretty secure but nothing is 100% hacker-proof. If a student job managed to bust security in Jobe it would then have access to the entire Moodle database including all student coursework results.

Richard

Picture of KiranKumar Rama
Re: Jobe server with Nginx
by KiranKumar Rama - Thursday, 23 August 2018, 5:46 PM
 
Thank you very much for your support and information. I will take this forward and will test it in my server. however i believe once jobe is installed, the way of testing it is only by executing the
python3 testsubmit.py
command only - right? is there any way to test it from web interface through url to check whether nginx configuration was correct or not? i mean how can we test whether web server configuration is good or not - if the output of the command prompt testsubmit.py results are OK then can we consider that the webserver configuration is good?

Thanks and Regards,
KiranKumar Rama
Picture of Richard Lobb
Re: Jobe server with Nginx
by Richard Lobb - Thursday, 23 August 2018, 7:33 PM
 

testsubmit.py sends http requests to jobe on port 80, using the variable JOBE_SERVER as the jobe host name. If nginx (or whatever web server you're using) isn't configured correctly on the Jobe host, the http requests will fail. So if you copy testsubmit.py to another machine (e.g. your moodle server), change JOBE_SERVER to the Jobe host name, and run testsubmit.py, you're testing the full Jobe functionality.

A simple initial sanity test is to point a web browser at the url

http://<jobeserver>/jobe/index.php/restapi/languages

You should get back a JSON response like

[["c","7.3.0"],["cpp","7.3.0"],["java","10.0.1"],["matlab","9.3.0.713579"],["nodejs","8.10.0"],["octave","4.2.2"],["pascal","3.0.4"],["php","7.2.7"],["python2","2.7.15"],["python3","3.6.5"]]
This won't work if API key security is turned on but that's not usually appropriate anyway.

Make sure before trying any of the above that the Jobe firewall is off, or at least is allowing connections from whatever machine you testing from.