jcrodriguez-dis / moodle-mod_vpl

Virtual Programming Lab for Moodle (Module)
GNU General Public License v3.0
99 stars 85 forks source link

No windows #76

Closed chetTEst closed 4 years ago

chetTEst commented 5 years ago

How to solve this problem? Antivirus is disabled https://screencast-o-matic.com/watch/cF6VQzYQIn

jcrodriguez-dis commented 5 years ago

Hello Alex, I can not reproduce your problem. I need more information:

Best regards, Juan Carlos.

rquezada-sanchez commented 5 years ago

Hi Juan Carlos, I have the same problem.

I got you installation information:

SERVER Moodle: OS version: Debian 8.0 Moodle version: 3.7
Module VPL version is 3.3.4

SERVER VPL SYSTEM EXECUTION: https://vpl.dis.ulpgc.es/releases/ => vpl-jail-system-2.3.0.3.tar.gz => OS version Ubuntu 16.04.6 LTS

CODE: (filename ejemplo.c)

include

int main() { printf ("Hola mundo.\n"); return 0; }

vpl-jail-system - config

#

vpl-jail-system config file

#

Format VAR=VALUE #no space before and after "="

JAILPATH set the jail path

JAILPATH=/jail

MIN_PRISONER_UGID set start first user id for prisoners

MIN_PRISONER_UGID=10000

MIN_PRISONER_UGID set the last user id for prisoners

MAX_PRISONER_UGID=20000

MAXTIME set the maximum time for a request in seconds

MAXTIME=1800

Maximum file size in bytes

MAXFILESIZE=64000000

Maximum memory size in bytes

MAXMEMORY=2000000

Maximum number of process

MAXPROCESSES=500

Path to control directory. the system save here information of request in progress

CONTROLPATH="/var/vpl-jail-system"

Limit the servers from we accept request

IP or net (type A, B and C) separate with espaces

Format IP: full dot notation. Example: 128.122.11.22

Format net: dot notation ending with dot. Example: 10.1.

TASK_ONLY_FROM=172.16.10.40

To serve only to one interface of your system

INTERFACE=128.1.1.1

Socket port number to listen for connections (http: and ws:)

default 80

PORT=80

Socket port number to listen for secure connections (https: and wss:)

default 443

SECURE_PORT=443

URL path for task request

act as a password, if no matches with the path of the request then it's rejected

URLPATH=/

URLPATH=http://elabs-vpl.usanpedro.edu.pe/

FIREWALL=0|1|2|3|4

0: No firewall

1: VPL service+DNS+internet access

2: VPL service+DNS+Limit internet to port 80 (super user unlimited)

3: VPL service+No external access (super user unlimited)

4: VPL service+No external access

Note: In level 4 stop vpl-jail-system service to update/upgrade the system

default level 0

FIREWALL=0

ENVPATH is enviroment PATH var set when running tasks

IMPORTANT: If you are using RedHat or derived OSes you must set this parameter to the

PATH environment variable of common users (not root) example

ENVPATH=/usr/bin:/bin

LOGLEVEL is the log level of the program

From 0 to 8. 0 minimum log to 8 maximum log and don't removes prisoners home dir.

IMPORTANT: Do not uses high loglevel in production servers, you will get pour performance

default level 0

LOGLEVEL=7

vpl-jail-system - LOG syslog

