Premature end of script headers:

Apache, Lighttpd, nginx, Cherokee
Post Reply
moppi
Posts: 368
Joined: 2003-02-15 11:16
 

Premature end of script headers:

Post 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?
duergner
Posts: 923
Joined: 2003-08-20 11:30
Location: Pittsburgh, PA, USA
 

Re: Premature end of script headers:

Post by duergner »

Wie immer: Logs und Config
moppi
Posts: 368
Joined: 2003-02-15 11:16
 

Re: Premature end of script headers:

Post 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
duergner
Posts: 923
Joined: 2003-08-20 11:30
Location: Pittsburgh, PA, USA
 

Re: Premature end of script headers:

Post 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.
Last edited by duergner on 2004-07-23 09:17, edited 1 time in total.
tix.64
Posts: 17
Joined: 2004-03-03 13:40
 

Re: Premature end of script headers:

Post 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 :?
moppi
Posts: 368
Joined: 2003-02-15 11:16
 

Re: Premature end of script headers:

Post 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"
Last edited by moppi on 2004-07-23 09:18, edited 1 time in total.
duergner
Posts: 923
Joined: 2003-08-20 11:30
Location: Pittsburgh, PA, USA
 

Re: Premature end of script headers:

Post 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. :?
moppi
Posts: 368
Joined: 2003-02-15 11:16
 

Re: Premature end of script headers:

Post by moppi »

wie oft soll ich das noch lesen?

Ich wüsste nicht wo das problem liegt
duergner
Posts: 923
Joined: 2003-08-20 11:30
Location: Pittsburgh, PA, USA
 

Re: Premature end of script headers:

Post 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
tix.64
Posts: 17
Joined: 2004-03-03 13:40
 

Re: Premature end of script headers:

Post 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.
moppi
Posts: 368
Joined: 2003-02-15 11:16
 

Re: Premature end of script headers:

Post 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?
duergner
Posts: 923
Joined: 2003-08-20 11:30
Location: Pittsburgh, PA, USA
 

Re: Premature end of script headers:

Post by duergner »

Nein.
moppi
Posts: 368
Joined: 2003-02-15 11:16
 

Re: Premature end of script headers:

Post by moppi »

Wie bitte geht es dann in der Doc steht compilieren.
duergner
Posts: 923
Joined: 2003-08-20 11:30
Location: Pittsburgh, PA, USA
 

Re: Premature end of script headers:

Post by duergner »

Ja das geht ja. Das nein bezog sich auf der ohne gehts nicht. Und das ist korrekt so.
moppi
Posts: 368
Joined: 2003-02-15 11:16
 

Re: Premature end of script headers:

Post 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
Last edited by moppi on 2004-07-23 12:51, edited 1 time in total.
duergner
Posts: 923
Joined: 2003-08-20 11:30
Location: Pittsburgh, PA, USA
 

Re: Premature end of script headers:

Post 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.
Post Reply