|
|
@@ -0,0 +1,68 @@
|
|
|
+Install fcgiwrap
|
|
|
+
|
|
|
+sudo pacman -S fcgiwrap
|
|
|
+
|
|
|
+sudo vi /etc/nginx/fastcgi.conf
|
|
|
+
|
|
|
+location ~ cgi$ {
|
|
|
+ gzip off;
|
|
|
+ allow all;
|
|
|
+ fastcgi_pass 127.0.0.1:9000;
|
|
|
+ include /etc/nginx/fastcgi_params;
|
|
|
+ fastcgi_param DOCUMENT_ROOT /cgi-bin;
|
|
|
+ fastcgi_param SCRIPT_NAME /cgi-bin/demo.cgi;
|
|
|
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+sudo vi /etc/nginx/nginx.conf
|
|
|
+
|
|
|
+server {
|
|
|
+ .....
|
|
|
+ .....
|
|
|
+ include fcgiwrap.conf;
|
|
|
+}
|
|
|
+
|
|
|
+Iniciar servicios
|
|
|
+
|
|
|
+sudo systemctl enable fcgiwrap
|
|
|
+
|
|
|
+sudo systemctl restart nginx
|
|
|
+
|
|
|
+install perl Modules
|
|
|
+
|
|
|
+perl -MCPAN -e shell
|
|
|
+
|
|
|
+install CGI
|
|
|
+install DBI
|
|
|
+install DBD:SQLite
|
|
|
+
|
|
|
+Testing
|
|
|
+
|
|
|
+test.cgi
|
|
|
+
|
|
|
+----------------------------------------
|
|
|
+#!/usr/bin/env perl
|
|
|
+use strict;
|
|
|
+use warnings;
|
|
|
+use CGI qw(:standard);
|
|
|
+
|
|
|
+# Imprimir todas las variables de entorno CGI
|
|
|
+print header();
|
|
|
+print start_html('Variables de Entorno');
|
|
|
+
|
|
|
+print h1('Variables de Entorno de CGI');
|
|
|
+print "<ul>\n";
|
|
|
+foreach my $key (sort keys %ENV) {
|
|
|
+ print "<li><strong>$key:</strong> $ENV{$key}</li>\n";
|
|
|
+}
|
|
|
+print "</ul>\n";
|
|
|
+
|
|
|
+print end_html();
|
|
|
+----------------------------------------
|
|
|
+
|
|
|
+open http://127.0.0.1/cgi-bin/test.cgi
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|