Install, Setup and Configure CGI and Perl in Windows XP Instalación, configuración y Configurar CGI y Perl en Windows XP

Prerequisite Prerequisite

Obvioulsy, a web server needs to be running on the Windows machine. Obvioulsy, un servidor web debe estar ejecutándose en la máquina Windows. Refer to this Consulte a este post puesto for instructions on how to install Apache2 in Windows. para obtener instrucciones sobre cómo instalar Apache 2 en Windows.

Download ActivePerl Descargar ActivePerl

Download ActivePerl from Descarga de ActivePerl http://www.activestate.com/Products/ActivePerl/?mp=1 . Click on Free Download to start the download process. Haga clic en Descarga gratuita para iniciar el proceso de descarga. There is no need to input any contact info. No hay necesidad de introducir cualquier información de contacto. Just leave it blank and press ‘Next’ to start the download. Deje en blanco y pulse en "Siguiente" para iniciar la descarga.

Then download the lastest version of Windows MSI package. A continuación, descargar la última versión de Windows paquete MSI.

Install ActivePerl Instalar ActivePerl

Start the installation by double clicking the setup file. Iniciar la instalación haciendo doble clic en el archivo de instalación. Follows the on-screen instruction. Sigue las indicaciones en pantalla la instrucción. If you will be using Perl CGI programs and want to maintain some level of portability between both Linux machines and Windows machines, you may want to install Perl at the same location on your Windows machine as it is on most Linux machines. Si va a usar programas en Perl y quieren mantener un cierto nivel de portabilidad entre ambas máquinas Linux y Windows, es posible que desee instalar Perl en el mismo lugar en su máquina Windows, ya que es en la mayoría de máquinas Linux.

For example, on Linux machine, Perl is located at /usr/bin/perl and so every Perl program that I write begins with #!/usr/bin/perl . Por ejemplo, en máquina Linux, Perl se encuentra en / usr / bin / perl y para que cada programa en Perl que yo escribo comienza con #! / Usr / bin / perl. So, it’s best when install Perl on an Windows machine, instead of installing it in the default location (ie C:\perl), install it in C:\usr instead, so that the Perl executable is located at /usr/bin/perl. Por lo tanto, es mejor la hora de instalar Perl en una máquina Windows, en lugar de instalarlo en la ubicación predeterminada (es decir, C: \ perl), instalarlo en C: \ usr en lugar de ello, a fin de que los ejecutables de Perl se encuentra en / usr / bin / Perl. This allows codes written on Windows machine been moved to, without changes, to Linux machine, and have it run there, and vice versa. Esto permite que los códigos por escrito a máquina Windows se trasladó a, sin cambios, a máquina Linux, y tienen que correr allí, y viceversa.

To change the installation path, click on browse button when you’re on the installation screen that prompts you to select which features you want to install. Para cambiar la ruta de instalación, haga clic en botón de exploración cuando estés en la pantalla de instalación que le pide que seleccione las características que desea instalar. Set it to C:\usr\ if needed. Ponerlo en C: \ usr \ si es necesario.

Make sure that the following options is checked (selected): Asegúrese de que las siguientes opciones se verifica (seleccionados):
Add Perl to the PATH environment variable Perl Añadir a la variable de entorno PATH
Create Perl file extension association Crear archivo con extensión Perl Asociación

Activating CGI Activación CGI

Open the httpd.conf file for editing by selecting Start > Programs > Apache HTTP Server > Configure Apache Server > Edit the Apache httpd.conf Configuration File. Abra el archivo httpd.conf para la edición de la selección de Inicio> Programas> Apache HTTP Server> Configurar Apache Server> Editar el httpd.conf de Apache los archivos de configuración. Alternatively, open the httpd.conf with any text editor. Por otra parte, abrir el httpd.conf con cualquier editor de texto.

In the main directory section, search for Options Indexes FollowSymLinks (at about line 267), and add ExecCGI to the end so it looks like: En el directorio principal sección, búsqueda de opciones FollowSymLinks Indexes (más o menos a la línea 267), y añadir ExecCGI hasta el final por lo que tiene el siguiente aspecto:

Options Indexes FollowSymLinks ExecCGI Opciones índices FollowSymLinks ExecCGI

