Page 1 of 1

Premature end of script headers:

Posted: 2004-07-23 08:40
by moppi
Hallo,

ich habe bei meinem Apache 2.0.50 das mod_suexec aktiviert und jetzt wird der suexec wrapper auch benutzt, das ist bei gentoo nicht Standard anscheinend.
Das Problem ist das ich jetzt keine cgi's ausführen kann es erscheint im Log:

Code: Select all

[Fri Jul 23 06:20:29 2004] [error] [client 80.142.78.162] Premature end of script headers: test-cgi
Die Berechtigungen passen jedoch soweit. Kann mir jemand einen Tip geben?

Re: Premature end of script headers:

Posted: 2004-07-23 08:43
by duergner
Wie immer: Logs und Config

Re: Premature end of script headers:

Posted: 2004-07-23 08:45
by moppi
Confixx vHost:

Code: Select all

<Directory "/var/www/localhost/htdocs/web1/html">
  Options -FollowSymLinks -SymLinksIfOwnerMatch
  <IfModule mod_access.c>
    Allow from all
  </IfModule>
</Directory>

<Directory "/var/www/localhost/htdocs/web2/html">
  Options -FollowSymLinks -SymLinksIfOwnerMatch
  DirectoryIndex index.html index.htm index.php index.php3 index.php4
  <IfModule mod_access.c>
    Allow from all
  </IfModule>
  <Files ~ ".shtml$">
    deny from all
  </Files>
  <Files ~ ".(wml.*|wbmp)$">
    deny from all
  </Files>
</Directory>
<VirtualHost 82.165.43.99:80>
  ServerName rindt.name
  ServerAlias www.rindt.name web1.confixxlogin.de

  DocumentRoot /var/www/localhost/htdocs/web1/html
  SuexecUserGroup web1 ftponly
  ScriptAlias /cgi-bin/ /var/www/localhost/htdocs/web1/html/cgi-bin/
  php_admin_value open_basedir /var/www/localhost/htdocs/web1/
  php_admin_value file_uploads 1
  php_admin_value upload_tmp_dir /var/www/localhost/htdocs/web1/phptmp/
</VirtualHost>

Code: Select all

rubidium cgi-bin # ls -l /var/www/localhost/htdocs/web1/html/cgi-bin/
total 8
-rwxrwxrwx  1 web1 ftponly 268 Jul 22 09:57 printenv
-rwxrwxrwx  1 web1 ftponly 757 Jul 22 09:57 test-cgi

Re: Premature end of script headers:

Posted: 2004-07-23 09:16
by duergner
Da steht doch gar kein User in dem VirtualHost drinnen. Poste mal die suexec.log.

[EDIT]
Ups sorry das hab ich überlesen. Aber die suexec.log wär trotz allem gut.

Re: Premature end of script headers:

Posted: 2004-07-23 09:17
by tix.64
Moppi wrote:

Code: Select all

rubidium cgi-bin # ls -l /var/www/localhost/htdocs/web1/html/cgi-bin/
total 8
-rwxrwxrwx  1 web1 ftponly 268 Jul 22 09:57 printenv
-rwxrwxrwx  1 web1 ftponly 757 Jul 22 09:57 test-cgi
und jetzt liest du dir erstmal http://httpd.apache.org/docs/suexec.html durch, okay :?

Re: Premature end of script headers:

Posted: 2004-07-23 09:17
by moppi

Code: Select all

[2004-07-23 09:15:28]: uid: (647/web1) gid: (501/501) cmd: test-cgi
[2004-07-23 09:15:28]: cannot run as forbidden uid (647/test-cgi)

Code: Select all

rubidium apache2 # suexec2 -V
 -D AP_DOC_ROOT="/var/www"
 -D AP_GID_MIN=100
 -D AP_HTTPD_USER="apache"
 -D AP_LOG_EXEC="/var/log/apache2/suexec_log"
 -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
 -D AP_SUEXEC_UMASK=077
 -D AP_UID_MIN=1000
 -D AP_USERDIR_SUFFIX="public_html"

Re: Premature end of script headers:

Posted: 2004-07-23 09:18
by duergner
tix.64 wrote:
Moppi wrote:

Code: Select all

