Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

Problems with SetEnv and Alias

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


geoff at allotz

May 24, 2009, 11:30 PM

Post #1 of 4 (546 views)
Permalink
Problems with SetEnv and Alias

Hi Guys,

This has most likely been answered before but I have to ask as I have
searched this mailing list and can't find the answer I am looking for.
It is also most likely in the mod_perl 2,0 documentation and if there is
a relevant part of it you can point me to regarding my issue that would
be good!

I am running mod_perl 2 on a debian server using apache2

I have a <VirtualHost> directive which incorporates a mod_perl
PerlTransHandler. This VirtualHost block of the config also has some
Alias and SetEnv directives defined.

The PerlTransHandler module behaves correctly and works well but it
seems that when I execute a PHP document under this VirtualHost I lose
the $_SERVER (%ENV in perl) variables and Alias settings I have set in
the Apache VirtualHost block of my config.

Attached is my PerlTransHandler and my PerlFixupHandler as well as my
Apache configuration.

--
Kind regards,
Geoff T



------------------------------------------------------------------------

*Geoff Toogood*
Analyst / Programmer & System Administration

a: Level 5, 128 Bundall Rd, Bundall QLD 4217, Australia
t: +61 7 5574 0681 f: +61 7 5574 0932
e: geoff[at]allotz.com
w: www.allotz.com



Allotz is a proud member of the following associations...

Hospitality Sales and Marketing Association International - Asian
American Hotel Owners Association - American Hotel & Lodging Association
- The OpenTravel Alliance

Allotz.com limited - Seriously Smart Travel Technology
Attachments: ApacheConfig.txt (0.50 KB)
  MyFixUpHandler.pm (0.38 KB)
  MyTransHandler.pm (1.03 KB)


fred at redhotpenguin

May 27, 2009, 8:13 AM

Post #2 of 4 (495 views)
Permalink
Re: Problems with SetEnv and Alias [In reply to]

On Sun, May 24, 2009 at 11:30 PM, Geoff Toogood <geoff[at]allotz.com> wrote:
> Hi Guys,
>
> This has most likely been answered before but I have to ask as I have
> searched this mailing list and can't find the answer I am looking for. It is
> also most likely in the mod_perl 2,0 documentation and if there is a
> relevant part of it you can point me to regarding my issue that would be
> good!
>
> I am running mod_perl 2 on a debian server using apache2
>
> I have a <VirtualHost> directive which incorporates a mod_perl
> PerlTransHandler. This VirtualHost block of the config also has some Alias
> and SetEnv directives defined.
>
> The PerlTransHandler module behaves correctly and works well but it seems
> that when I execute a PHP document under this VirtualHost I lose the
> $_SERVER (%ENV in perl) variables and Alias settings I have set in the
> Apache VirtualHost block of my config.

Can you show us how you are executing the PHP document?


>
> Attached is my PerlTransHandler and my PerlFixupHandler as well as my Apache
> configuration.
>
> --
> Kind regards,
> Geoff T
>
>
>
> <VirtualHost *:80>
>
>        ServerName www.test.com
>        ServerAlias www.test.com
>        ServerAdmin webmaster[at]test.com
>
>        <Perl>
>                use lib '/etc/SysAdmin/perl5/Handlers/';
>        </Perl>
>
>        DocumentRoot /vhosts/www/htdocs/
>        CustomLog /vhosts/www/logs/http-accesslog combined
>        ErrorLog /vhosts/www/logs/http-errorlog
>
>        PerlTransHandler +MyTransHandler
>        PerlFixupHandler +MyFixUpHandler
>
>        PerlSetEnv ConfigPath /etc/SysAdmin/perl5/
>        Alias /css/main.css /etc/SysAdmin/PrivateLabel/trunk/2/css/main.css
>
> </VirtualHost>
>
>
>
>


pharkins at gmail

May 27, 2009, 1:24 PM

Post #3 of 4 (493 views)
Permalink
Re: Problems with SetEnv and Alias [In reply to]

On Mon, May 25, 2009 at 2:30 AM, Geoff Toogood <geoff[at]allotz.com> wrote:
> I have a <VirtualHost> directive which incorporates a mod_perl
> PerlTransHandler. This VirtualHost block of the config also has some Alias
> and SetEnv directives defined.
>
> The PerlTransHandler module behaves correctly and works well but it seems
> that when I execute a PHP document under this VirtualHost I lose the
> $_SERVER (%ENV in perl) variables and Alias settings I have set in the
> Apache VirtualHost block of my config.

That should work. Can you try it with a simple CGI script, to see if
the PHP config is the problem?

- Perrin


geoff at allotz

Jun 1, 2009, 5:51 PM

Post #4 of 4 (448 views)
Permalink
Re: Problems with SetEnv and Alias [In reply to]

Perrin Harkins wrote:
> On Mon, May 25, 2009 at 2:30 AM, Geoff Toogood <geoff[at]allotz.com> wrote:
>
>> I have a <VirtualHost> directive which incorporates a mod_perl
>> PerlTransHandler. This VirtualHost block of the config also has some Alias
>> and SetEnv directives defined.
>>
>> The PerlTransHandler module behaves correctly and works well but it seems
>> that when I execute a PHP document under this VirtualHost I lose the
>> $_SERVER (%ENV in perl) variables and Alias settings I have set in the
>> Apache VirtualHost block of my config.
>>
>
> That should work. Can you try it with a simple CGI script, to see if
> the PHP config is the problem?
>
> - Perrin
>
I just thought respond to this and say that it worked fine with a Perl
CGI script. I did manage to get things working for PHP in the end. I was
using <VirtualHost *:80> in the VirtualHost section (along with
NameVirtualHost *:80), as soon as I changed this and defined an IP
address instead of * (effectively making it not use NameVirtualHost) it
worked!!

That was not really a solution for me because it means I need to have a
separate IP address for each of these VirtualHost sections I may want to
add Alias' or set ENV variables in the config :oS Anyone know why that
might be? (I know it is not really a modperl related question, more of
an apache question so feel free to ignore it :o) FYI I have a standard
debian linux setup running apache2 and modperl.

Thanks for all your help guys.

Geoff T


--
Kind regards,
Geoff T

------------------------------------------------------------------------

*Geoff Toogood*
Analyst / Programmer & System Administration

a: Level 5, 128 Bundall Rd, Bundall QLD 4217, Australia
t: +61 7 5574 0681 f: +61 7 5574 0932
e: geoff[at]allotz.com
w: www.allotz.com



Allotz is a proud member of the following associations...

Hospitality Sales and Marketing Association International - Asian
American Hotel Owners Association - American Hotel & Lodging Association
- The OpenTravel Alliance

Allotz.com limited - Seriously Smart Travel Technology
Attachments: member_logos1.png (5.63 KB)
  allotz_logo.png (4.26 KB)

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.