You are not logged in.

#1 2015-12-30 13:58:31

N_BaH
Member
Registered: 2015-12-30
Posts: 84

[solved] apache/httpd don't execute CGI script from userdir

Hello,

apache doesn't execute CGI script from userdir.

here is httpd-userdir.conf:

UserDir public_html
<Directory "/home/*/public_html">
    AllowOverride FileInfo AuthConfig Limit Indexes
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Require method GET POST OPTIONS
</Directory>
<Directory "/home/*/public_html/cgi-bin/">
        Options ExecCGI
        SetHandler cgi-script
</Directory>

the error message is

End of script output before headers: test.cgi 

test.cgi is simple script :

#!/bin/bash

printf 'Content-type: text/html\n\n'
echo "</head><body>"
echo "<p><pre>"

echo "peu importe..."

echo "</pre></p>"
echo "</body>
   </html>"

it's correctly executed from /srv/http/cgi-bin/

I added

LoadModule cgi_module modules/mod_cgi.so

in /etc/httpd/conf/httpd.conf

what else could I tell you so you help me ?

thanks in advance.

Last edited by N_BaH (2015-12-30 21:47:27)

Offline

#2 2015-12-30 15:34:53

respiranto
Member
Registered: 2015-05-15
Posts: 479
Website

Re: [solved] apache/httpd don't execute CGI script from userdir

I have never written a CGI script, but should it not also contain an opening <html> and <head> tag?
This might also explain the error message.

Offline

#3 2015-12-30 16:44:50

N_BaH
Member
Registered: 2015-12-30
Posts: 84

Re: [solved] apache/httpd don't execute CGI script from userdir

the exact same script works from /srv/http/cgi-bin/

I added missing tags, but still it doesn't work from userdir.

Offline

#4 2015-12-30 21:46:55

N_BaH
Member
Registered: 2015-12-30
Posts: 84

Re: [solved] apache/httpd don't execute CGI script from userdir

my bad : I misconfigured user's group.

now fixed,everything works fine.

sorry for the noise, and thanks again.

Offline

Board footer

Powered by FluxBB