rubidium cgi-bin # ls -l /var/www/localhost/htdocs/web1/html/cgi-bin/
total 8
-rwxrwxrwx  1 web1 ftponly 268 Jul 22 09:57 printenv
-rwxrwxrwx  1 web1 ftponly 757 Jul 22 09:57 test-cgi
und jetzt liest du dir erstmal http://httpd.apache.org/docs/suexec.html durch, okay :?
Oh die Rechte hab ich gar nicht gesehen. :?

Re: Premature end of script headers:

Posted: 2004-07-23 09:19
by moppi
wie oft soll ich das noch lesen?

Ich wüsste nicht wo das problem liegt

Re: Premature end of script headers:

Posted: 2004-07-23 09:20
by duergner
Moppi wrote:

Code: Select all

[2004-07-23 09:15:28]: uid: (647/web1) gid: (501/501) cmd: test-cgi
[2004-07-23 09:15:28]: cannot run as forbidden uid (647/test-cgi)

Code: Select all

rubidium apache2 # suexec2 -V
 -D AP_DOC_ROOT="/var/www"
 -D AP_GID_MIN=100
 -D AP_HTTPD_USER="apache"
 -D AP_LOG_EXEC="/var/log/apache2/suexec_log"
 -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
 -D AP_SUEXEC_UMASK=077
 -D AP_UID_MIN=1000
 -D AP_USERDIR_SUFFIX="public_html"
Da stehts doch:

Deine UID ist 647 und du erlaubst in der suEXEC nur UID > 1000

Re: Premature end of script headers:

Posted: 2004-07-23 09:22
by tix.64
Moppi wrote:wie oft soll ich das noch lesen?

Ich wüsste nicht wo das problem liegt
Erstmal bei den Rechten:
16. Is the target program NOT writable by anyone else?

We don't want to give anyone other than the owner the ability to change the program.

Re: Premature end of script headers:

Posted: 2004-07-23 10:09
by moppi
manchmal sieht man den wald vor lauter bäumen nicht - vielen dank

aber ohne suexec neu zu compilieren bekomme ich die parameter nicht umgebogen oder?

Re: Premature end of script headers:

Posted: 2004-07-23 10:48
by duergner
Nein.

Re: Premature end of script headers:

Posted: 2004-07-23 11:46
by moppi
Wie bitte geht es dann in der Doc steht compilieren.

Re: Premature end of script headers:

Posted: 2004-07-23 11:50
by duergner
Ja das geht ja. Das nein bezog sich auf der ohne gehts nicht. Und das ist korrekt so.

Re: Premature end of script headers:

Posted: 2004-07-23 11:58
by moppi
Das Problem ist das confixx ja die user anlegt. ich bin mir jetzt nicht sicher ich habe jetzt das suexec header file umgebürtelt und und würde da jetzt ne neue MIN_GID vereinbaren. aber welche?

EDIT: ich habe jetzt suexec mit hand erneut compiliert und min UID GID auf 100 gesetzt aber der fehler bleibt.

Code: Select all

 -D AP_DOC_ROOT="/var/www"
 -D AP_GID_MIN=100
 -D AP_HTTPD_USER="apache"
 -D AP_LOG_EXEC="/var/log/apache2/suexec_log"
 -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
 -D AP_SUEXEC_UMASK=077
 -D AP_UID_MIN=100
 -D AP_USERDIR_SUFFIX="public_html"
Nachtrag aus dem suexec_log

Code: Select all

[2004-07-23 12:27:12]: uid: (647/web1) gid: (501/501) cmd: test-cgi
[2004-07-23 12:27:12]: file is writable by others: (/var/www/localhost/htdocs/web1/html/cgi-bin/test-cgi)
EDIT: ich habe jetzt andere einstellungen probiert ohne UMASK und es will einfach nicht

Re: Premature end of script headers:

Posted: 2004-07-23 12:38
by duergner
[quote="Moppi"Nachtrag aus dem suexec_log

Code: Select all

[2004-07-23 12:27:12]: uid: (647/web1) gid: (501/501) cmd: test-cgi
[2004-07-23 12:27:12]: file is writable by others: (/var/www/localhost/htdocs/web1/html/cgi-bin/test-cgi)
[/quote]

Was bitteschön ist daran nicht verständlich? Die Datei darf eifnach nicht für alle beschreibbar sein. Also ändere die Zugriffsrechte.