Search for the following line and remove the hash mark character (#) to uncomment this line. Buscar la siguiente línea y eliminar la marca de carácter hash (#) a descomentar esta línea. (You can also change .cgi to .pl, or add .pl behind .cgi if you prefer that perl extention is also treated as cgi files) For example: (También puede cambiar. Cgi. Pl, o añadir. Pl atrás. Cgi, si lo prefiere que perl extensión también es tratada como archivos CGI) Por ejemplo:

#AddHandler cgi-script .cgi # AddHandler cgi-script. Cgi

Should look like: Debería ser algo así como:

AddHandler cgi-script .cgi .pl AddHandler cgi-script. Cgi. Pl
or o
AddHandler cgi-script .pl AddHandler cgi-script. Pl
or o
AddHandler cgi-script .cgi AddHandler cgi-script. Cgi

Save the httpd.conf configuration file, restart the Apache server. Guardar el archivo de configuración httpd.conf, reinicie el servidor Apache. Test the configuration as described in Testing Your Web Server CGI Configuration at the end of this article. Pruebe la configuración tal y como se describe en el ensayo de su servidor web de configuración de CGI al final de este artículo.

Optional: Enabling CGI in Any Directory Opcional: Activación CGI en cualquier directorio

If you want to use CGI outside ScriptAliased directory (ScriptAlias is usually the Apache2/cgi-bin/), comment out the following line: Si desea utilizar CGI fuera ScriptAliased directorio (ScriptAlias suele ser el Apache2/cgi-bin /), comentar la siguiente línea:

ScriptAlias /cgi-bin/ “C:/Program Files/Apache Group/Apache2/cgi-bin/” ScriptAlias / cgi-bin / "C: / Archivos de Programa / Apache Group/Apache2/cgi-bin /"

Should look like: Debería ser algo así como:

#ScriptAlias /cgi-bin/ “C:/Program Files/Apache Group/Apache2/cgi-bin/” # ScriptAlias / cgi-bin / "C: / Archivos de Programa / Apache Group/Apache2/cgi-bin /"

Alternatively, if you want to specify just one directory to put all your cgi programs, change the path instead, but makes ure that directory exists. Alternativamente, si desea especificar un solo directorio para poner todos sus programas CGI, cambiar el camino en lugar de ello, pero hace figurar en ese directorio existe.

Should look like (for default settings): Debería ser algo así como (para configuración por defecto):

ScriptAlias /cgi-bin/ “your_prefer_cgi-bin_direcotry” ScriptAlias / cgi-bin / "your_prefer_cgi-bin_direcotry"

Save the httpd.conf file. Guardar el archivo httpd.conf. Restart the Apache server. Reinicie el servidor Apache.

Finding Perl Executable Location Encontrar ubicación ejecutable Perl

If you don’t know where is perl.exe installed to, go to Start -> Search and search for perl.exe. Si no sabe dónde está instalado a perl.exe, vaya a Inicio -> Buscar y búsqueda de perl.exe. This location is the path to the perl executable that has to be put on the top of all cgi scripts. Esta ubicación es el camino para el ejecutable de perl que se ha de poner en la parte superior de todos los scripts cgi. If you follow default installation procedure, the path should be C:/perl/bin/perl.exe Si sigue procedimiento de instalación por defecto, el camino debe ser C: / Perl / bin / perl.exe

For the path to perl.exe path, all of these format are valid: Por el camino a perl.exe camino, todas estas son válidas formato:
#!c:/perl/bin/perl.exe #! c: / perl / bin / perl.exe
#!c:/perl/bin/perl #! c: / perl / bin / perl
#!/perl/bin/perl.exe #! / perl / bin / perl.exe
#!/perl/bin/perl #! / perl / bin / perl

Testing Your Web Server CGI Configuration Prueba de su servidor web de configuración de CGI

Save the following test script in your DocumentRoot directory (if you have uncomment ScriptAlias, you can put it anywhere inside your DocumentRoot directory, or if you have set ScriptAlias to some particular directory, put the cgi in that directory only, ie Apache2/cgi-bin) as test.pl or test.cgi (depending on your configuration of the AddHandler line) and modify the first line as required to point to your ActivePerl interpreter: Guardar la prueba siguiente script en su directorio DocumentRoot (si tiene descomentar ScriptAlias, puede poner en cualquier lugar, dentro de su directorio DocumentRoot, o si se han fijado a unos ScriptAlias directorio, poner el cgi en ese directorio, es decir, Apache2/cgi- bin) o como test.pl test.cgi (dependiendo de su configuración de la línea AddHandler) y modificar la primera línea según sea necesario para que apunte a su intérprete ActivePerl:

#!c:\perl\bin\perl.exe #! c: \ perl \ bin \ perl.exe
# ^^^ this must be the first line of the script! # ^ ^ ^ Esta debe ser la primera línea del script! ^^^ ^ ^ ^
# start code # Código de inicio

use strict; use strict;
use CGI; utilizar CGI;
my $q = new CGI; my $ q = new CGI;

# print header and start the markup output # Cabecera de impresión y comenzar la producción de marcas

print $q->header( “text/html” ),$q->start_html( “hello from perl cgi!” ); print $ q-> header ( "text / html"), $ q-> start_html ( "hola de perl cgi!");
print $q->h2(”hello dave…”); print $ q-> h2 ( "hola dave…");
print $q->end_html; print $ q-> end_html;
# end code # Fin de código

Now go to Ahora vaya a http://localhost/cgi-bin/test.cgi (scripts in Apache2/cgi-bin/ are read as http://localhost/cgi-bin/ by default). (scripts en Apache2/cgi-bin / se leen como http://localhost/cgi-bin/ por defecto). You should see a page that displays a level two heading with the following text: Debería ver una página que muestra una partida de nivel dos con el siguiente texto:

hello dave Hola Dave

If you see the above message, CGI is running. Si aparece el mensaje anterior, CGI está en marcha. If you get a 500 error, go to the last entry in your Apache2/logs/error.log (or the Review Error Log in the Start menu) to see exactly what caused this error. Si obtiene un error 500, ir a la última entrada en su Apache2/logs/error.log (o el registro de errores de Revisión en el menú Inicio) para ver exactamente lo que causó este error.

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Se trata de una máquina que traduzca la página se proporciona "tal cual" sin garantía. Machine translation may be difficult to understand. La traducción automática puede resultar difícil de entender. Please refer to Por favor, consulte original English article artículo original Inglés whenever possible. siempre que sea posible.

Share and contribute or get technical support and help at Compartir y contribuir o recibir apoyo técnico y ayudar a My Digital Life Forums Mi vida digital Foros .



6 Responses to “Install, Setup and Configure CGI and Perl in Windows XP” 6 Respuestas a "Instalar, instalar y configurar CGI y Perl en Windows XP"

  1. Install AWStats- Free Logfile Analyzer for Site Statistics » My Digital Life Instalar AWStats libre de logfile analizador para las estadísticas del sitio »Mi vida digital
    January 2nd, 2006 02:19 2 de Enero de 2006 02:19
    1

    [...] As AWStats is Perl based, a Perl Interpreter need to be installed first to take anvantage of AWStats. [...] Como es AWStats en Perl, un intérprete de Perl que haga falta instalar los primeros en tomar anvantage de AWStats. For instruction on how to install Perl in Windows machine, check out this article. Para instrucciones sobre cómo instalar Perl en Windows máquina, echa un vistazo a este artículo. [...]

  2. Besart
    July 25th, 2006 20:53 25 de julio, 2006 20:53
    2

    I have installed cgi and configured apache as you said, but i got this erro: He instalado y configurado cgi apache como usted ha dicho, pero me dio este Erro:

    Internal Server Error Error interno del servidor
    The server encountered an internal error or misconfiguration and was unable to complete your request. El servidor encontró un error interno o mala y no pudo completar su solicitud.

    Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. Póngase en contacto con el administrador del servidor, webmaster @ localhost y les informará del tiempo se produjo el error, y cualquier cosa que usted podría haber hecho que puede haber provocado el error.

    More information about this error may be available in the server error log. Más información acerca de este error puede estar disponible en el registro de errores del servidor.

    ——————————————————————————– ---------------------------

    Apache/2.0.58 (Win32) PHP/5.1.4 Server at localhost Port 80 Apache/2.0.58 (Win32) PHP/5.1.4 Server en localhost Port 80

  3. jack Jack
    May 10th, 2007 19:25 10 de Mayo de 2007 19:25
    3

    Cool4you,guys. Cool4you, chicos.

  4. Mitchell
    June 20th, 2007 08:09 20 de junio de 2007 08:09
    4

    Just for the record, the above test script throws a 500 error when used as is. Sólo para que conste en acta, por encima de la secuencia de comandos de prueba arroja un error 500 cuando se utiliza tal y como está. Maybe it is just a problem with firefox displaying text or something, but the quotation marks are mixed up, so that could lead to problems Quizás es sólo un problema con firefox mostrar texto o algo, pero las comillas son mixtos, por lo que podría dar lugar a problemas :),

  5. Johanna
    October 8th, 2007 23:05 Octubre 8, 2007 23:05
    5

    Hi all, Hola a todos,

    I really need some help on this subject =) Yo realmente necesitan alguna ayuda sobre este tema =)

    I have followed the steps above, and changed the quotation marks, and what I get is 9 error messages: He seguido los pasos anteriores, y ha cambiado las comillas, y lo que me da es de 9 mensajes de error:

    Backslash found where operator expected at Z.\test.cgi line 1, near “rtf1\” La barra donde encontró operador espera en Z. \ test.cgi la línea 1, cerca de "rtf1 \"
    or …. o…. , near “ansi\” , Cerca de "ansi \"
    or …. o…. , near “deff0″ , Cerca de "deff0"
    or …. o…. , near “f1\” , Cerca de "f1 \"
    etc.. etc.

    I am a total rookie with these things, any help appreciated =) Yo soy un novato total con estas cosas, agradece cualquier ayuda =)

    Thanks, Gracias,

    Johanna

  6. Munir
    November 28th, 2007 22:14 28 de noviembre de 2007 22:14
    6

    I did everything you said. Hice todo lo que dice. But cgi is still not running. Cgi, pero todavía no está funcionando. Please help. Por favor, ayuda.
    my apache is 2.2 mi Apache es de 2,2

