You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Estrade Matthieu <es...@ifrance.com> on 2002/11/25 17:29:33 UTC

r->server->port problem

Hi,

I posted a mail about a problem with r->server->port few days ago,
I did a patch to correct this bug, but i am not sure it's a bug...

the problem was when UseCannonicalName is Off,

If i have a request on port 8095 like:

GET / HTTP/1.1
Host: mydomain.com
\n\n\r

my module is using the r->server->port

the r->server->port will be ap_default_port  because of in server/core.c:

(When UseCanonicalName Off)

port = r->parsed_uri.port ? r->parsed_uri.port :
                r->server->port ? r->server->port :
                ap_default_port(r);

so, i did:

port = r->parsed_uri.port ? r->parsed_uri.port :
               r->server->port ? r->server->port :
               r->connection->local_addr->port ? 
r->connection->local_addr->port :
               ap_default_port(r);

I dunno if i am true or false.

it's now working in my module, it's finding r->server->port = 8095 
instead of 80


regards,

Estrade Matthieu



Re: r->server->port problem

Posted by Estrade Matthieu <es...@ifrance.com>.
yes, it's a reason, and i understand well now why it's like that :)

thanks

Matthieu

William A. Rowe, Jr. wrote:

>Hmmm... I'm thinking that in between UseCanonicalName On [look up our
>name and use that] v.s. UseCanonicalName Off [trust the client] ...
>we might want UseCanonicalName Port which would not do the DNS
>lookups [trust the client for that] but would trust our idea of the port.
>
>Respectable idea?
>
>Bill
>
>At 06:38 AM 11/26/2002, Estrade Matthieu wrote:
>  
>
>>heh ok, i was using the wrong stuff, i didn't know about this struct server_addrs_rec.
>>
>>what r->server->port is used for ?
>>i just would like to know what is the difference btw usecanonicalName On and Off for the r->server->port
>>why default port is sent instead of real port (socket port), i think there is a reason :)
>>
>>Jeff Trawick wrote:
>>    
>>
>>>Estrade Matthieu <ma...@ifrance.com> writes:
>>>
>>> 
>>>      
>>>
>>>>My module need to know the r->server->port, i mean the port  of
>>>>virtual host used by the client.
>>>>   
>>>>        
>>>>
>>>isn't that in r->server->addrs->host_port?
>>>
>>> 
>>>      
>>>
>
>
>__________________________________________________
>Modem offert : 150,92 euros remboursés sur le Pack eXtense de Wanadoo ! 
>Haut débit à partir de 30 euros/mois : http://www.ifrance.com/_reloc/w
>
>  
>


Re: r->server->port problem

Posted by "William A. Rowe, Jr." <wr...@apache.org>.
Hmmm... I'm thinking that in between UseCanonicalName On [look up our
name and use that] v.s. UseCanonicalName Off [trust the client] ...
we might want UseCanonicalName Port which would not do the DNS
lookups [trust the client for that] but would trust our idea of the port.

Respectable idea?

Bill

At 06:38 AM 11/26/2002, Estrade Matthieu wrote:
>heh ok, i was using the wrong stuff, i didn't know about this struct server_addrs_rec.
>
>what r->server->port is used for ?
>i just would like to know what is the difference btw usecanonicalName On and Off for the r->server->port
>why default port is sent instead of real port (socket port), i think there is a reason :)
>
>Jeff Trawick wrote:
>>
>>Estrade Matthieu <ma...@ifrance.com> writes:
>>
>>  
>>>
>>>My module need to know the r->server->port, i mean the port  of
>>>virtual host used by the client.
>>>    
>>
>>
>>isn't that in r->server->addrs->host_port?
>>
>>  


Re: r->server->port problem

Posted by Estrade Matthieu <es...@ifrance.com>.
heh ok, i was using the wrong stuff, i didn't know about this struct 
server_addrs_rec.

what r->server->port is used for ?
i just would like to know what is the difference btw usecanonicalName On 
and Off for the r->server->port
why default port is sent instead of real port (socket port), i think 
there is a reason :)

Jeff Trawick wrote:

>Estrade Matthieu <es...@ifrance.com> writes:
>
>  
>
>>My module need to know the r->server->port, i mean the port  of
>>virtual host used by the client.
>>    
>>
>
>isn't that in r->server->addrs->host_port?
>
>  
>


Re: r->server->port problem

Posted by Jeff Trawick <tr...@attglobal.net>.
Estrade Matthieu <es...@ifrance.com> writes:

> My module need to know the r->server->port, i mean the port  of
> virtual host used by the client.

isn't that in r->server->addrs->host_port?

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...

Re: r->server->port problem

Posted by Estrade Matthieu <es...@ifrance.com>.
My module need to know the r->server->port, i mean the port  of virtual 
host used by the client.
in my apache, i have 2 VHOST:

The problem happened when i was behind an Intel SSL Accelerator.

client https ---> SSL INTEL 443 --> Reverse Proxy 8095

The SSL accelerator is listening on 443, send clear http on port 8095 of 
my RP as:
GET / HTTP/1.1
Host: lala.com
\n\n\r

<VirtualHost ip:8095>
ServerName lala.com
ProxyPass / http://host1.com
ProxyPassReverse....
</VirtualHost>

<VirtualHost ip:80>
Servername lala.com
redirect / https://lala.com (redirect to HTTPS)
</VirtualHost>

my module will find r->server->port = 80 even if the SSL Accelerator is 
connected on port 8095
It can happen too if i have the same servername in each VHOST.

My module is now checking conn->socket->port or something like that... i 
have no more problem

What i find buggy is the correct VHOST is used, if not, the connection 
should be a loop !
so i am in the correct VHOST and when my module check r->server->port, i 
find 80 !



Jeff Trawick wrote:

>Estrade Matthieu <es...@ifrance.com> writes:
>
>  
>
>>I posted a mail about a problem with r->server->port few days ago,
>>I did a patch to correct this bug, but i am not sure it's a bug...
>>
>>the problem was when UseCannonicalName is Off,
>>    
>>
>
>I don't think it is a bug.
>
>What exactly does your module need to know?
>
>  
>


Re: MPM perchild.

Posted by Enrico Weigelt <we...@metux.de>.
On Tue, Nov 26, 2002 at 06:44:13PM +0100, Jonas Eriksson wrote:

<snip>
> /usr/local/apache2.0.43/conf/httpd.conf
> [Tue Nov 26 18:35:41 2002] [debug] perchild.c(2007): filling out
> child_info_table; UID: 1096, GID: 1094, SD: 4 4, OUTPUT: 5 5, Child Num:
> 0
> [Tue Nov 26 18:35:41 2002] [debug] perchild.c(2007): filling out
> child_info_table; UID: 1096, GID: 1094, SD: 4 4, OUTPUT: 5 5, Child Num:
> 1
> [Tue Nov 26 18:35:41 2002] [debug] perchild.c(2007): filling out
> child_info_table; UID: 1096, GID: 1094, SD: 4 4, OUTPUT: 5 5, Child Num:
> 2

Little question about ChildPerUserId. The manual states, that the 
first parameter n is the ID of the child to assign, but the 
set_child_per_user_id function seems to assign n childs to the given uid/gid.

is that ok ?

~-n
--
Bestes Mittel gegen Mailviren: Outlook löschen.
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux ITS 
 Webhosting ab 5 EUR/Monat.          UUCP, rawIP und vieles mehr.

 phone:     +49 36207 519931         www:       http://www.metux.de/     
 fax:       +49 36207 519932         email:     contact@metux.de
 cellphone: +49 174 7066481	     smsgate:   sms.weigelt@metux.de
---------------------------------------------------------------------
 Diese Mail wurde mit UUCP versandt.      http://www.metux.de/uucp/

Re: SV: MPM perchild.

Posted by Johannes Erdfelt <jo...@erdfelt.com>.
That looks about good.

Do you only have one child defined?

JE

