PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Apache, CGI funktioniert nicht



Oleg
16.11.01, 18:01
Halllo weider Mal
Ich habe apache und dazu entsprechende PHP und Perl Module installiert.
Ich will, dass CGI Scripte in jedem der Ordner laufen und nicht nur in cgi-bin, weil das einfach komfortabler ist, so wie php scripte. Nun laufen die CGI Scripte aber erstmal gar nicht, die pl bzw cgi Datei will der Server herunterladen lassen und nicht ausführen.
ich habe folgendes gemacht:

ServerName 217.68.170.211
DocumentRoot "/home/oleg/GLftp/site"
<Directory "/home/oleg/GLftp/site">

Options Indexes -FollowSymLinks +Includes MultiViews


AllowOverride None

Order allow,deny
Allow from all


#
# disable WebDAV by default for security reasons.
#
<IfModule mod_dav.c>
DAV Off
</IfModule>

<Files /home/oleg/GLftp/site/index.htm*>
Options -FollowSymLinks +Includes +MultiViews
</Files>

<Files test.php3>
Order deny,allow
deny from all
allow from localhost
</Files>

</Directory>

<IfModule mod_dir.c>
DirectoryIndex index.html index.htm
</IfModule>

ScriptAlias /cgi-bin/ "/home/oleg/GLftp/site"

ScriptAlias /perl/ "/home/oleg/GLftp/site"

ScriptAlias /cgi-perl/ "/home/oleg/GLftp/site/"

</IfModule>

<Location /cgi-bin>
AllowOverride None
Options +ExecCGI -Includes
SetHandler cgi-script
</Location>

<IfModule mod_perl.c>
Perlrequire /usr/include/apache/modules/perl/startup.perl
PerlModule Apache::Registry

<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
PerlSendHeader On
</Location>

<Location /cgi-perl>
SetHandler perl-script
PerlHandler Apache::PerlRun
Options ExecCGI
PerlSendHeader On
</Location>

</IfModule>



Ich glaube, das ist alles, was mit Perl zu tun hat
Wo liegt jetzt mein Fehler ?
Ich könnte glauben an den ScriptAlias, aber ohne Wissen, traue ich mich nicht da was zu ändern.

Hoffentlich kann einer helfen
best regards

Oleg

Oleg
17.11.01, 12:00
Hi !
Habe das Problem sebst gelöst
Folgendes kann man machen :

Apache recognizes all files in a directory named as a ScriptAlias as being eligible for execution rather than processing as normal documents. This applies regardless of the file name, so scripts in a ScriptAlias directory don't need to be named "*.cgi" or "*.pl" or whatever. In other words, all files in a ScriptAlias directory are scripts, as far as Apache is concerned.

To persuade Apache to execute scripts in other locations, such as in directories where normal documents may also live, you must tell it how to recognize them - and also that it's okay to execute them. For this, you need to use something like the AddHandler directive.

1. In an appropriate section of your server configuration files, add a line such as

AddHandler cgi-script .cgi

The server will then recognize that all files in that location (and its logical descendants) that end in ".cgi" are script files, not documents.
2. Make sure that the directory location is covered by an Options declaration that includes the ExecCGI option.

In some situations, you might not want to actually allow all files named "*.cgi" to be executable. Perhaps all you want is to enable a particular file in a normal directory to be executable. This can be alternatively accomplished via mod_rewrite and the following steps:

1. Locally add to the corresponding .htaccess file a ruleset similar to this one:

RewriteEngine on
RewriteBase /~foo/bar/
RewriteRule ^quux\.cgi$ - [T=application/x-httpd-cgi]
2. Make sure that the directory location is covered by an Options declaration that includes the ExecCGI and FollowSymLinks option.

ich habe das hier gemacht:

<Directory "/home/oleg/GLftp/site">
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
#
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options Indexes -FollowSymLinks +Includes MultiViews +ExecCGI

also hinzugefügt hab ich:
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
und
bei Options: +ExecCGI

das war alles
:D
:D :D :D
:cool: