Como podem scripts pergi cgi podem ser executados no Ubuntu?

0

Estou usando o servidor Apache 2 .
Alguém por favor pode me dizer onde colocar arquivos cgi em ubuntu
Por favor, explique os passos para executar os scripts cgi através do navegador?

    
por Krishna Priya 07.08.2016 / 15:54

2 respostas

0

Crie um diretório '/ var / www / http / cgi-bin'
Coloque seu script 'program_name.cgi' lá no navegador: link
Se não estiver funcionando, você deve ativar a execução de scripts cgi no arquivo de configuração do apache

    
por 02.01.2017 / 07:29
0

Isto parece funcionar no Ubuntu14:

sudo bash
cat <<'E' > /etc/apache2/conf-available/mycgis.conf
ScriptAlias /helloworld "/var/www/cgi/helloworld.pl"
E
a2enconf mycgis            #enables the new mycgis.conf file
a2enmod cgi                #enables the cgi module (unless already enabled)
service apache2 restart    #after conf change restart is needed
mkdir /var/www/cgi
cat <<'E' > /var/www/cgi/helloworld.pl     #a simple cgi script
#!/usr/bin/perl
print "Content-Type: text/html\n\nHello world!\n";
E
chmod +x /var/www/cgi/helloworld.pl        #make it executable
curl 127.0.0.1/helloworld                  #test it (or use a browser)
    
por 20.01.2017 / 11:47