You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Nick Tonkin <ni...@tonkinresolutions.com> on 2003/02/18 18:08:47 UTC

[mp2] $r->server->server_hostname() compatibility?

Does anyone know the equivalent directive for
$r->server()->server_hostname()

?
Thanks,

- nick

--

~~~~~~~~~~~~~~~~~~~~
Nick Tonkin   {|8^)>


Re: [mp2] $r->server->server_hostname() compatibility?

Posted by Nick Tonkin <ni...@tonkinresolutions.com>.
On Wed, 19 Feb 2003, Stas Bekman wrote:

> Nick Tonkin wrote:
> > On Wed, 19 Feb 2003, Stas Bekman wrote:
> >
> >
> >>Nick Tonkin wrote:
> >>
> >>>Does anyone know the equivalent directive for
> >>>$r->server()->server_hostname()
> >>
> >>it's right there:
> >>
> >>use Apache::Server;
> >>$r->server->server_name;
>
> oops, a typo, should be: $r->server->server_hostname

This and Apache::RequestUtil::get_server_name now seem to work jus' great.


- nick

-- 

~~~~~~~~~~~~~~~~~~~~
Nick Tonkin   {|8^)>


Re: [mp2] $r->server->server_hostname() compatibility?

Posted by Stas Bekman <st...@stason.org>.
Nick Tonkin wrote:
> On Wed, 19 Feb 2003, Stas Bekman wrote:
> 
> 
>>Nick Tonkin wrote:
>>
>>>Does anyone know the equivalent directive for
>>>$r->server()->server_hostname()
>>
>>it's right there:
>>
>>use Apache::Server;
>>$r->server->server_name;

oops, a typo, should be: $r->server->server_hostname

> Well, it doesn't work as advertised, I think.
> 
> package NPT::MyTest;
> 
> use strict;
> use warnings;
> use Apache::RequestRec;
> use Apache::RequestUtil;
> use Apache::Server;
> 
> sub handler {
>     my $r = shift;
>     warn $r->server->server_name;
> 
>     return 200;
> }
> 
> 1;
> ~
> 
> [Tue Feb 18 15:08:58 2003] [error] [client 192.168.0.33] Can't locate
> object method "server_name" via package "Apache::Server" at
> /home/nick/perl/NPT/MyTest.pm line 14.
> 
> 
> 
> 
> - nick
> 


-- 


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] $r->server->server_hostname() compatibility?

Posted by Nick Tonkin <ni...@tonkinresolutions.com>.
On Wed, 19 Feb 2003, Stas Bekman wrote:

> Nick Tonkin wrote:
> > Does anyone know the equivalent directive for
> > $r->server()->server_hostname()
>
> it's right there:
>
> use Apache::Server;
> $r->server->server_name;

Well, it doesn't work as advertised, I think.

package NPT::MyTest;

use strict;
use warnings;
use Apache::RequestRec;
use Apache::RequestUtil;
use Apache::Server;

sub handler {
    my $r = shift;
    warn $r->server->server_name;

    return 200;
}

1;
~

[Tue Feb 18 15:08:58 2003] [error] [client 192.168.0.33] Can't locate
object method "server_name" via package "Apache::Server" at
/home/nick/perl/NPT/MyTest.pm line 14.




- nick

-- 

~~~~~~~~~~~~~~~~~~~~
Nick Tonkin   {|8^)>


Re: [mp2] $r->server->server_hostname() compatibility?

Posted by Stas Bekman <st...@stason.org>.
Nick Tonkin wrote:
> Does anyone know the equivalent directive for
> $r->server()->server_hostname()

it's right there:

use Apache::Server;
$r->server->server_name;

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com