2009-11-19 09:19 @429 |
|
|
 |
Sismetic
Perlero Nuevo
|
Registrado: 2009-08-26 20:01 @875 Mensajes: 9
|
|
|
Error con Apache intentando ejecutar los scripts
|
Bajé Apache y lo instalé, y lo configuré (según yo  ) Me ejecuta sin problema PHP y HTML, pero en cuanto los CGI scripts no me los ejecuta. Me muestra: Using text Syntax Highlighting Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, sismetic_@hotmail.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log. Y en el error.log: Using text Syntax Highlighting [Thu Nov 19 08:10:25 2009] [error] [client XXX] (OS 2)The system cannot find the file specified. : couldn't spawn child process: G:/Naty/Perl/monster.cgi, referer: http://localhost/ y mi httpd.conf está así: Using text Syntax Highlighting ServerRoot "G:/Naty/Apache"
DocumentRoot "G:/Naty/Perl/"
<Directory "G:/Naty/Perl/">
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "G:/Naty/Perl/"
<Directory "G:/Naty/Perl/">
AllowOverride None
Options +ExecCGI -includes
Order allow,deny
Allow from all
</Directory>
AddHandler cgi-script .cgi .pl Gracias de antemano.
_________________ La mejor religion es la verdad
| Última edición por explorer el 2009-11-19 10:54 @496, editado 2 veces en total |
| Ortografía, ofuscación del correo |
|
2009-11-19 09:45 @448 |
|
|
 |
Sismetic
Perlero Nuevo
|
Registrado: 2009-08-26 20:01 @875 Mensajes: 9
|
|
|
Re: Error Con Apache intentando ejecutar los scripts
|
Ok, gracias, voy a intentarlo. ¿Cómo me aconsejarías que lo haga? ¡Ah! y este es el código de monster.cgi: Using perl Syntax Highlighting #!C/Perl/bin/perl.exe
use warnings;
use strict;
use CGI;
use HTML::Template;
use Data::Dumper;
sub Monster_Name{
my $file = 'mon.txt';
open my $FILE , '<' , $file or die ("Could not open file $file");
my @monster_data = <$FILE>;
close $FILE;
my @monster;
for my $data(@monster_data){
chomp $data;
my ($name,$hp,$att,$m_att) = split (',',$data);
push @monster,$name;
}
shift @monster;
return @monster;
}
sub Char{
my @char = @_;
return @char;
}
sub Get_Monster{
my $self = shift;
my $attack;
my $defense;
my $hp;
if ($self eq 'Strong'){
$attack = Rand_Num(150);
$defense = Rand_Num(100);
$hp = Rand_Num(300);
}
elsif($self eq 'Dangerous'){
$attack = Rand_Num(500);
$defense = Rand_Num(200);
$hp = Rand_Num(1000);
}
else{
$attack = Rand_Num(50);
my $defense = Rand_Num(50);
my $hp = Rand_Num(100);
}
open my $FILE,'<','mon.txt' or die $!;
my @monsters = <$FILE>;
close $FILE;
my $monster_numb = @monsters;
my $m_number = Rand_Num($monster_numb);
my @monster;
for my $data( @monsters){
chomp $data;
my ($name,$hp,$att,$m_att) = split (',',$data);
push @monster,$name;
}
my $monster = $monster[$m_number];
my @char = Char('Sismetic','500','150','30');
print "$char[0] vs $monster that has " . $attack . " attack, " . $defense . " defense and " . $hp . " hp";
}
sub Rand_Num{
my $self = shift;
my $rand = int(rand($self));
return $rand;
}
Get_Monster('Dangerous');
En mi editor de Perl funciona bien. Uhm, lo cambié, ahora es: Using text Syntax Highlighting ServerRoot "G:/Naty/Apache"
DocumentRoot "G:/Naty/Apache/htdocs"
<Directory "G:/Naty/Apache/htdocs/">
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "G:/Naty/Apache/cgi-bin/"
<Directory "G:/Naty/Apache/cgi-bin/">
AllowOverride None
Options +ExecCGI -includes
Order allow,deny
Allow from all
</Directory>
AddHandler cgi-script .cgi .pl ¿En Apache/cgi-bin pondría mis scripts, y en Apache/htdocs mis documentos?
_________________ La mejor religion es la verdad
| Última edición por explorer el 2009-11-19 10:39 @485, editado 2 veces en total |
| Ortografía |
|
|
Página 1 de 1
|
[ 5 mensajes ] |
|
| Reglas del Foro |
No puedes abrir nuevos temas en este Foro No puedes responder a temas en este Foro No puedes editar tus mensajes en este Foro No puedes borrar tus mensajes en este Foro No puedes enviar adjuntos en este Foro
|
|
Socializa |
 |
|