You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Igor Cicimov <ic...@gmail.com> on 2012/05/19 12:26:27 UTC

Re: [users@httpd] CGI script is not executed

The name should be test.cgi
 On May 19, 2012 5:29 PM, "Allen Liu" <al...@gmail.com> wrote:

> Hi experts,
> I just set up my first httpd server 2.4.2. It is a simple setup, I took
> almost everything as default setting.
> After it was started, I tried test-cgi located in cgi-bin directory. The
> issue was that the script didn't run. The browser only displayed the script
> contents. Can anyone help ?
>
> I checked httpd.conf which has
>        ScriptAlias /cgi-bin/  "/usr/local/apache2/cgi-bin/"
>
> Here is the directory permission:
>        drwxr-xr-x  2 root root  4096 May 18 16:55 cgi-bin
> scrip in cgi-bin t:
>        -rwxr-xr-x 1 root     games    1135 May 18 15:35 test-cgi
> I know that httpd runs as user 'demon', but I think the cgi file has 755
> permission, it should have no problem.
>
> Any help is appreciated.
>
> Allen Liu
> allenliu2000@gmail.com
> +1 510 936-0101
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] CGI script is not executed

Posted by Igor Cicimov <ic...@gmail.com>.
If you look in apache config file you will find a line like this:

AddHandler cgi-script .cgi .pl

which tells apache to handle the files with .cgi and .pl as cgi scripts.
Without this apache will handle them as default text/html file. So the
script alis is useless without proper handle, it just defines the default
script directory.

Obviously if you want to have some PHP scripts to be handled as cgi by
apache you need to add that new extension to the AddHandler line:

 AddHandler cgi-script .cgi .pl .php

So obviously your file name without extension doesn't match this criteria.

Igor

On Sun, May 20, 2012 at 1:34 AM, Allen Liu <al...@gmail.com> wrote:

> Hi Igor,
> Could you tell a little bit more why the name should be test.cgi ? I am
> sure there is a file with name test-cgi in cgi-bin directory with 755. So
> wonder why test.cgi should be used as you said. Do you mean all scripts
> should have .cgi suffix? Httpd.conf doc indicated that ScriptAlias
> specifies a directory in which all files are treated as scripts instead of
> docs.
> Btw, I installed it on another machine, same issue.
>
>
>
> Thanks,
> Allen Liu +1 510 9360101
>
> On May 19, 2012, at 3:27 AM, Igor Cicimov <ic...@gmail.com> wrote:
>
> The name should be test.cgi
>  On May 19, 2012 5:29 PM, "Allen Liu" <al...@gmail.com> wrote:
>
>> Hi experts,
>> I just set up my first httpd server 2.4.2. It is a simple setup, I took
>> almost everything as default setting.
>> After it was started, I tried test-cgi located in cgi-bin directory. The
>> issue was that the script didn't run. The browser only displayed the script
>> contents. Can anyone help ?
>>
>> I checked httpd.conf which has
>>        ScriptAlias /cgi-bin/  "/usr/local/apache2/cgi-bin/"
>>
>> Here is the directory permission:
>>        drwxr-xr-x  2 root root  4096 May 18 16:55 cgi-bin
>> scrip in cgi-bin t:
>>        -rwxr-xr-x 1 root     games    1135 May 18 15:35 test-cgi
>> I know that httpd runs as user 'demon', but I think the cgi file has 755
>> permission, it should have no problem.
>>
>> Any help is appreciated.
>>
>> Allen Liu
>> allenliu2000@gmail.com
>> +1 510 936-0101
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>

Re: [users@httpd] CGI script is not executed

Posted by Allen Liu <al...@gmail.com>.
Hi Igor,
Could you tell a little bit more why the name should be test.cgi ? I am
sure there is a file with name test-cgi in cgi-bin directory with 755. So
wonder why test.cgi should be used as you said. Do you mean all scripts
should have .cgi suffix? Httpd.conf doc indicated that ScriptAlias
specifies a directory in which all files are treated as scripts instead of
docs.
Btw, I installed it on another machine, same issue.



Thanks,
Allen Liu +1 510 9360101

On May 19, 2012, at 3:27 AM, Igor Cicimov <ic...@gmail.com> wrote:

The name should be test.cgi
 On May 19, 2012 5:29 PM, "Allen Liu" <al...@gmail.com> wrote:

> Hi experts,
> I just set up my first httpd server 2.4.2. It is a simple setup, I took
> almost everything as default setting.
> After it was started, I tried test-cgi located in cgi-bin directory. The
> issue was that the script didn't run. The browser only displayed the script
> contents. Can anyone help ?
>
> I checked httpd.conf which has
>        ScriptAlias /cgi-bin/  "/usr/local/apache2/cgi-bin/"
>
> Here is the directory permission:
>        drwxr-xr-x  2 root root  4096 May 18 16:55 cgi-bin
> scrip in cgi-bin t:
>        -rwxr-xr-x 1 root     games    1135 May 18 15:35 test-cgi
> I know that httpd runs as user 'demon', but I think the cgi file has 755
> permission, it should have no problem.
>
> Any help is appreciated.
>
> Allen Liu
> allenliu2000@gmail.com
> +1 510 936-0101
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>