ciao!
volevo far eseguire uno script python usando apache.
ho abilitato il modulo:
poi ho modificato il mio file default-ssl.conf:codice:# a2enmod cgi # service apache2 restart
e riavviato il server.codice:<IfModule mod_ssl.c> <VirtualHost _default_:443> ...................... <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> # PRESENTE DI DEFAULT <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> # AGGIUNTO IO <Directory /var/www/html> Options +ExecCGI AddHandler cgi-script .py </Directory> BrowserMatch "MSIE [2-6]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 # MSIE 7 and newer should be able to use keepalive BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown </VirtualHost> </IfModule>
poi ho creato un file python:
se provo ad andare su www.sito.it/test.py, il file non lo esegue ma me lo fa scaricare.codice:#!/usr/bin/python3 import cgitb cgitb.enable() print("Content-Type: text/html;charset=utf-8") print("Hello World!")
cosa sto sbagliando secondo voi??

Rispondi quotando
