CGI/Perl wird zum Download angeboten

Apache, Lighttpd, nginx, Cherokee
Post Reply
xtomcatx
Posts: 6
Joined: 2006-03-01 13:19
 

CGI/Perl wird zum Download angeboten

Post by xtomcatx »

Hallo,
ich komme mit meinem Problem nicht weiter und finde einfach keine mögliche Ursache hierfür:
Auf einem Server läuft der Apache 2.0 und Perl 5.8
Ein Beispielscript wird immer zum Download angeboten, egal ob Endung .cgi oder .pl - Rechte sind auf 755. PHP geht problemlos

mod_cgi wird geladen, hier ist der Ausschnitt aus der httpd.conf/apache2.conf

Code: Select all

NameVirtualHost *:80
<VirtualHost *:80>
        ServerName name.de
        ServerAdmin mail@name.de
        DocumentRoot /var/www/user1/html
        LogLevel debug
        CustomLog /var/www/user1/logs/access.log combined
        ErrorLog /var/www/user1/logs/error.log
        <Directory />
                Options +ExecCGI +FollowSymLinks +Indexes
                AddHandler cgi-script .pl .cgi
        </Directory>
</VirtualHost>
Mir fällt einfach nichts mehr ein, woran das liegen könnte.
Griuß Martin
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: CGI/Perl wird zum Download angeboten

Post by Joe User »

Code: Select all

grep -i "content-type" /path/to/script.pl
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
xtomcatx
Posts: 6
Joined: 2006-03-01 13:19
 

Re: CGI/Perl wird zum Download angeboten

Post by xtomcatx »

Header gibt das Script aus und die sind auch korrekt, das Problem ist, dass das Script meines Erachtens gar nicht bis zum Interpreter kommt.

Edit: Mir ist aufgefallen, dass ich mich oben vielleicht etwas missverständlich ausgedrückt habe. Also er gibt nicht die Soll-Ausgabe zum Download, sondern das komplette Script.
User avatar
Joe User
Project Manager
Project Manager
Posts: 11191
Joined: 2003-02-27 01:00
Location: Hamburg
Contact:
 

Re: CGI/Perl wird zum Download angeboten

Post by Joe User »

Code: Select all

head -n 1 /path/to/script.pl
grep -i cgi /path/to/httpd.conf
grep -i suexec /path/to/httpd.conf
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
xtomcatx
Posts: 6
Joined: 2006-03-01 13:19
 

Re: CGI/Perl wird zum Download angeboten

Post by xtomcatx »

Der Pfad zum Perl Interpreter stimmt auch


Ich poste Dir jetzt einfach die jeweiligen Ausgaben hier rein:

Code: Select all

delta358:/etc/apache2# head -n 1 /var/www/xtomcatx/html/tellme.pl
#!/usr/bin/perl
delta358:/etc/apache2# grep -i cgi /etc/apache2/httpd.conf
DirectoryIndex index.htm index.html index.cgi index.pl index.php index.xhtml
                Options +ExecCGI +FollowSymLinks +Indexes
                AddHandler cgi-script .pl .cgi
                Options +ExecCGI +FollowSymLinks +Indexes
delta358:/etc/apache2# grep -i cgi /etc/apache2/apache2.conf
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
delta358:/etc/apache2# grep -i suexec /etc/apache2/httpd.conf
delta358:/etc/apache2# grep -i suexec /etc/apache2/apache2.conf
Suexec wird aber geladen:

Code: Select all

delta358:/etc/apache2/mods-enabled# ls -l
insgesamt 0
lrwxrwxrwx  1 root root 41 2006-03-11 12:16 auth_pam.load -> /etc/apache2/mods-available/auth_pam.load
lrwxrwxrwx  1 root root 26 2006-03-11 12:16 cgi.load -> ../mods-available/cgi.load
lrwxrwxrwx  1 root root 29 2006-03-11 12:15 dav_fs.conf -> ../mods-available/dav_fs.conf
lrwxrwxrwx  1 root root 29 2006-03-11 12:15 dav_fs.load -> ../mods-available/dav_fs.load
lrwxrwxrwx  1 root root 26 2006-03-11 12:15 dav.load -> ../mods-available/dav.load
lrwxrwxrwx  1 root root 30 2006-03-11 12:15 dav_svn.conf -> ../mods-available/dav_svn.conf
lrwxrwxrwx  1 root root 30 2006-03-11 12:15 dav_svn.load -> ../mods-available/dav_svn.load
lrwxrwxrwx  1 root root 36 2006-03-11 12:15 jk2.conf -> /etc/apache2/mods-available/jk2.conf
lrwxrwxrwx  1 root root 36 2006-03-11 12:15 jk2.load -> /etc/apache2/mods-available/jk2.load
lrwxrwxrwx  1 root root 37 2006-03-11 12:16 perl.conf -> /etc/apache2/mods-available/perl.conf
lrwxrwxrwx  1 root root 37 2006-03-11 12:16 perl.load -> /etc/apache2/mods-available/perl.load
lrwxrwxrwx  1 root root 37 2006-03-11 12:15 php4.conf -> /etc/apache2/mods-available/php4.conf
lrwxrwxrwx  1 root root 37 2006-03-11 12:15 php4.load -> /etc/apache2/mods-available/php4.load
lrwxrwxrwx  1 root root 29 2006-03-11 12:16 suexec.load -> ../mods-available/suexec.load
lrwxrwxrwx  1 root root 40 2006-03-11 12:15 userdir.conf -> /etc/apache2/mods-available/userdir.conf
lrwxrwxrwx  1 root root 40 2006-03-11 12:15 userdir.load -> /etc/apache2/mods-available/userdir.load
delta358:/etc/apache2/mods-enabled#
Hier noch die einkompilierten Module:

Code: Select all

delta358:/etc/apache2/mods-enabled# apache2 -l
Compiled in modules:
  core.c
  mod_access.c
  mod_auth.c
  mod_log_config.c
  mod_logio.c
  mod_env.c
  mod_setenvif.c
  prefork.c
  http_core.c
  mod_mime.c
  mod_status.c
  mod_autoindex.c
  mod_negotiation.c
  mod_dir.c
  mod_alias.c
  mod_so.c
delta358:/etc/apache2/mods-enabled#
xtomcatx
Posts: 6
Joined: 2006-03-01 13:19
 

Re: CGI/Perl wird zum Download angeboten

Post by xtomcatx »

Lag wohl einfach am Übertragungsmodus, hab das erstmal sein lassen und weiter eingerichtet (FTP usw) und das ganze dann nochmal per FTP übertragen (vorher SFTP) und siehe da, es geht :)

Auf die schlaue Idee, mal ein Beispielscript aufm Server zu schreiben und aufzurufen kam ich auch erst heute früh
Post Reply