Citat:
milanvla:
Instaliran je ActivPerl 5.6.1
Apache:
E:\Program Files\Apache Group\Apache
Perl:
E:\Program Files\Perl
Citat iz httpd.conf, apache 1.3.27 na win98 (znaci treba citati :)):
Citat:
#
# Apache parses all CGI scripts for the shebang line by default.
# This comment line, the first line of the script, consists of the symbols
# pound (#) and exclamation (!) followed by the path of the program that
# can execute this specific script. For a perl script, with perl.exe in
# the C:\Program Files\Perl directory, the shebang line should be:
#!c:/program files/perl/perl
# Note you _must_not_ indent the actual shebang line, and it must be the
# first line of the file. Of course, CGI processing must be enabled by
# the appropriate ScriptAlias or Options ExecCGI directives for the files
# or directory in question.
#
# However, Apache on Windows allows either the Unix behavior above, or can
# use the Registry to match files by extention. The command to execute
# a file of this type is retrieved from the registry by the same method as
# the Windows Explorer would use to handle double-clicking on a file.
# These script actions can be configured from the Windows Explorer View menu,
# 'Folder Options', and reviewing the 'File Types' tab. Clicking the Edit
# button allows you to modify the Actions, of which Apache 1.3 attempts to
# perform the 'Open' Action, and failing that it will try the shebang line.
# This behavior is subject to change in Apache release 2.0.
#
# Each mechanism has it's own specific security weaknesses, from the means
# to run a program you didn't intend the website owner to invoke, and the
# best method is a matter of great debate.
#
# To enable the this Windows specific behavior (and therefore -disable- the
# equivilant Unix behavior), uncomment the following directive:
#
#ScriptInterpreterSource registry
#
# The directive above can be placed in individual <Directory> blocks or the
# .htaccess file, with either the 'registry' (Windows behavior) or 'script'
# (Unix behavior) option, and will override this server default option.
#
Takodje, treba da podesis ExecCGI opciju na direktorijumu.
Kod mene je, testa radi:
Code:
ScriptAlias /cgi-bin/ "C:/Program Files/Apache/cgi-bin/"
i
<Directory "C:/Program Files/Apache/cgi-bin">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
i jos handler:
AddHandler cgi-script .cgi .pl
Sa tim podesavanjem, perl skript MORA da bude u tom direktorijumu. Test.pl mi izgleda ovako, s napomenom da mi je perl instaliran u c:/bin/perl - ti moras da pronadjes gde je kod tebe perl.exe tacno ako hoces da ga koristis ovako...
Code:
#!C:/bin/perl/bin/perl
print "Content-type: text/html\n\n";
print "caos, pa ovo radi!\n";
Ako budes koristio #ScriptInterpreterSource registry (otkomentarisi ovo u httpd.conf), onda neces morati uopste da stavljas putanju do perl.exe, ali ce ti skript raditi samo na tom racunaru.
Napomena: Vazan detalj je omogucavanje ExecCGI za direktorijum.
Kad sve ostalo zakaže, pročitaj uputstvo...