HTTP Error

HTTP Error

de Matt Elliot -
Número de respuestas: 2

Hi all, 

I can get Jobe installed and running on a clean digitalocean droplet running Ubuntu 20.10 x64. However, I'm attempting to install JOBE on the same server as Moodle. 

I'm following this 1-click install on digitalocean: https://marketplace.digitalocean.com/apps/moodle

Im just testing Jobe at the moment and all I have done is clicked the 1 click install. I haven't set up mariaDB or SSL or anything for the moodle site. 

I get this error a load of times:

***************** HTTP ERROR ******************
 Response: 404 Not Found <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.4.38 (Debian) Server at localhost Port 80</address>
</body></html>
Doing child 2
***************** HTTP ERROR ******************

ALSO:

Response to putting 4e4fe7b340befa7ca810f14d3997bb06 :

405 Method Not Allowed b'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\n<html><head>\n<title>405 Method Not Allowed</title>\n</head><body>\n<h1>Method Not Allowed</h1>\n<p>The requested method PUT is not allowed for this URL.</p>\n<hr>\n<address>Apache/2.4.38 (Debian) Server at localhost Port 80</address>\n</body></html>\n'


At first I thought it was something to do with the SSL certificate from certbot but ths time I haven't set that up. I also thought it was the UFW firewall blocking it, but I have disabled that. Ive tried to look at the log for JOBE but I can't seem to find it in /var/log/jobe. It's just an empty folder.

Any ideas? Is it something that moodle has changed with apache disabling PUT? I dont know where to find/change that...

Thanks in advance!


Edit: Attached contents of my apache.conf file. Is the problem here?

En respuesta a Matt Elliot

Re: HTTP Error

de Richard Lobb -

The 1-click Moodle droplet is set up to allow Apache access only to the moodle directory (/var/www/moodle-1click). Jobe resides at /var/www/html/jobe so is inaccessible.

A hack to get it going is to put a symbolic link from Moodle to jobe with the commands

    cd /var/www/moodle-1click
    ln -s /var/www/html/jobe

You should then be able to run testsubmit.py

BUT this is a seriously bad idea. Running Jobe on port 80 without a firewall to prevent access except from your Moodle server allows anyone in the world to run any code they like on your server. You really don't want to do that!

Running Jobe on your Moodle server is dangerous anyway, but if you're going to do it you need at very least to make sure that only Moodle can access Jobe. So it can't be running on port 80, given that your Moodle server is running there already, preventing you from locking off access to that port.

I recommend that you instead run docker + jobeinabox. The following commands should be all it takes:

    sudo apt update
    sudo apt install docker.io
    sudo docker run -d -p 4000:80 --name jobe trampgeek/jobeinabox:latest

You should now have a Jobe running on port 4000; you can check it's there by browsing to 

    <hostname>:4000/jobe/index.php/restapi/languages

and you should see a JSON list of installed languages.

You should then immediately set up UFW to prevent access to port 4000 except from the local host.

You can now continue with your Moodle install, install CodeRunner, and set the address of your jobe server in the plugin config to just localhost:4000.

Or something like that. I leave the debugging to you :)