Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CGI Problem - Script funzt per Web nicht

Empfohlene Antworten

Veröffentlicht

Hallo.

Ich hab ein kleines / großes Problem und zwar habe ich ein cgi script geschrieben. wenn ich es von der kommandzeile auf ausrufe funktioniert es doch sobald ich es über den browser aufrufe bekomme ich einen server internal error.

Hier einmal mein script , ist noch nicht viel drin denn bevor ich die funktion mache müsste ich mal das ergebniss sehen:

 

#!/usr/bin/perl


################################################################################

# $Source:

# $Author: givn

# $Date: 2004/07/20

# $Revision: 1.0

# $State: Development

################################################################################

# CGI SCRIPT:

# Script checks some services and allows to restart / stop / start it

################################################################################



#*******************************************************************************

# Functions for own define

#*******************************************************************************


sub PrintHeader

{

  print "<html>";

  print "<head>";

  print "<title>Tivoli Check </title>";

  print "<link REL=STYLESHEET TYPE=\"text/css\" HREF=\"./stylesheet.css\">";

  print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";

  print "<style TYPE=\"text/css\">";

  print "A { text-decoration: none; }";

  print "A:hover { text-decoration: underline; }";

  print "BODY,TD { font-family: arial,helvetica,sans-serif; font-size: 10pt; background-color:#FFFFFF}";

  print "TH { font-family: arial,helvetica,sans-serif; font-size: 11pt; text-align: center; font-weight: bold;background-color:#C1C1C1}";

  print "//--></STYLE>";

  print "</head>";


  print "<body>";

  print "<table WIDTH=\"100%\">";

  print "<tr>";

  print "<td>";

  print "<h1>Tivoli Check </h1></td>";


  print "<td ALIGN=RIGHT VALIGN=TOP>";

  print "<img SRC=\"./logo.gif\" TITLE=\"Logo\" NOSAVE height=41 width=114 align=ABSCENTER>";

  print "</td>";

  print "</tr>";

  print "</table>";

  exit (0);

}


sub PrintFooter

{

  print "</body>";

  print "</html>";

  exit (0);


}


#******************************************************************************


&PrintHeader ();

&PrintFooter ();

Perl liegt in dem Verzeichniss, indem ich es auch angegeben habe. Die Berechtigung auf der Datei sind: -rwxrwxrwx 1 root system 1846 Jul 20 09:48 check.cgi Alle anderen cgis in dem cgi-bin ordner funktionieren nur das nicht... folgendes gibt der error log vom Webserver aus (IBM HTTP Webserver)

[Tue Jul 20 09:52:06 2004] [error] [client 172.31.24.41] Premature end of script headers: /usr/HTTPServer/cgi-bin/check.cgi 

 

Ist total komisch und ich habe keine Ahnung mehr woran es liegen könnte!

Gib doch mal vorher den Content-Type aus:

print "Content-type: text/html\n\n";

Hört sich nämlich danach an, daß ein HTTP-Header erwartet, aber nicht geliefert wird.

Gib doch mal vorher den Content-Type aus:
print "Content-type: text/html\n\n";

Hört sich nämlich danach an, daß ein HTTP-Header erwartet, aber nicht geliefert wird.

an welcher stelle soll ich das coding einfügen?

Gib doch mal vorher den Content-Type aus:
print "Content-type: text/html\n\n";
Hört sich nämlich danach an, daß ein HTTP-Header erwartet, aber nicht geliefert wird.
Fast.
print "Content-type: text/html\r\n\r\n";

Vielen Dank!

Funktioniert :-)

Fast.

print "Content-type: text/html\r\n\r\n";

Ups Sorry! Total vergessen :)

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.