You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by Steve Fosdick <fo...@aom.bt.co.uk> on 2001/11/14 13:08:14 UTC

PerlSetVar Global and Multiple Applications with Virtual Hosts

I am trying to set up multiple versions of an application on a single
server using different virtual hosts to distinguish the versions of
the application.  Each version needs its own global.asa which I want
to locate outside the WWW visible tree for the application.

In order to acheive this I have tried using PerlSetVar Global within
each <VirtualHost> section of the Apache configuration file but it
seems to be getting ignored (in that the global.asa file within in the
directory nominated doesn't seem to get run), perhaps in favour of a
setting in the main part of the configuration file.

Is what I am trying to do possible and if so how do I go about it please?

-- 
Steve Fosdick.
e-mail: steve.fosdick@bt.com
tel: +44 (0) 1473 642987
fax: +44 (0) 1473 646656

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: PerlSetVar Global and Multiple Applications with Virtual Hosts

Posted by Steve Fosdick <st...@aom.bt.co.uk>.
Joshua Chamas wrote:

>Yes, its possible to do just as you are trying... and I would question 
>whether the <VirtualHost> section is even being recognized for the site 
>in question?  If after I have confirmed the working of the <VirtualHost> 
>section, I might check to make sure there isn't a .htaccess being picked up overriding the Global setting.
>
Thanks Josh, I have found a <Files> section which appeared to override 
the settings in the VirtualHost sections.  Removing the PerlSetVars from 
this <Files> section has solved the problem.

Steve.


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: PerlSetVar Global and Multiple Applications with Virtual Hosts

Posted by Joshua Chamas <jo...@chamas.com>.
"John D. Leonard II" wrote:
> 
> Joshua:
> 
> > # NODEWORKS HTTP
> > <VirtualHost 206.135.235.178:80>
> >   ServerName www.nodeworks.com
> >   ServerAlias nodeworks.com
> >   Include conf/nodeworks/html.conf
> >   PerlSetVar StatScripts 0
> > </VirtualHost>
> 
> What is inside one of the .conf files used in the Include statement above?
> 

Not everything, but here's what matters to making NodeWorks tick,
starting with the non-SSL portion of the site:

# conf/nodeworks/html.conf
        ServerAdmin ##########@chamas.com
        ServerName  www.nodeworks.com
        PerlPostReadRequestHandler My::ProxyRemoteAddr
        SSLDisable 
        DocumentRoot /usr/local/proj/mlink/site/html
        DirectoryIndex default.htm 
        Options +FollowSymLinks
        Alias /img /usr/local/proj/mlink/site/img
        Alias /test /usr/local/proj/mlink/site/test
        Include         conf/nodeworks/asp_config.conf
        PerlSetVar      Global          /usr/local/proj/mlink/perllib

<Directory /usr/local/proj/mlink/site/html>
  <Files ~ (\.htm$)>
        SetHandler      perl-script
        PerlHandler     Apache::ASP
  </Files>
</Directory>

Here's the config for the SSL portion of the site:

        PerlPostReadRequestHandler My::ProxyRemoteAddr
        ServerAdmin     ##########@chamas.com
        ServerName      www.nodeworks.com
        Include         conf/nodeworks/asp_config.conf
        PerlSetVar      Global          /usr/local/proj/mlink/perllib
        PerlSetVar      SecureSession   1
        PerlSetVar      StateCache      0
        PerlSetVar      CompressGzip    1
        DocumentRoot    /usr/local/proj/mlink/site/ssl
        Alias           /img /usr/local/proj/mlink/site/img
        Alias           /dload /usr/local/proj/mlink/site/dload

        <Files ~ (\.asp$)>
                SetHandler      perl-script
                PerlHandler     Apache::ASP
                PerlSetVar      AllowSessionState 1
        </Files>

        <Files ~ (\.htm$)>
                SetHandler      perl-script
                PerlHandler     Apache::ASP
        </Files>

And this config is common to both of them... note that the order
of includes matters, as you can override a setting from an 
earlier include if you set it after the include is loaded ...

# asp_config.conf
PerlSetVar      BufferingOn 1
#PerlSetVar     Debug 3
PerlSetVar      Debug -1
PerlSetVar      TimeHiRes 0
PerlSetVar      Clean 0
PerlSetVar      GlobalPackage   Node::Site
PerlSetVar      DynamicIncludes 1
PerlSetVar      MailErrorsTo    ##########@chamas.com
PerlSetVar      MailAlertTo     ##########@chamas.com
PerlSetVar      MailAlertPeriod 10
PerlSetVar      MailHost        mailhost
PerlSetVar      XMLSubsMatch    node:\w+
PerlSetVar      UseStrict       1
PerlSetVar      StateDB         SDBM_File
PerlSetVar      SessionTimeout  120
# application state on for the not_found.inc checksum functionality
PerlSetVar      AllowApplicationState 1
PerlSetVar      AllowSessionState 0
PerlSetVar      StateDir        /tmp/node       
PerlSetVar      SessionQueryParse 1
PerlSetVar      SessionQueryParseMatch ^(https://www\.nodeworks\.com|https?://gate.chamas.com)

That's it.

--Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


RE: PerlSetVar Global and Multiple Applications with Virtual Hosts

Posted by "John D. Leonard II" <jo...@ce.gatech.edu>.
Joshua:

> # NODEWORKS HTTP
> <VirtualHost 206.135.235.178:80>
>   ServerName www.nodeworks.com
>   ServerAlias nodeworks.com
>   Include conf/nodeworks/html.conf
>   PerlSetVar StatScripts 0
> </VirtualHost>

What is inside one of the .conf files used in the Include statement above?

JL

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: PerlSetVar Global and Multiple Applications with Virtual Hosts

Posted by Joshua Chamas <jo...@chamas.com>.
Steve Fosdick wrote:
> 
> I am trying to set up multiple versions of an application on a single
> server using different virtual hosts to distinguish the versions of
> the application.  Each version needs its own global.asa which I want
> to locate outside the WWW visible tree for the application.
> 
> In order to acheive this I have tried using PerlSetVar Global within
> each <VirtualHost> section of the Apache configuration file but it
> seems to be getting ignored (in that the global.asa file within in the
> directory nominated doesn't seem to get run), perhaps in favour of a
> setting in the main part of the configuration file.
> 
> Is what I am trying to do possible and if so how do I go about it please?
> 

Yes, its possible to do just as you are trying... and I would question 
whether the <VirtualHost> section is even being recognized for the site 
in question?  If after I have confirmed the working of the <VirtualHost> 
section, I might check to make sure there isn't a .htaccess being picked up 
overriding the Global setting.

For, a sample VirtualHost config, here's what I use for NodeWorks
and Apache::ASP sites:

NameVirtualHost 206.135.235.178:80

# NODEWORKS HTTP
<VirtualHost 206.135.235.178:80>
  ServerName www.nodeworks.com
  ServerAlias nodeworks.com
  Include conf/nodeworks/html.conf
  PerlSetVar StatScripts 0
</VirtualHost>

# ASP HTTP
<VirtualHost 206.135.235.178:80>
  ServerName www.apache-asp.org
  ServerAlias apache-asp.org
  DocumentRoot /usr/local/proj/mlink/site/asp
  Include conf/nodeworks/asp.conf
</VirtualHost>

--Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org