May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Client: 172.16.10.40 May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Start server version 2.3.0.3 May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Receiving until 8192 bytes May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: poll return: 1 May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Received header 282 May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: processHeaders: POST / HTTP/1.1#015#012Host: elabs-vpl.usanpedro.edu.pe#015#012Accept: /#015#012Content-type: text/xml;charset=UTF-8#015#012User-Agent: VPL #015#012X-NewRelic-ID: UgQAVVBbGwACXFJQBAA=#015#012X-NewRelic-Transaction: PxQEU15TClFUV1hVUgYFVwUAFB8EBw8RVU4aUQoABABRAQpYBgQEUFVXBkNKQQBWCQFVWlIAFTs=#015#012Content-Length: 302 May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Request line :"POST / HTTP/1.1" May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: method :"POST" May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: URL :"/" May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: version :"HTTP/1.1" May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Header :"Host: elabs-vpl.usanpedro.edu.pe" May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Header :"Accept: /" May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Header :"Content-type: text/xml;charset=UTF-8" May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Header :"User-Agent: VPL " May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Header :"X-NewRelic-ID: UgQAVVBbGwACXFJQBAA=" May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Header :"X-NewRelic-Transaction: PxQEU15TClFUV1hVUgYFVwUAFB8EBw8RVU4aUQoABABRAQpYBgQEUFVXBkNKQQBWCQFVWlIAFTs=" May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Header :"Content-Length: 302" May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: http(s) request May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Receiving until 302 bytes May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Execute request 'stop' May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Response Content-Length: 193 May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Sending 324 to fd 6 May 30 11:35:01 elabs-vpl vpl-jail-system[3985]: Send 324 May 30 11:35:01 elabs-vpl vpl-jail-system[3986]: Cleaning May 30 11:35:01 elabs-vpl vpl-jail-system[3986]: Sttoping prisoner process May 30 11:35:01 elabs-vpl vpl-jail-system[3987]: change user to 15997 May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Client: 172.16.10.40 May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Start server version 2.3.0.3 May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Receiving until 8192 bytes May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: poll return: 1 May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Received header 282 May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: processHeaders: POST / HTTP/1.1#015#012Host: elabs-vpl.usanpedro.edu.pe#015#012Accept: /#015#012Content-type: text/xml;charset=UTF-8#015#012User-Agent: VPL #015#012X-NewRelic-ID: UgQAVVBbGwACXFJQBAA=#015#012X-NewRelic-Transaction: PxQEU15TClFUV1hVUgYFVwUAFB8EBw8RVU4aUQoABABRAQpYBgQEUFVXBkNKQQBWCQFVWlIAFTs=#015#012Content-Length: 294 May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Request line :"POST / HTTP/1.1" May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: method :"POST" May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: URL :"/" May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: version :"HTTP/1.1" May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Header :"Host: elabs-vpl.usanpedro.edu.pe" May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Header :"Accept: /" May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Header :"Content-type: text/xml;charset=UTF-8" May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Header :"User-Agent: VPL " May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Header :"X-NewRelic-ID: UgQAVVBbGwACXFJQBAA=" May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Header :"X-NewRelic-Transaction: PxQEU15TClFUV1hVUgYFVwUAFB8EBw8RVU4aUQoABABRAQpYBgQEUFVXBkNKQQBWCQFVWlIAFTs=" May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Header :"Content-Length: 294" May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: http(s) request May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Receiving until 294 bytes May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Execute request 'available' May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Memory requested 536870912 May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Status: 'ready' May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Response Content-Length: 641 May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Sending 772 to fd 6 May 30 11:35:01 elabs-vpl vpl-jail-system[3988]: Send 772 May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Client: 172.16.10.40 May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Start server version 2.3.0.3 May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Receiving until 8192 bytes May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: poll return: 1 May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Received header 305 May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: processHeaders: POST / HTTP/1.1#015#012Host: elabs-vpl.usanpedro.edu.pe#015#012Accept: /#015#012Content-type: text/xml;charset=UTF-8#015#012User-Agent: VPL #015#012X-NewRelic-ID: UgQAVVBbGwACXFJQBAA=#015#012X-NewRelic-Transaction: PxQEU15TClFUV1hVUgYFVwUAFB8EBw8RVU4aUQoABABRAQpYBgQEUFVXBkNKQQBWCQFVWlIAFTs=#015#012Content-Length: 7794#015#012Expect: 100-continue May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Request line :"POST / HTTP/1.1" May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: method :"POST" May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: URL :"/" May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: version :"HTTP/1.1" May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Header :"Host: elabs-vpl.usanpedro.edu.pe" May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Header :"Accept: /" May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Header :"Content-type: text/xml;charset=UTF-8" May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Header :"User-Agent: VPL " May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Header :"X-NewRelic-ID: UgQAVVBbGwACXFJQBAA=" May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Header :"X-NewRelic-Transaction: PxQEU15TClFUV1hVUgYFVwUAFB8EBw8RVU4aUQoABABRAQpYBgQEUFVXBkNKQQBWCQFVWlIAFTs=" May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Header :"Content-Length: 7794" May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Header :"Expect: 100-continue" May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: http(s) request May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Sending 25 to fd 6 May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Send 25 May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Receiving until 7794 bytes May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: poll return: 1 May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Received 7794 May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Execute request 'request' May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Request for process May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Response Content-Length: 545 May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: parse files 14 May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Sending 676 to fd 6 May 30 11:35:01 elabs-vpl vpl-jail-system[3989]: Send 676 May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: Write file common_script.sh data size 2662 May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: Write file ejemplo.c data size 78 May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: Write file vpl_environment.sh data size 164 May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: Write file vpl_run.sh data size 695 May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: Reading parms May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: Config: maxtime: 1800 seg, maxfilesize: 65536 Kb, maxmemory 2048000 Kb, maxprocesses: 500 May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: Request: maxtime: 480 seg, maxfilesize: 65536 Kb, maxmemory 524288 Kb, maxprocesses: 100 May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: VPL_LANG es_ES.UTF-8 May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: interactive 1 May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: Compilation May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: run: maxtime: 480 seg, maxfilesize: 65536 Kb, maxmemory 524288 Kb, maxprocesses: 100 May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: child pid 3991 May 30 11:35:01 elabs-vpl vpl-jail-system[3991]: chrooted "/jail" May 30 11:35:01 elabs-vpl vpl-jail-system[3991]: setLimits: maxtime: 480 seg, maxfilesize: 65536 Kb, maxmemory 524288 Kb, maxprocesses: 100 May 30 11:35:01 elabs-vpl vpl-jail-system[3991]: change user to 12803 May 30 11:35:01 elabs-vpl vpl-jail-system[3991]: Jail::transferExecution to /home/p12803+vpl_run.sh May 30 11:35:01 elabs-vpl vpl-jail-system[3991]: Running "/home/p12803/vpl_run.sh" May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: Program end or I/O error: Success 16 (POLLHUP ). May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: New redirector state 0 => 5 May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: Complete program output: May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: Delete file vpl_run.sh May 30 11:35:01 elabs-vpl vpl-jail-system[3990]: Delete "/jail/home/p12803/vpl_run.sh" May 30 11:35:02 elabs-vpl vpl-jail-system[3986]: Remove prisoner home (15997) May 30 11:35:02 elabs-vpl vpl-jail-system[3986]: Delete "/jail/home/p15997/vpl_execution" May 30 11:35:02 elabs-vpl vpl-jail-system[3986]: Delete "/jail/home/p15997/vpl_environment.sh" May 30 11:35:02 elabs-vpl vpl-jail-system[3986]: Delete "/jail/home/p15997/ejemplo.c" May 30 11:35:02 elabs-vpl vpl-jail-system[3986]: Delete "/jail/home/p15997/common_script.sh" May 30 11:35:02 elabs-vpl vpl-jail-system[3986]: rmdir "/jail/home/p15997" May 30 11:35:02 elabs-vpl vpl-jail-system[3986]: Cleaning monitor May 30 11:35:02 elabs-vpl vpl-jail-system[3986]: Sttoping prisoner process May 30 11:35:02 elabs-vpl vpl-jail-system[4014]: change user to 15997 May 30 11:35:02 elabs-vpl vpl-jail-system[3986]: Remove prisoner home (15997) May 30 11:35:02 elabs-vpl vpl-jail-system[3986]: Delete "/var/vpl-jail-system/p15997/config" May 30 11:35:02 elabs-vpl vpl-jail-system[3986]: Delete "/var/vpl-jail-system/p15997/compilation" May 30 11:35:02 elabs-vpl vpl-jail-system[3986]: rmdir "/var/vpl-jail-system/p15997" May 30 11:35:02 elabs-vpl vpl-jail-system[3986]: Delete "/var/vpl-jail-system/15266076388635" May 30 11:35:02 elabs-vpl vpl-jail-system[3986]: Delete "/var/vpl-jail-system/130903394119004" May 30 11:35:02 elabs-vpl vpl-jail-system[3986]: Delete "/var/vpl-jail-system/26175431714569"

rquezada-sanchez commented 5 years ago

Hello Juan Carlos, I already found the problem.

The same was in the configuration of the vpl module in moodle because I had to configure to use ws without security, but my site is https because it did not start the execution window. Once the modification was made, it started to work normally.

However, doing my tests I have problems to execute html and php code at the time of writing the following code:

<doctype html>
<html>
     <head>
         <meta http-equiv = "Content-Type" content = "text / html; charset = utf-8">
         <title> PHP example </ title>
     </ head>
     <body>
           <? php
                 echo "<h1> PHP example </ h1>";
             ?>
     </ body>
</ html>

And when the compilation is done, the execution window starts with a browser in firefox but the browser does not show anything.

Why is this ?

Regards,

Atte, Ricardo E. Quezada

jcrodriguez-dis commented 5 years ago

Hello rquezada-sanchez, Sorry, the 2.3.0.3 has not been tested on Debian 8. Please try using 2.3.0.3 on Debian 9 or Ubuntu 18.04.

Best regards, Juan Carlos.