PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Apache und cgi



schmidtl_dd
10.01.06, 16:10
Hi

folgendes Problem:

Wenn ich die Seite http://192.168.115.115/cgi-bin/bugzilla/ aufrufe, erhalte ich den Fehler:

Forbidden
You don't have permission to access /cgi-bin/bugzilla/ on this server.

Ergänze ich das Händisch zu http://192.168.115.115/cgi-bin/bugzilla/index.cgi, is alles Paletti, das klappt.

Nun erinnere ich mich in der apache2.conf mal gesehen zu haben, das erlaubte Indexdateien dort angegeben sind. Also check, aber die Zeile ist schon da:

DirectoryIndex index.html index.cgi index.pl index.php index.xhtml


Hmm, und nu? was könnte noch ein Grund für den Fehler sein?

marce
10.01.06, 19:57
... im Normalfall ist cgi-bin ein Alias und die sollten separat definiert werden (z.B. über Directory)

... übrigens - Zitat von der bugzilla.org-Seite:

The default Bugzilla distribution is NOT designed to be placed in a cgi-bin directory. This includes any directory which is configured using the ScriptAlias directive of Apache.

schmidtl_dd
11.01.06, 09:49
sorry... verstehe nur Bahnhof :(

Bugzilla wurde via apt-get installiert, eine Datei in /etc/apache2/conf.d/bugzilla macht Das Verzeichnis dann zugänglich:

Alias /bugzilla /home/user/webprojekte/bugzilla

<Directory /home/user/webprojekte/bugzilla>
Options +FollowSymLinks
AllowOverride All
order allow,deny
allow from all
</Directory>

Muß ich hier was ändern?

marce
11.01.06, 10:56
... vermutlich würde ein +ExecCGI nicht schaden...

Aber warum liest Du denn nicht die Doku? Da steht eigentlich alles drin...

schmidtl_dd
11.01.06, 16:39
Naja, cgi's werden ja ausgeführt, hab deinen Vorschlag getestet, aber er hilft nich wirklich.

http://192.168.115.115/cgi-bin/bugzilla bringt ein forbidden
http://192.168.115.115/cgi-bin/bugzilla/index.cgi funktioniert...so als schnallt er nich das er nich das Verzeichnis listen soll, sondern die cgi ausführen.

Die Zeile DirectoryIndex index.html index.cgi index.pl index.php index.xhtml is ja aber da... warum zeigt der die index.cgi nich an?

schmidtl_dd
11.01.06, 18:28
Die dazugehörige Fehlermeldung aus dem Logfile ist übrigens: attempt
to invoke directory as script

marce
11.01.06, 23:10
cgi-bin wird gesondert behandelt - und über das wie gibt die httpd.conf Auskunft...

Poste die doch einfach mal komplett....

schmidtl_dd
12.01.06, 09:19
die /etc/apache2/apache2.conf:


ServerRoot "/etc/apache2"
LockFile /var/lock/apache2/accept.lock
PidFile /var/run/apache2.pid
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15

<IfModule prefork.c>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 20
MaxRequestsPerChild 0
</IfModule>

<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>

<IfModule perchild.c>
NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 0
AcceptMutex fcntl
</IfModule>

User www-data
Group www-data

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent


ErrorLog /var/log/apache2/error.log

Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf

Include /etc/apache2/httpd.conf

Include /etc/apache2/ports.conf

Include /etc/apache2/conf.d/[^.#]*

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

<IfModule mod_negotiation.c>
<IfModule mod_include.c>
Alias /error/ "/usr/share/apache2/error/"

<Directory "/usr/share/apache2/error">
AllowOverride None
Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
Order allow,deny
Allow from all
LanguagePriority en es de fr
ForceLanguagePriority Prefer Fallback
</Directory>

ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
ErrorDocument 410 /error/HTTP_GONE.html.var
ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
ErrorDocument 415 /error/HTTP_SERVICE_UNAVAILABLE.html.var
ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var

</IfModule>
</IfModule>

DirectoryIndex index.html index.cgi index.pl index.php index.xhtml

<Directory /var/www>
AuthPAM_Enabled on
AllowOverride None
AuthType Basic
AuthName "DSP Wiki"
require user bschewe msteinhardt ppaschold jlorenz mschmidt haendler
</Directory>


AccessFileName .htaccess

<Files ~ "^\.ht">
AllowOverride All
Order allow,deny
Deny from all
</Files>

UseCanonicalName Off

TypesConfig /etc/mime.types
DefaultType text/plain

HostnameLookups Off

IndexOptions FancyIndexing VersionSort

AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^


DefaultIcon /icons/unknown.gif

ReadmeName README.html
HeaderName HEADER.html

IndexIgnore .??* *~ *# HEADER* RCS CVS *,t

AddEncoding x-compress Z
AddEncoding x-gzip gz tgz

AddLanguage da .dk
.
.
AddLanguage zh-tw .tw

LanguagePriority en da nl et fr de el it ja ko no pl pt pt-br ltz ca es sv tw


AddCharset ISO-8859-1 .iso8859-1 .latin1
.
.
AddCharset shift_jis .sjis

AddType application/x-tar .tgz

#To use CGI scripts outside /cgi-bin/:
#(hab ich auch schon versucht mit reinzunehmen, brachte keinen Erfolg)
#AddHandler cgi-script .cgi

<FilesMatch "\.shtml(\..+)?$">
SetOutputFilter INCLUDES
</FilesMatch>

BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0

BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^gnome-vfs" redirect-carefully
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully

Include /etc/apache2/sites-enabled/[^.#]*


Die /etc/apache2/conf.d/bugzilla:

Alias /bugzilla /home/mschmidt/webprojekte/bugzilla
#das auskommentierte war auch schon drin...erfolglos
<Directory /home/mschmidt/webprojekte/bugzilla>
Options +FollowSymLinks
#Options +Indexes
#Options +ExecCGI
AllowOverride All
order allow,deny
allow from all
</Directory>

schmidtl_dd
12.01.06, 09:22
In /home/mschmidt/webprojekte/bugzilla liegt eine index.html, welche nach /usr/lib/cgi-bin/bugzilla/index.cgi weiterleitet.

Nach Eingabe von http://192.168.115.115/bugzilla lande ich also auf http://192.168.115.115/cgi-bin/bugzilla/index.cgi

Nehme ich das Index.cgi weg hab ich wieder Forbidden :(

marce
12.01.06, 09:22
dann füge in die etc/apache2/conf.d/bugzilla mal noch ein DirectoryIndex index.cg ein...

marce
12.01.06, 09:26
... weil auf dem cgi-bin kein Indexing eingerichtet ist.

Übrigens sind in den von dir geposteten Configfiles die nötigen Infos nicht enthalten - gibt's da sonst noch was, was evtl. interessant sein könnte?

schmidtl_dd
12.01.06, 09:31
Was sollte das sein? (ich weiß es wirklich nicht)

schmidtl_dd
12.01.06, 09:34
Leider bringt das zusätzliche DirectoryIndex nichts... würde mich auch wundern, denn es steht ja schon in der Hauptconfig. Soweit ich weiß, ergänzen die anderen diese nur (werden ja eingebunden)...

marce
12.01.06, 09:58
... Soweit ich weiß...

das mit "ext." Verzeichnissen und Alias ist so trivial nicht... -> bitte einfach mal lesen...

http://httpd.apache.org/docs/2.0/

schmidtl_dd
12.01.06, 11:04
Nach meinem dafürhalten ist die Passage eindeutig... stimmt bloß nicht :(

The DirectoryIndex directive sets the list of resources to look for, when the client requests an index of the directory by specifying a / at the end of the directory name. Local-url is the (%-encoded) URL of a document on the server relative to the requested directory; it is usually the name of a file in the directory. Several URLs may be given, in which case the server will return the first one that it finds. If none of the resources exist and the Indexes option is set, the server will generate its own listing of the directory.
Example

DirectoryIndex index.html

then a request for http://myserver/docs/ would return http://myserver/docs/index.html if it exists, or would list the directory if it did not.

Note that the documents do not need to be relative to the directory;

DirectoryIndex index.html index.txt /cgi-bin/index.pl

would cause the CGI script /cgi-bin/index.pl to be executed if neither index.html or index.txt existed in a directory.

marce
12.01.06, 11:12
... dann würde ich mal die komplette Apache-Konfig durchschauen, ob irgendwo Einstellungen gemacht werden, die dem widersprechen...

schmidtl_dd
12.01.06, 16:42
was fehlt die denn datu noch? Mehr isses doch nich, oder (als die dinge die ich gepostet hab)