You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Arsen Hayrapetyan <ah...@mail.yerphi.am> on 2007/04/10 15:35:09 UTC

[users@httpd] CGI question

Hello,

The question may sound something primitive, but I could not understand 
the underlying mechanism...

I have a server with the name aligrid1.yerphi.am.
DOCUMENT_ROOT == /a/b/httpd/docs
and
ScriptAlias /cgi-bin/ "/a/b/httpd/cgi-bin/"

There
 is a directory, called 'pub' in my cgi-bin directory, and there is a 
script, called 'pki' there (/a/b/httpd/cgi-bin/pub/pki)

When I type in into my browser the following URL:
https://aligrid1.yerphi.am/pub
the pki file is executed (though, its name was not in URL). When I make 
this file not executable, an error appears.

Could anybody explain please the mechanism, which Apache works in this 
situation?

Thanks in advance,
Arsen.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI question

Posted by Joost de Heer <sa...@xs4all.nl>.
> I used wget. It is a little hard to capture with firefox because the
> redirect gets followed before you have a chance to examine where you
> are. And it can't be done manually (via telnet) because you are using
> ssl.

HTTPS manual testing can be done with:

openssl s_client -connect server:port

and then the regular HTTP commands.

Joost


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI question

Posted by Arsen Hayrapetyan <ah...@mail.yerphi.am>.
Hello Joshua,

Joshua Slive wrote:
> On 4/12/07, Arsen Hayrapetyan <ah...@mail.yerphi.am> wrote:
>
>> I am not familiar with Apache, I am learning it, so, please, excuse my
>> ignorance.
>> I installed the OpenCA software and now I am trying to understand its
>> behaviour related to
>> web-server.
>> I haven't redirected or forwarded anything in Apache config files. So, I
>> guess,
>> that the only place where this redirection could be done is the 'pki'
>> CGI script (in pub directory).
>> So, could you please answer the following questions?
>>
>> 1) I think that, when I type in in my browser
>> https://aligrid1.yerphi.am/pub,
>> the  web-server looks into 'pub' subdirectory in the directory,
>> specified by the DocumentRoot in my httpd.conf.
>> In that directory it finds an executable, called 'pki' and runs it as
>> CGI script.
>> Is this correct?
>
> No, not by default. In your case, when I tested it, it appeared that
> there was an index.html in the pub folder that did a "meta refresh"
> redirect to the /cgi-bin/pub/pki script.
>
Ok.
>>
>> 2) Can the redirection done from within the CGI script? Is it possible?
>
> I don't know what you are asking here. What redirection?
>
Please, ignore this question.
>>
>> 3) Could you, please, tell me, what tool did you use to capture the
>> content of "/pub/" page?
>> Is it a Mozilla plug-in or add-on?
>
> I used wget. It is a little hard to capture with firefox because the
> redirect gets followed before you have a chance to examine where you
> are. And it can't be done manually (via telnet) because you are using
> ssl.
>
OK.

Thank you very much for your exhaustive answers, they helped me lot.

Best regards,
Arsen.
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI question

Posted by Joshua Slive <jo...@slive.ca>.
On 4/12/07, Arsen Hayrapetyan <ah...@mail.yerphi.am> wrote:

> I am not familiar with Apache, I am learning it, so, please, excuse my
> ignorance.
> I installed the OpenCA software and now I am trying to understand its
> behaviour related to
> web-server.
> I haven't redirected or forwarded anything in Apache config files. So, I
> guess,
> that the only place where this redirection could be done is the 'pki'
> CGI script (in pub directory).
> So, could you please answer the following questions?
>
> 1) I think that, when I type in in my browser
> https://aligrid1.yerphi.am/pub,
> the  web-server looks into 'pub' subdirectory in the directory,
> specified by the DocumentRoot in my httpd.conf.
> In that directory it finds an executable, called 'pki' and runs it as
> CGI script.
> Is this correct?

No, not by default. In your case, when I tested it, it appeared that
there was an index.html in the pub folder that did a "meta refresh"
redirect to the /cgi-bin/pub/pki script.

>
> 2) Can the redirection done from within the CGI script? Is it possible?

I don't know what you are asking here. What redirection?

>
> 3) Could you, please, tell me, what tool did you use to capture the
> content of "/pub/" page?
> Is it a Mozilla plug-in or add-on?

I used wget. It is a little hard to capture with firefox because the
redirect gets followed before you have a chance to examine where you
are. And it can't be done manually (via telnet) because you are using
ssl.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI question

Posted by Arsen Hayrapetyan <ah...@mail.yerphi.am>.
Joshua Slive wrote:
> On 4/10/07, Arsen Hayrapetyan <ah...@mail.yerphi.am> wrote:
>> Hello,
>>
>> The question may sound something primitive, but I could not understand
>> the underlying mechanism...
>>
>> I have a server with the name aligrid1.yerphi.am.
>> DOCUMENT_ROOT == /a/b/httpd/docs
>> and
>> ScriptAlias /cgi-bin/ "/a/b/httpd/cgi-bin/"
>>
>> There
>>  is a directory, called 'pub' in my cgi-bin directory, and there is a
>> script, called 'pki' there (/a/b/httpd/cgi-bin/pub/pki)
>>
>> When I type in into my browser the following URL:
>> https://aligrid1.yerphi.am/pub
>> the pki file is executed (though, its name was not in URL). When I make
>> this file not executable, an error appears.
>>
>> Could anybody explain please the mechanism, which Apache works in this
>> situation?
>
> The following is the content of the page /pub/ on your server:
> <HTML>
> <HEAD>
>   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
>   <META NAME="Author" CONTENT="Massimiliano Pala">
>   <META NAME="GENERATOR" CONTENT="Mozilla/4.05 [en] (X11; I; Linux
> 2.0.34 i686) [Netscape]">
>   <meta http-equiv="refresh" content="0;
> URL=/cgi-bin/pub/pki?cmd=getStaticPage&name=index">
> ...
>
> In other words, you (or someone else) has deliberately configured your
> server to forward requests to this other location. It has nothing to
> do with apache configuration.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

I am not familiar with Apache, I am learning it, so, please, excuse my 
ignorance.
I installed the OpenCA software and now I am trying to understand its 
behaviour related to
web-server.
I haven't redirected or forwarded anything in Apache config files. So, I 
guess,
that the only place where this redirection could be done is the 'pki' 
CGI script (in pub directory).
So, could you please answer the following questions?

1) I think that, when I type in in my browser 
https://aligrid1.yerphi.am/pub,
the  web-server looks into 'pub' subdirectory in the directory, 
specified by the DocumentRoot in my httpd.conf.
In that directory it finds an executable, called 'pki' and runs it as 
CGI script.
Is this correct?

2) Can the redirection done from within the CGI script? Is it possible?

3) Could you, please, tell me, what tool did you use to capture the 
content of "/pub/" page?
Is it a Mozilla plug-in or add-on?

Thank you for your time,
Arsen.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CGI question

Posted by Joshua Slive <jo...@slive.ca>.
On 4/10/07, Arsen Hayrapetyan <ah...@mail.yerphi.am> wrote:
> Hello,
>
> The question may sound something primitive, but I could not understand
> the underlying mechanism...
>
> I have a server with the name aligrid1.yerphi.am.
> DOCUMENT_ROOT == /a/b/httpd/docs
> and
> ScriptAlias /cgi-bin/ "/a/b/httpd/cgi-bin/"
>
> There
>  is a directory, called 'pub' in my cgi-bin directory, and there is a
> script, called 'pki' there (/a/b/httpd/cgi-bin/pub/pki)
>
> When I type in into my browser the following URL:
> https://aligrid1.yerphi.am/pub
> the pki file is executed (though, its name was not in URL). When I make
> this file not executable, an error appears.
>
> Could anybody explain please the mechanism, which Apache works in this
> situation?

The following is the content of the page /pub/ on your server:
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
   <META NAME="Author" CONTENT="Massimiliano Pala">
   <META NAME="GENERATOR" CONTENT="Mozilla/4.05 [en] (X11; I; Linux
2.0.34 i686) [Netscape]">
   <meta http-equiv="refresh" content="0;
URL=/cgi-bin/pub/pki?cmd=getStaticPage&name=index">
...

In other words, you (or someone else) has deliberately configured your
server to forward requests to this other location. It has nothing to
do with apache configuration.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org