On Tue, Nov 26, 2002, Jonas Eriksson <jo...@webkonsulterna.com> wrote:
> 
> 
> Hmm sorry! I did a bougus error in http.conf ...
> 
> When i now start the server i get the following in my shell promt and
> the server starts.
> What does the debug info tell? Is it all ok or do i have to change
> anyting?
> 
> [root@mose /usr/local/apache2.0.43/bin]# ./httpd -f
> /usr/local/apache2.0.43/conf/httpd.conf
> [Tue Nov 26 18:35:41 2002] [debug] perchild.c(2007): filling out
> child_info_table; UID: 1096, GID: 1094, SD: 4 4, OUTPUT: 5 5, Child Num:
> 0
> [Tue Nov 26 18:35:41 2002] [debug] perchild.c(2007): filling out
> child_info_table; UID: 1096, GID: 1094, SD: 4 4, OUTPUT: 5 5, Child Num:
> 1
> [Tue Nov 26 18:35:41 2002] [debug] perchild.c(2007): filling out
> child_info_table; UID: 1096, GID: 1094, SD: 4 4, OUTPUT: 5 5, Child Num:
> 2
>  
> 
> 
> 
> On Tue, Nov 26, 2002, Jonas Eriksson <jo...@webkonsulterna.com> wrote:
> > I Still get error "Unable to find process with matching uid/gid."
> > after compileing 2.43 with
> >
> http://cvs.apache.org/viewcvs.cgi/httpd-2.0/server/mpm/experimental/perc
> > hild/perchild.c
> 
> Are you sure you configured your setup correctly?
> 
> Do you have a ChildPerUserId before you use AssignUserId?
> 
> Can you give us the configuration you're using?
> 
> JE
> 
> 

SV: MPM perchild.

Posted by Jonas Eriksson <jo...@webkonsulterna.com>.

Hmm sorry! I did a bougus error in http.conf ...

When i now start the server i get the following in my shell promt and
the server starts.
What does the debug info tell? Is it all ok or do i have to change
anyting?

[root@mose /usr/local/apache2.0.43/bin]# ./httpd -f
/usr/local/apache2.0.43/conf/httpd.conf
[Tue Nov 26 18:35:41 2002] [debug] perchild.c(2007): filling out
child_info_table; UID: 1096, GID: 1094, SD: 4 4, OUTPUT: 5 5, Child Num:
0
[Tue Nov 26 18:35:41 2002] [debug] perchild.c(2007): filling out
child_info_table; UID: 1096, GID: 1094, SD: 4 4, OUTPUT: 5 5, Child Num:
1
[Tue Nov 26 18:35:41 2002] [debug] perchild.c(2007): filling out
child_info_table; UID: 1096, GID: 1094, SD: 4 4, OUTPUT: 5 5, Child Num:
2
 



On Tue, Nov 26, 2002, Jonas Eriksson <jo...@webkonsulterna.com> wrote:
> I Still get error "Unable to find process with matching uid/gid."
> after compileing 2.43 with
>
http://cvs.apache.org/viewcvs.cgi/httpd-2.0/server/mpm/experimental/perc
> hild/perchild.c

Are you sure you configured your setup correctly?

Do you have a ChildPerUserId before you use AssignUserId?

Can you give us the configuration you're using?

JE



Re: MPM perchild.

Posted by Johannes Erdfelt <jo...@erdfelt.com>.
On Tue, Nov 26, 2002, Jonas Eriksson <jo...@webkonsulterna.com> wrote:
> I Still get error "Unable to find process with matching uid/gid."
> after compileing 2.43 with
> http://cvs.apache.org/viewcvs.cgi/httpd-2.0/server/mpm/experimental/perc
> hild/perchild.c

Are you sure you configured your setup correctly?

Do you have a ChildPerUserId before you use AssignUserId?

Can you give us the configuration you're using?

JE


MPM perchild.

Posted by Jonas Eriksson <jo...@webkonsulterna.com>.
Hi

I Still get error "Unable to find process with matching uid/gid."
after compileing 2.43 with
http://cvs.apache.org/viewcvs.cgi/httpd-2.0/server/mpm/experimental/perc
hild/perchild.c

Any ideas?



Re: r->server->port problem

Posted by Jeff Trawick <tr...@attglobal.net>.
Estrade Matthieu <es...@ifrance.com> writes:

> I posted a mail about a problem with r->server->port few days ago,
> I did a patch to correct this bug, but i am not sure it's a bug...
> 
> the problem was when UseCannonicalName is Off,

I don't think it is a bug.

What exactly does your module need to know?

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...