[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PERL] Eksekvering af perl-script fra www?



"Hans E. Wennerberg" wrote:
> Min ISP anvender Linux, og jeg har lagt et simpelt perlscript
> op i /home/http/cgi-bin inder navnet 'simpel', lavet et soft link
> fra mit eget www/ bibliotek til dette cgi-bibliotek, samt lavet
> chmod 0755 på scriptet.

Du må have nogle interessante rettigheder hvis /cgi-bin er public.

Navnet skal være simpel.cgi, med den extension ved apache at
den skal køre det. Tænk hvis man med en webserver kunne køre
et program f.x. http://din.computer/sbin/mke2fs?/dev/hda1
(forudsat webroot=/)

(At man så næsten kan gøre præcist det på windows er noget helt
 andet :*)

> Hvis jeg kalder skriptet med ./simpel fra promptet på serveren
> så får jeg det rigtige resultat ud.

Godt. Det betyder også at din #!/bin/perl virker. Det kunne jo
være at ISP'en havde perl i et andet directory.
 
> Når jeg så peger min browser (IE5) hen på scriptet, så får jeg
> stort set scriptet listet op på skærmen og ikke resultatet.
> dvs set bliver ikke eksekveret.
Det er en fejl i internet exploder. Skift til Mozilla.

Nej - seriøst Apache ved ikke at den skal udføre programmet,
og sender dig derfor indholdet af filen. .cgi vil fixe det
problem.

Helt præcist er det linien:
# To use CGI scripts:
AddHandler cgi-script .cgi

i srm.conf der fortæller apache at .cgi betyder at det er et
cgi script. Og så en Options ExecCGI i access.conf der fortæller
apache hvilke directories den skal udføre cgi scripts i.

-- 
	Sometimes it's better to light a       Carsten Svaneborg
      flamethrower than curse the darkness.      sslug@sslug
	-- (Terry Pratchett, Men At Arms)    Fight Bill - use Linux


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 19:52 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *