Schrift
[thread]10657[/thread]

HTML Seite mit Links mittels Perl-Module erstellen (Seite 2)

Leser: 6


<< |< 1 2 3 4 5 6 >| >> 54 Einträge, 6 Seiten
GwenDragon
 2007-10-26 00:14
#101358 #101358
User since
2005-01-17
14533 Artikel
Admin1
[Homepage]
user image
Hast du den Apache so eingercihtet, dass er auch User-Verzeichnisse verwendet?

http://httpd.apache.org/docs/2.2/howto/public_html...
http://httpd.apache.org/docs/2.2/mod/mod_userdir.h...
die Drachin, Gwendolyn


Unterschiedliche Perl-Versionen auf Windows (fast wie perlbrew) • Meine Perl-Artikel

rooky
 2007-10-26 01:40
#101360 #101360
User since
2007-10-25
38 Artikel
BenutzerIn
[default_avatar]
Hallo Gwen ich habe bei apache die Veränderungen vorgenomme klappt aber trozdem nicht. Es passiert das gleiche wie vorhin, firefox versuch das Skript herunterzuladen anstatt es auszuführen. Ich werde verrückt, ich sehe nicht wo das Problem noch liegen konte das Skript laüft wunderbar in der Kommandozeile.

Vielleicht hast noch eine Idee

Danke
rooky
 2007-10-26 05:30
#101361 #101361
User since
2007-10-25
38 Artikel
BenutzerIn
[default_avatar]
Hallo bei Apache habe ich als default Einstellung für cgi-Skripte

Code: (dl )
 ScriptAlias /cgi-bin/ /usr/www/cgi-bin/skript.pl


so wie es eigentlich sein musste damit apache alles was im
Code: (dl )
http://localhost/cgi-bin/
als cgi-Program erkennt und es ausführt.

Meine skripte sind alle ausführbar und ich habe alle Benutzer volle Rechte gegeben
Code: (dl )
chmod 777 skript.pl


Also wenn ich das Skript im Browser mit

Code: (dl )
http://localhost/cgi-bin/skript.pl


kriege ich das Skript nicht ausgeführt sondern zum downloaden bereit. Dann habe ich das Skript mit dem Editor kate geöffnet und habe ich folgendes bekommen. Es ist lang aber ich denke damit wird es leichter das Problem zu lösen
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
<head>
<title>Serverfehler!</title>
<link rev="made" href="mailto:%5bno%20address%20given%5d" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
body { color: #000000; background-color: #FFFFFF; }
a:link { color: #0000CC; }
p, address {margin-left: 3em;}
span {font-size: smaller;}
/*]]>*/--></style>
</head>

<body>
<h1>Serverfehler!</h1>
<p>




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

</p>
<p>


Fehlermeldung:
<br />Premature end of script headers: arbeit2.pl



</p>
<p>
Sofern Sie dies f&uuml;r eine Fehlfunktion des Servers halten,
informieren Sie bitte den
<a href="mailto:%5bno%20address%20given%5d">Webmaster</a>
hier&uuml;ber.

</p>

<h2>Error 500</h2>
<address>
<a href="/">localhost</a><br />

<span>Fri Oct 26 03:13:23 2007<br />
Apache/2.2.3 (Linux/SUSE)</span>
</address>
</body>
</html>


Danke für die bisherige Hilfe und ich hoffe ihr könnt mit dieser Meldung etwas anfangen

----
Modedit Gwendragon:
Code-Tags repariert
----
nepos
 2007-10-26 10:38
#101367 #101367
User since
2005-08-17
1420 Artikel
BenutzerIn
[Homepage] [default_avatar]
Viel wichtiger als dieses komische ScriptAlias (das irgendwie falsch aussieht in meinen Augen) ist eigentlich, dass dein cgi-bin-Ordner die Option ExecCGI gesetzt hat:
Code: (dl )
1
2
3
4
5
6
7
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

So sieht das bei einem Debian Apache2 im Default aus.
GwenDragon
 2007-10-26 13:43
#101385 #101385
User since
2005-01-17
14533 Artikel
Admin1
[Homepage]
user image
rooky+2007-10-26 03:30:17--
Hallo bei Apache habe ich als default Einstellung für cgi-Skripte

Code: (dl )
 ScriptAlias /cgi-bin/ /usr/www/cgi-bin/skript.pl


so wie es eigentlich sein musste damit apache alles was im
Code: (dl )
http://localhost/cgi-bin/
als cgi-Program erkennt und es ausführt.
Falsch! So gehört es:
Code: (dl )
 ScriptAlias /cgi-bin/ /usr/www/cgi-bin/


Quote
Meine skripte sind alle ausführbar und ich habe alle Benutzer volle Rechte gegeben
Code: (dl )
chmod 777 skript.pl
chmod 0755 reicht auch ;)

Quote
Es ist lang aber ich denke damit wird es leichter das Problem zu lösen


Fehlermeldung:
<br />Premature end of script headers: arbeit2.pl

Danke für die bisherige Hilfe und ich hoffe ihr könnt mit dieser Meldung etwas anfangen

Wieso wird denn da arbeit2.pl aufgerufen?

Es wäre vielleicht sinnvoller, hier deine Apache-Konfigurationsdatei zu posten.
die Drachin, Gwendolyn


Unterschiedliche Perl-Versionen auf Windows (fast wie perlbrew) • Meine Perl-Artikel

nepos
 2007-10-26 14:47
#101390 #101390
User since
2005-08-17
1420 Artikel
BenutzerIn
[Homepage] [default_avatar]
Und die betreffenden Zeilen aus dem error.log, falls da was auffälliges ist.
rooky
 2007-10-26 22:42
#101431 #101431
User since
2007-10-25
38 Artikel
BenutzerIn
[default_avatar]
Hallo zusammen and danke bis jetzt für die tolle Unterstützung, cih musste mich mein Brot verdienen jetzt bin ich wieder da.

Hier einige Auszüge aus /var/log/apache2/error_log

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
[Fri Oct 26 01:10:57 2007] [error] [client 127.0.0.1] (13)Permission denied: exec of '/srv/www/cgi-bin/arbeit2.pl' failed, referer: http://localhost/~james/
[Fri Oct 26 01:10:57 2007] [error] [client 127.0.0.1] Premature end of script headers: arbeit2.pl, referer: http://localhost/~james/
[Fri Oct 26 01:24:06 2007] [error] [client 127.0.0.1] (13)Permission denied: exec of '/srv/www/cgi-bin/arbeit2.pl' failed, referer: http://localhost/~james/
[Fri Oct 26 01:24:06 2007] [error] [client 127.0.0.1] Premature end of script headers: arbeit2.pl, referer: http://localhost/~james/
[Fri Oct 26 01:46:14 2007] [notice] caught SIGTERM, shutting down
[Fri Oct 26 01:46:15 2007] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Fri Oct 26 01:46:16 2007] [notice] Apache/2.2.3 (Linux/SUSE) configured -- resuming normal operations
[Fri Oct 26 01:47:05 2007] [error] [client 127.0.0.1] client denied by server configuration: /srv/www/cgi-bin/arbeit2.pl
[Fri Oct 26 01:56:38 2007] [error] [client 127.0.0.1] client denied by server configuration: /srv/www/cgi-bin/arbeit2.pl
/home/james/public_html/arbeit2.pl
[Fri Oct 26 11:07:44 2007] [error] [client 127.0.0.1] (8)Exec format error: exec of '/home/james/public_html/cgi-bin/arbeit2.pl' failed
[Fri Oct 26 11:46:56 2007] [error] [client 127.0.0.1] client denied by server configuration: /srv/www/cgi-bin/arbeit2.pl


und die Datei /etc/apache2/default-server.conf

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#
# Global configuration that will be applicable for all virtual hosts, unless
# deleted here, or overriden elswhere.
#

DocumentRoot "/srv/www/htdocs"

#
# Configure the DocumentRoot
#
<Directory "/srv/www/htdocs">
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs-2.2/mod/core.html#options
# for more information.
Options None
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
AllowOverride None
# Controls who can get stuff from this server.
Order allow,deny
Allow from all
</Directory>

# Aliases: aliases can be added as needed (with no limit). The format is
# Alias fakename realname
#
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL. So "/icons" isn't aliased in this
# example, only "/icons/". If the fakename is slash-terminated, then the
# realname must also be slash terminated, and if the fakename omits the
# trailing slash, the realname must also omit it.
#
# We include the /icons/ alias for FancyIndexed directory listings. If you
# do not use FancyIndexing, you may comment this out.
#
Alias /icons/ "/usr/share/apache2/icons/"

<Directory "/usr/share/apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"

# "/srv/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory /home/*/public_html/cgi-bin>
Options ExecCGI
SetHandler cgi-script
</Directory>

# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
# To disable it, simply remove userdir from the list of modules in APACHE_MODULES
# in /etc/sysconfig/apache2.
#
<IfModule mod_userdir.c>
# Note that the name of the user directory ("public_html") cannot simply be
# changed here, since it is a compile time setting. The apache package
# would have to be rebuilt. You could work around by deleting
# /usr/sbin/suexec, but then all scripts from the directories would be
# executed with the UID of the webserver.
UserDir public_html
# The actual configuration of the directory is in
# /etc/apache2/mod_userdir.conf.
Include /etc/apache2/mod_userdir.conf
# You can, however, change the ~ if you find it awkward, by mapping e.g.
# http://www.example.com/users/karl-heinz/ --> /home/karl-heinz/public_html/
#AliasMatch ^/users/([a-zA-Z0-9-_.]*)/?(.*) /home/$1/public_html/$2
</IfModule>


# Include all *.conf files from /etc/apache2/conf.d/.
#
# This is mostly meant as a place for other RPM packages to drop in their
# configuration snippet.
#
# You can comment this out here if you want those bits include only in a
# certain virtual host, but not here.
#
Include /etc/apache2/conf.d/*.conf

# The manual... if it is installed ('?' means it won't complain)
Include /etc/apache2/conf.d/apache2-manual?conf


ich habe aber etwas interresantes gefunden und zwar wenn ich im Konsole
user@host~> ./skript.pl > Datei eingebe bekomme ich




Code: (dl )
1
2
Content-Type: text/html; charset=ISO-8859-1   
blatt10.pdf

wobei wie erwüscht die gefundene Dateiblatt10.pdf als links zu finden ist. Vielleicht wisst ihr jetzt mehr mit den jetztigen Informationen.

Danke nochmal
Linuxer
 2007-10-26 22:50
#101432 #101432
User since
2006-01-27
3870 Artikel
HausmeisterIn

user image
rooky+2007-10-26 20:42:40--
Hallo zusammen and danke bis jetzt für die tolle Unterstützung, cih musste mich mein Brot verdienen jetzt bin ich wieder da.

Hier einige Auszüge aus /var/log/apache2/error_log

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
[Fri Oct 26 01:10:57 2007] [error] [client 127.0.0.1] (13)Permission denied: exec of '/srv/www/cgi-bin/arbeit2.pl' failed, referer: http://localhost/~james/
[Fri Oct 26 01:10:57 2007] [error] [client 127.0.0.1] Premature end of script headers: arbeit2.pl, referer: http://localhost/~james/
[Fri Oct 26 01:24:06 2007] [error] [client 127.0.0.1] (13)Permission denied: exec of '/srv/www/cgi-bin/arbeit2.pl' failed, referer: http://localhost/~james/
[Fri Oct 26 01:24:06 2007] [error] [client 127.0.0.1] Premature end of script headers: arbeit2.pl, referer: http://localhost/~james/
[Fri Oct 26 01:46:14 2007] [notice] caught SIGTERM, shutting down
[Fri Oct 26 01:46:15 2007] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Fri Oct 26 01:46:16 2007] [notice] Apache/2.2.3 (Linux/SUSE) configured -- resuming normal operations
[Fri Oct 26 01:47:05 2007] [error] [client 127.0.0.1] client denied by server configuration: /srv/www/cgi-bin/arbeit2.pl
[Fri Oct 26 01:56:38 2007] [error] [client 127.0.0.1] client denied by server configuration: /srv/www/cgi-bin/arbeit2.pl
/home/james/public_html/arbeit2.pl
[Fri Oct 26 11:07:44 2007] [error] [client 127.0.0.1] (8)Exec format error: exec of '/home/james/public_html/cgi-bin/arbeit2.pl' failed
[Fri Oct 26 11:46:56 2007] [error] [client 127.0.0.1] client denied by server configuration: /srv/www/cgi-bin/arbeit2.pl


und die Datei /etc/apache2/default-server.conf

...

ich habe aber etwas interresantes gefunden und zwar wenn ich im Konsole
user@host~> ./skript.pl > Datei eingebe bekomme ich


Stehst Du denn bei dem Test in Deinem Homeverzeichnis (was die ~ impliziert) oder im /srv/www/cgi-bin/ ? Oder ist /srv/www/cgi-bin/ Dein Homeverzeichnis?

Ist skript.pl gleich arbeit2.pl?

Stimmen die Rechte an arbeit2.pl? Der Webserver muss es ausführen können.
Stimmen die Rechte am cgi-bin Verzeichnis? Der Webserver muss es lesen können, wahrscheinlich auch reinwechseln.


Die Meldungen von wegen "Client denied by Server Configuration" deuten auf ein Problem in der Zugriffskontrolle des Webservers hin? Hast Du evtl. irgendwo eine Einschränkung auf IP-Adressen vorgenommen, o.ä.?
meine Beiträge: I.d.R. alle Angaben ohne Gewähr und auf Linux abgestimmt!
Die Sprache heisst Perl, nicht PERL. - Bitte Crossposts als solche kenntlich machen!
rooky
 2007-10-26 22:56
#101433 #101433
User since
2007-10-25
38 Artikel
BenutzerIn
[default_avatar]
Hallo linuxer und danke für die schnelle Antwort. Ich hatte schon mit
chmod ug+rwx,o+rx
dafür gesorgt dass alle skripte ausführbar sind. Funktioniert aber trotzdem nicht
Linuxer
 2007-10-26 23:00
#101434 #101434
User since
2006-01-27
3870 Artikel
HausmeisterIn

user image
gut...
hatte gehofft, meinen beitrag nochmal zu überarbeiten, bevor Du reagierst ;o))
meine Beiträge: I.d.R. alle Angaben ohne Gewähr und auf Linux abgestimmt!
Die Sprache heisst Perl, nicht PERL. - Bitte Crossposts als solche kenntlich machen!
<< |< 1 2 3 4 5 6 >| >> 54 Einträge, 6 Seiten



View all threads created 2007-10-25 01:56.