FAQ
I am currently upgrading our Apache server from 1.3 to 2.2 and I'm
encountering the following error when I try to start Apache. The config
works ok in 1.3, however in 2.2 I get the following error 'Perl directive
not allowed in a <Location> block'.

Can I no longer put a perl directive in a location block?

----------------------------------------------------------------------
<Location />
PerlSetVar CHART_LOCATION bottom
PerlSetVar CRM 1

<Perl>
Some perl code
</Perl>

</Location>
----------------------------------------------------------------------


Thanks,
Kevin
--
View this message in context: http://www.nabble.com/Perl-directive-not-allowed-in-a-Location-block-tp15074701p15074701.html
Sent from the mod_perl - General mailing list archive at Nabble.com.

Search Discussions

  • Philippe M. Chiasson at Jan 24, 2008 at 9:01 pm

    kgerbasi wrote:
    I am currently upgrading our Apache server from 1.3 to 2.2 and I'm
    encountering the following error when I try to start Apache. The config
    works ok in 1.3, however in 2.2 I get the following error 'Perl directive
    not allowed in a <Location> block'.

    Can I no longer put a perl directive in a location block?
    Not anymore, no.

    Can you post a more detailled example of what you are trying to do?

    --
    Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
    http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/
  • Kgerbasi at Jan 24, 2008 at 9:17 pm

    Philippe M. Chiasson wrote:

    kgerbasi wrote:
    I am currently upgrading our Apache server from 1.3 to 2.2 and I'm
    encountering the following error when I try to start Apache. The config
    works ok in 1.3, however in 2.2 I get the following error 'Perl directive
    not allowed in a <Location> block'.

    Can I no longer put a perl directive in a location block?
    Not anymore, no.

    Can you post a more detailled example of what you are trying to do?

    --
    Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
    http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/
    I'm basically pulling client options from our database and setting them in
    the conf file. What would the workaround be since this option has been
    removed?

    <Location />
    <Perl>
    my $config = Config::ApacheConfiguration->new();
    my @clientOptions = $config->GetClientConfiguration('5');
    push @PerlSetVar, @clientOptions;
    </Perl>
    </Location>

    --
    View this message in context: http://www.nabble.com/Perl-directive-not-allowed-in-a-Location-block-tp15074701p15075224.html
    Sent from the mod_perl - General mailing list archive at Nabble.com.
  • Philippe M. Chiasson at Jan 24, 2008 at 9:50 pm

    kgerbasi wrote:


    Philippe M. Chiasson wrote:
    kgerbasi wrote:
    I am currently upgrading our Apache server from 1.3 to 2.2 and I'm
    encountering the following error when I try to start Apache. The config
    works ok in 1.3, however in 2.2 I get the following error 'Perl directive
    not allowed in a <Location> block'.

    Can I no longer put a perl directive in a location block?
    Not anymore, no.

    Can you post a more detailled example of what you are trying to do?

    --
    Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
    http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/
    I'm basically pulling client options from our database and setting them in
    the conf file. What would the workaround be since this option has been
    removed?

    <Location />
    <Perl>
    my $config = Config::ApacheConfiguration->new();
    my @clientOptions = $config->GetClientConfiguration('5');
    push @PerlSetVar, @clientOptions;
    </Perl>
    </Location>
    Just moving out of the <location /> should work just fine, no?

    Otherwise, you can always do:

    <perl>
    $Location{'/'} =
    </perl>

    To inject configuration for that location.


    --
    Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
    http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/
  • Kgerbasi at Jan 25, 2008 at 4:51 pm

    Philippe M. Chiasson wrote:



    kgerbasi wrote:

    Philippe M. Chiasson wrote:
    kgerbasi wrote:
    I am currently upgrading our Apache server from 1.3 to 2.2 and I'm
    encountering the following error when I try to start Apache. The config
    works ok in 1.3, however in 2.2 I get the following error 'Perl
    directive
    not allowed in a <Location> block'.

    Can I no longer put a perl directive in a location block?
    Not anymore, no.

    Can you post a more detailled example of what you are trying to do?

    --
    Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
    http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/
    I'm basically pulling client options from our database and setting them
    in
    the conf file. What would the workaround be since this option has been
    removed?

    <Location />
    <Perl>
    my $config = Config::ApacheConfiguration->new();
    my @clientOptions = $config->GetClientConfiguration('5');
    push @PerlSetVar, @clientOptions;
    </Perl>
    </Location>
    Just moving out of the <location /> should work just fine, no?

    Otherwise, you can always do:

    <perl>
    $Location{'/'} =
    </perl>

    To inject configuration for that location.


    --
    Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
    http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/


    I have many <Location> blocks within a <VirtualHost> block so I can't move
    it out. I can use the $Location way but I simply liked the ease of reading
    the config file the way I did it in v1.3 of Apache.

    Do you need to declare everything in the $Location or can you use it to
    append to the existing <Location> block thats been written out using tags.


    Thanks,
    Kevin


    --
    View this message in context: http://www.nabble.com/Perl-directive-not-allowed-in-a-Location-block-tp15074701p15091925.html
    Sent from the mod_perl - General mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupmodperl @
categoriesmodperl, perl
postedJan 24, '08 at 8:51p
activeJan 25, '08 at 4:51p
posts5
users2
websiteperl.apache.org

2 users in discussion

Kgerbasi: 3 posts Philippe M. Chiasson: 2 posts

People

Translate

site design / logo © 2021 Grokbase