Perl script funktioniert nicht

Alles, was den Apache betrifft, kann hier besprochen werden.

Perl script funktioniert nicht

Postby NameZero912 » 21. January 2006 22:39

hallo. Ich habe mir einen Root Server geholt der Suse Linux 9.0 installiert hat. Ich steuere ihn über die Adminsoftware VISAS

Es läuft Apache 2.0.48

Das Problem das nun auftaucht, ist, dass Perl-Script nicht funktionieren wollen.

hier mal ein Beispiel, die datei foo.pl
Code: Select all
#!/usr/bin/perl

print <<EOF
Content-type: text/plain

hello world
EOF


habe für das verzeichnis eine .htaccess datei erstellt, die so aussieht:
Code: Select all
Options -ExecCGI
SetHandler none
<Files *.pl>
Options +ExecCGI
SetHandler cgi-script
</Files>


Wenn ich die Datei aufrufe, kommt dieser Fehler:
Serverfehler!

Die Anfrage kann nicht beantwortet werden, da im Server ein interner Fehler aufgetreten ist.

Fehlermeldung:
Premature end of script headers: foo.pl

Error 500


ich poste hier einfach mal den Inhalt der httpd.conf:

Code: Select all
### Global Environment ######################################################
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests.

# run under this user/group id
Include /etc/apache2/uid.conf

# - how many server processes to start (server pool regulation)
# - usage of KeepAlive
Include /etc/apache2/server-tuning.conf

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
ErrorLog /var/log/apache2/error_log

# generated from APACHE_MODULES in /etc/sysconfig/apache2
Include /etc/apache2/sysconfig.d/loadmodule.conf

# IP addresses / ports to listen on
Include /etc/apache2/listen.conf

# predefined logging formats
Include /etc/apache2/mod_log_config.conf

# generated from global settings in /etc/sysconfig/apache2
Include /etc/apache2/sysconfig.d/global.conf

# optional mod_status, mod_info
Include /etc/apache2/mod_status.conf
Include /etc/apache2/mod_info.conf

# configuration of server-generated directory listings
Include /etc/apache2/mod_autoindex-defaults.conf

# associate MIME types with filename extensions
TypesConfig /etc/apache2/mime.types
DefaultType text/plain
Include /etc/apache2/mod_mime-defaults.conf

# set up (customizable) error responses
Include /etc/apache2/errors.conf

# global (server-wide) SSL configuration, that is not specific to
# any virtual host
Include /etc/apache2/ssl-global.conf

# forbid access to the entire filesystem by default
#<Directory />
#Options None
#AllowOverride None
#Order deny,allow
#Deny from all
#</Directory>
<Directory />
Options -Indexes +FollowSymLinks +Includes
AllowOverride All
</Directory>

# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>

# List of resources to look for when the client requests a directory
DirectoryIndex index.html index.html.var

### 'Main' server configuration #############################################
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#
Include /etc/apache2/default-server.conf

<IfModule mod_suphp.c>
suPHP_Engine on
php_admin_flag engine off
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddHandler x-httpd-php .php
DirectoryIndex index.php
DirectoryIndex index.php3
DirectoryIndex index.php4
</IfModule>


# Another way to include your own files
#
# The file below is generated from /etc/sysconfig/apache2,
# include arbitrary files as named in APACHE_CONF_INCLUDE_FILES and
# APACHE_CONF_INCLUDE_DIRS
Include /etc/apache2/sysconfig.d/include.conf