Leave a Reply Deja Responder

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Puede usar estos tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting Suscribirse sin comentar


Custom Search

New Articles Nuevos Artículos

Incoming Search Terms for the Article Próximos Términos de búsqueda para el artículo

download perl.exe descargar perl.exe - -- install perl on windows xp instalar Perl en Windows XP - -- Perl.exe download Perl.exe descargar - -- perl.exe perl.exe - -- apache2 enable cgi Apache2 permitir CGI - -- perl apache2 Perl apache2 - -- perl for windows XP Perl para Windows XP - -- perl vista Perl Vista - -- enable cgi apache2 permitir CGI apache2 - -- install perl on vista instalar Perl en Vista - -- how to install perl on windows XP cómo instalar perl en Windows XP - -- configure perl configurar Perl - -- perl setup download Perl configuración descargar - -- install perl xp Perl instalar XP - -- download perl for windows xp descargar Perl para Windows XP - -- PERL for windows vista PERL para Windows Vista - -- perl download for windows xp Perl descargar para Windows XP - -- XAMPP Perl CGI XAMPP Perl CGI - -- xampp path to perl XAMPP camino a Perl - -- download perl setup descarga de configuración de Perl - -- perl windows vista Perl Windows Vista - -- install perl vista Vista instalar Perl - -- xampp perl path XAMPP Perl camino - -- free download perl.exe descarga gratuita perl.exe - -- perl download xp Perl descargar XP - -- apache2 perl Apache2 Perl - -- apache2 cgi enable Apache2 permitir CGI - -- configure cgi configurar CGI - -- how to configure perl cómo configurar Perl - -- free download perl interpreter descarga gratuita intérprete Perl - -- INSTALL PERL FOR WINDOWS XP Perl para instalar Windows XP - -- apache2 configure cgi Apache2 configurar CGI - -- Perl interpreter for windows XP Intérprete de Perl para Windows XP - -- all todo - -- how to install perl on vista cómo instalar perl en vista - -- perl interpreter free download Perl intérprete descarga gratuita - -- perl for xp Perl para XP - -- install perl windows xp Perl instalar Windows XP - -- perl interpreter vista Vista intérprete Perl - -- windows xp cgi CGI de Windows XP - -- how to install perl in windows xp cómo instalar perl en Windows XP - -- perl download for xp Perl Descarga XP - -- apache perl configuration Perl configuración de Apache - -- perl.exe free download perl.exe descarga gratuita - -- install perl on xp instalar Perl en XP - -- how to configure cgi cómo configurar CGI - -- perl exe download Perl exe descargar - -- perl setup Perl configuración - -- enable cgi in apache2 permitir CGI en apache2 - -- apache2 allow cgi Apache2 permitir CGI - -- Free Download Perl for Windows XP Descarga gratuita de Perl para Windows XP - -- perl interpreter for vista Perl intérprete de Vista - -- perl for windows XP download Perl para Windows XP descarga - -- apache2 perl setup Apache2 Perl configuración - -- apache2 configure perl Apache2 configurar Perl - -- how to install perl on windows vista cómo instalar perl en Windows Vista - -- Perl Windows XP Perl Windows XP - -- perl setup for windows Perl configuración para Windows - -- perl windows configuration Perl configuración de Windows - -- download perl exe exe descargar Perl - -- download perl Windows XP Perl descargar Windows XP - -- configure perl apache2 Perl configurar apache2 - -- enable cgi on apache permitir CGI en Apache - -- xampp perl configure XAMPP Perl configurar - -- free perl download for Windows XP perl descarga gratuita para Windows XP - -- "perl for vista" "Perl para Vista" - -- how to install perl on xp cómo instalar perl en xp - -- perl windows install Perl instalar Windows - -- How to Configure Perl in Windows Cómo Configurar Perl en Windows - -- xampp enable cgi XAMPP permitir CGI - -- apache2 cgi configuration Apache2 CGI configuración - -- perl download windows xp Perl descargar Windows XP - -- perl configure Perl configurar - -- perl interpreter windows vista Perl intérprete de Windows Vista - -- configure cgi apache2 CGI configurar apache2 - --