"Your request path is '/' and it doesn't match your Location(Match)" error

275 views
Skip to first unread message

meet...@gmail.com

unread,
Sep 9, 2013, 5:01:47 AM9/9/13
to psgi-...@googlegroups.com
Hello!
I use Apache + mod_perl 2 + Plack::Handler::Apache2 in .htaccess:

SetHandler perl-script
PerlResponseHandler Plack::Handler::Apache2
PerlSetVar psgi_app /home/user/vhosts/test.org/app.psgi

and I get an error in apache log:

Your request path is '/' and it doesn't match your Location(Match) '/home/user/vhosts/test.org/'. This should be due to the configuration error. See perldoc Plack::Handler::Apache2 for details.

Ævar Arnfjörð Bjarmason

unread,
Sep 9, 2013, 5:48:04 AM9/9/13
to psgi-...@googlegroups.com
Well, have you looked at that perldoc and checked out how your
configuration doesn't match the example given etc?

meet...@gmail.com

unread,
Sep 9, 2013, 6:16:18 AM9/9/13
to psgi-...@googlegroups.com
Yes, but these directives are supported in the .htaccess file. I think there is a possibility to use this handler in the .htaccess file. For example, to add a variable is_htaccess yes:

SetHandler perl-script
PerlResponseHandler Plack::Handler::Apache2
PerlSetVar psgi_app /home/user/vhosts/test.org/app.psgi
PerlSetVar is_htaccess yes

and check in Plack::Handler::Apache2 this variable. If it is set to 'yes', $location equal to do '/'.

понедельник, 9 сентября 2013 г., 12:48:04 UTC+3 пользователь Ævar Arnfjörð Bjarmason написал:

Ævar Arnfjörð Bjarmason

unread,
Sep 9, 2013, 6:23:03 AM9/9/13
to psgi-...@googlegroups.com
On Mon, Sep 9, 2013 at 12:16 PM, <meet...@gmail.com> wrote:
> Yes, but these directives are supported in the .htaccess file. I think there
> is a possibility to use this handler in the .htaccess file. For example, to
> add a variable is_htaccess yes:
>
> SetHandler perl-script
> PerlResponseHandler Plack::Handler::Apache2
> PerlSetVar psgi_app /home/user/vhosts/test.org/app.psgi
> PerlSetVar is_htaccess yes
>
> and check in Plack::Handler::Apache2 this variable. If it is set to 'yes',
> $location equal to do '/'.

I didn't write this code in Plack::Handler::Apache2, but the logic
seems to me to be there because you *must* specify a <Location> of
some sort.

What's your .htaccess example with "is_htaccess" supposed to do when
you have two .htaccess files like that in:

$root/foo/.htaccess
$root/bar/.htaccess

Is the app supposed to serve up /foo/ and /bar/ for those two paths?
Should both serve up "/"? Something else.

I think this is the problem you're running into. You're trying to
serve the app up without specifying a location at all.

So why not just specify it?

> понедельник, 9 сентября 2013 г., 12:48:04 UTC+3 пользователь Ævar Arnfjörð
> Bjarmason написал:
>>
>> On Mon, Sep 9, 2013 at 11:01 AM, <meet...@gmail.com> wrote:
>> > Hello!
>> > I use Apache + mod_perl 2 + Plack::Handler::Apache2 in .htaccess:
>> >
>> > SetHandler perl-script
>> > PerlResponseHandler Plack::Handler::Apache2
>> > PerlSetVar psgi_app /home/user/vhosts/test.org/app.psgi
>> >
>> > and I get an error in apache log:
>> >
>> > Your request path is '/' and it doesn't match your Location(Match)
>> > '/home/user/vhosts/test.org/'. This should be due to the configuration
>> > error. See perldoc Plack::Handler::Apache2 for details.
>>
>> Well, have you looked at that perldoc and checked out how your
>> configuration doesn't match the example given etc?
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "psgi-plack" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to psgi-plack+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

meet...@gmail.com

unread,
Sep 9, 2013, 6:39:07 AM9/9/13
to psgi-...@googlegroups.com
In the .htaccess file are not supported by the <Location>. I use a shared-hosting and have access only to the file .htaccess

понедельник, 9 сентября 2013 г., 13:23:03 UTC+3 пользователь Ævar Arnfjörð Bjarmason написал:

Ævar Arnfjörð Bjarmason

unread,
Sep 9, 2013, 6:46:11 AM9/9/13
to psgi-...@googlegroups.com
On Mon, Sep 9, 2013 at 12:39 PM, <meet...@gmail.com> wrote:
> In the .htaccess file are not supported by the <Location>. I use a
> shared-hosting and have access only to the file .htaccess

Makes sense. It shouldn't be too hard to get .htaccess support working.

But to do so you can't just say "I'm being served from a .htaccess
file". You have to give the handler info about what you expect the
base path to be. I.e. if you serve your app from:

/var/www/example.com/subdir/

Do you expect a request to:

/subdir/

To serve up "/" or "/subdir" from the perspective of the PSGI app?

You can easily provide variables to resolve this ambiguity in the
Apache2 handler, right now we rely on the location directive to do so.

But you have to resolve the ambiguity, you can't just say "yes, serve
it up via .htaccess", you have to provide how the path mapping should
happen.

meet...@gmail.com

unread,
Sep 9, 2013, 7:13:59 AM9/9/13
to psgi-...@googlegroups.com
In this case, you can create a variable location_app:

PerlSetVar location_app '/var/www/example.com/'

If this variable is set, as a way to set the value of this variable, otherwise use the value of <Location>

понедельник, 9 сентября 2013 г., 13:46:11 UTC+3 пользователь Ævar Arnfjörð Bjarmason написал:
Reply all
Reply to author
Forward
0 new messages