Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Hello I have some troubles with query strings in SSI includes.

Apache 2.2 mpm-prefork + mod_perl + SSI enabled

Apache2 configuration:

cat apache2.conf
......
AddType text/html .shtml .html .htm
AddOutputFilter INCLUDES .shtml .html .htm
Options +Includes
XBitHack Full
......

apache2ctl -M 2>&1 | grep include
include_module (shared)

Test script:

chmod a+x /var/www/test.html
cat /var/www/test.html
1 <!--#include virtual="/soma-path/script.pl" -->
2 <!--#include virtual="/some-path/script.pl?param=1" -->

Result:

curl localhost:8081/test.html
SCRIPT_RESULT
SCRIPT_RESULT_WITH_PARAM_1

That's ok.

Problem appears when I'm swapping first and second lines in the script:

cat /var/www/test.html
1 <!--#include virtual="/soma-path/script.pl?param=1" -->
2 <!--#include virtual="/some-path/script.pl" -->

Bad result:

curl localhost:8081/test.html
SCRIPT_RESULT_WITH_PARAM_1
SCRIPT_RESULT_WITH_PARAM_1

So I'm getting two equal results with param=1 instead of two different results. What's the problem? I've tried to change 'XBitHack Full' -> 'XBitHack On'. Same result. Maybe I need to use mod_expires?

share|improve this question
    
That looks like a threading issue to me. param is set on the first call, and since the same perl is used to run the second call, it's still set. –  malcolmpdx Mar 31 '11 at 16:58
    
The same result is for mpm-worker and mpm-prefork. –  irolla Mar 31 '11 at 20:11
    
I'm sorry, I wasn't clear. Since you're using mod_perl, unless you explicitly clear state on each invocation, variables will continue with values from the previous invocation. –  malcolmpdx Mar 31 '11 at 21:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.