### Virtual server configuration ############################################
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
Include /etc/apache2/vhosts.d/*.conf


<VirtualHost _default_:443>
DocumentRoot /usr/local/visas/public_html/
ServerName h611349.serverkompetenz.net
ServerAlias www.h611349.serverkompetenz.net
php_admin_value open_basedir /usr/local/visas/public_html/ssl/
php_admin_value engine off
IndexOptions
DirectoryIndex index.htm index.html index.shtml start.htm start.html start.shtml index.php index.php3
SSLEngine on
SSLCertificateFile /etc/apache2/ssl.crt/server.crt
SSLCertificateKeyFile /etc/apache2/ssl.key/server.key
Redirectpermanent /adminlevel https://h611349.serverkompetenz.net:22222/adminlevel
Redirectpermanent /domainadminlevel https://h611349.serverkompetenz.net:22222/domainadminlevel
Redirectpermanent /serveradminlevel https://h611349.serverkompetenz.net:22222/serveradminlevel
Redirectpermanent /mail https://h611349.serverkompetenz.net:22222/webmail
Redirectpermanent /webmail https://h611349.serverkompetenz.net:22222/webmail
Redirectpermanent /support https://h611349.serverkompetenz.net:22222/support
Redirectpermanent /mysql https://h611349.serverkompetenz.net:22222/mysql
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /usr/local/visas/public_html/
ServerName h611349.serverkompetenz.net
ServerAlias www.h611349.serverkompetenz.net
php_admin_value open_basedir /usr/local/visas/public_html/ssl/
php_admin_value engine off
SSLEngine off
IndexOptions
DirectoryIndex index.htm index.html index.shtml start.htm start.html start.shtm index.php
Redirectpermanent /adminlevel https://h611349.serverkompetenz.net:22222/adminlevel
Redirectpermanent /domainadminlevel https://h611349.serverkompetenz.net:22222/domainadminlevel
Redirectpermanent /serveradminlevel https://h611349.serverkompetenz.net:22222/serveradminlevel
Redirectpermanent /mail https://h611349.serverkompetenz.net:22222/webmail
Redirectpermanent /webmail https://h611349.serverkompetenz.net:22222/webmail
Redirectpermanent /support https://h611349.serverkompetenz.net:22222/support
Redirectpermanent /mysql https://h611349.serverkompetenz.net:22222/mysql
Redirectpermanent /ssl https://h611349.serverkompetenz.net/ssl/
</VirtualHost>

Include /usr/local/visas/etc/subdomains.conf

#VHOST planetnexuiz.de
<VirtualHost *:80>
php_admin_value open_basedir /home/p/planetnexuiz.de/public_html/:/usr/local/lib/php:/tmp
DocumentRoot /home/p/planetnexuiz.de/public_html/
ServerName www.planetnexuiz.de
IndexOptions
DirectoryIndex index.htm index.html index.shtml start.htm start.html start.shtml index.php index.php3
ServerAlias planetnexuiz.de planetnexuizde.h611349.serverkompetenz.net *.planetnexuiz.de
CustomLog "|/usr/local/visas/cronolog/cronolog --symlink=/usr/local/visas/logfiles/planetnexuiz.de/access_log --prev-symlink=/usr/local/visas/logfiles/planetnexuiz.de/current_access_log /usr/local/visas/logfiles/planetnexuiz.de/%Y/%m/%d/access_log" combined
SuexecUserGroup planetnexuizde www
ScriptAlias /cgi-bin/ /home/p/planetnexuiz.de/public_html/cgi-bin/
</VirtualHost>
#/VHOST


Die Datei befindet sich übrigens hier: http://www.planetnexuiz.de/foo.pl
NameZero912
 
Posts: 7
Joined: 21. January 2006 20:55

Postby Wiedmann » 21. January 2006 23:14

da im Server ein interner Fehler aufgetreten ist.

Un da schaust du nicht ins "error_log"?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby NameZero912 » 21. January 2006 23:52

da steht leider auch nichts weiter:
Code: Select all
[Sat Jan 21 23:49:23 2006] [error] [client 84.158.39.34] Premature end of script headers: foo.pl


achja, dies kommt anfangs beim start von apache (nachdem ich den Server neugestartet habe):
Code: Select all
[Tue Jan 24 01:40:59 2006] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Tue Jan 24 01:40:59 2006] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec2)
[Tue Jan 24 01:41:00 2006] [notice] Apache/2.0.48 (Linux/SuSE) configured -- resuming normal operations
NameZero912
 
Posts: 7
Joined: 21. January 2006 20:55

Postby deepsurfer » 22. January 2006 18:09

Code: Select all
Premature end of script headers: foo.pl

Hast du diese datei auch mit chmod 755 da liegen ??

Hast du diese Datei zufälligerweise zuhause mit einem Windows-Editor geschrieben, diese dann mittels FTPprogramm hochgejagt, dabei aber diese Datei nicht im TEXT-Modus hochgeladen sondern im BinärModus ?
chirio Deep
Wie sagte einst der MCP aus Tron auf dem Bildschirm zu schreiben Pflegte
" ... end of communication ... "
User avatar
deepsurfer
AF Moderator
 
Posts: 6440
Joined: 23. November 2004 10:44
Location: Cologne
Operating System: Win-XP / Win7 / Linux -Debian

Postby NameZero912 » 23. January 2006 15:36

habe chmod von 705 auf 755 geändert => hat nichts bewirkt

die datei habe ich über sftp hochgeladen, und sie ist im vi-editor auf dem server einwandfrei lesbar =/
NameZero912
 
Posts: 7
Joined: 21. January 2006 20:55

Postby deepsurfer » 23. January 2006 20:22

die datei habe ich über sftp hochgeladen, und sie ist im vi-editor auf dem server einwandfrei lesbar =/

Interessante Antwort, hab das mal gegengetestet....
Ich kann auch im BinärModus hochjagen und die datei im vi normal anschauen, nicht desto trotz funktioniert die datei nicht, erst nachdem ich diese richtig im TextModus hochgeladen hatte funktionierte es.
Soweit zumindest hier bei mir in der Testumgebung.
chirio Deep
Wie sagte einst der MCP aus Tron auf dem Bildschirm zu schreiben Pflegte
" ... end of communication ... "
User avatar
deepsurfer
AF Moderator
 
Posts: 6440
Joined: 23. November 2004 10:44
Location: Cologne
Operating System: Win-XP / Win7 / Linux -Debian

Postby NameZero912 » 24. January 2006 06:05

also es liegt wirklich nicht am text-modus. habe die datei nochmal über normalen FTP hochgeladen und habe gesehen dass er dabei "Type A" also ascii modus benutzt. ging trotzdem nicht, auch nicht nach veränderter chmod =/
NameZero912
 
Posts: 7
Joined: 21. January 2006 20:55


Return to Apache

Who is online

Users browsing this forum: No registered users and 19 guests