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 .
Related Articles Artículos relacionados
- Install AWStats- Free Logfile Analyzer for Site Statistics Instalar AWStats libre de logfile analizador para las estadísticas del sitio
- Easily Set Up Web Server with XAMPP Fácil de configurar tu servidor con XAMPP
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4 Instalar Web Server en Windows XP con Apache 2, PHP5 y MySQL4 - Parte 4
- CPAN Missing Parameter auto_commit Message Falta el parámetro CPAN auto_commit mensaje
- Internal Error 2739 Error in Vista (32 or 64-bit) When Install Adobe Photoshop CS3 and Reflector Related Programs Error interno 2739 Error en Vista (32 o 64 bits) Al instalar Adobe Photoshop CS3 y Reflector Programas Relacionados
- Enable and Display Security Tab in Windows XP Home Edition Activar y mostrar pestaña seguridad en Windows XP Home Edition
- eMule 0.48a for Windows Vista Free Download eMule 0.48a para Windows Vista Descarga gratuita
- Hack and Workaround to Clean or Fresh Install Windows Vista with Upgrade License DVD Hack y solución para limpiar o fresca instalar Windows Vista con licencia de actualización de DVD
- Trick to Install Windows XP SP3 RC in Non-English Language Editions El truco para instalar Windows XP SP3 no en RC-Inglés ediciones en lenguas
- Download Yahoo! Descargar Yahoo! Messenger with Voice 8 Full Standalone Installer Messenger con Voz 8 plena Standalone Installer















January 2nd, 2006 02:19 2 de Enero de 2006 02:19
[...] 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. [...]
July 25th, 2006 20:53 25 de julio, 2006 20:53
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
May 10th, 2007 19:25 10 de Mayo de 2007 19:25
Cool4you,guys. Cool4you, chicos.
June 20th, 2007 08:09 20 de junio de 2007 08:09
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
October 8th, 2007 23:05 Octubre 8, 2007 23:05
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
November 28th, 2007 22:14 28 de noviembre de 2007 22:14
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