Getting cgi.REDIRECT_* variables when using mod_cfml

524 views
Skip to first unread message

Andrew Dixon

unread,
Feb 7, 2015, 5:21:52 AM2/7/15
to lu...@googlegroups.com
Hi All,

I know this is something that has come up before, however I've just come across it again and was wondering if anyone ever managed to solve it. 

When using mod_cfml as a connector between Apache and Tomcat some of the cgi variables, particular the REDIRCET_* variables go missing, for example cgi.REDIRECT_URL. An example of when this variable would normally exist is when using the ErrorDocument directive in Apache, for example:

ErrorDocument 404 /404.cfm

and then in 404.cfm you could access the original URL, e.g. /this_new_page from the cgi.REDIRECT_URL variable. Using mod_jk you can add in some JkSetEnv to pass them through, however in this case the server is already configured using mod_cfml, with many sites already on it and we can't really change to using mod_jk at this point. 

Is there something similar to the JkSetEnv that can be done with mod_cfml to pass these variables across to Tomcat / Lucee?

Thanks.

Kind regards,

Andrew

Alex Skinner

unread,
Feb 7, 2015, 5:32:22 AM2/7/15
to lu...@googlegroups.com

If it was me I wouldn't use mod_cfml in production had two many instances of wrong context being shown randomly.

But are you sure this is related to mod_cfml if u manually determine your host config in server. XMLdoes it make a difference?

A

Sent from my phone

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/CAG1WijUZjJc90PbpdkTqcMWXWBFDm9K%2Bb_Hx4y7JcMDkn7_0DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Dixon

unread,
Feb 7, 2015, 5:37:41 AM2/7/15
to lu...@googlegroups.com
Not really had any issues with the wrong context being shown and it does mean you can add new context's without having to restart, unless there is a way to do this with mod_jk that I'm not aware of.

Hmmm... good point, will give that a try on my dev machine and see what happens.

Kind regards,

Andrew

Andrew Dixon

unread,
Feb 7, 2015, 5:59:04 AM2/7/15
to lu...@googlegroups.com
Didn't seem to make any difference defining the context in the server.xml file.

Kind regards,

Andrew

Jordan Michaels

unread,
Feb 9, 2015, 3:29:57 PM2/9/15
to lu...@googlegroups.com
It's important to understand that mod_cfml is not a connector in itself. At this point it's just a simple helper application. Your actual "connector" is going to be mod_proxy_html, mod_proxy_ajp, or mod_jk. It's likely the issue you're experiencing has to do with your connector type and how HTTP headers are passed to Tomcat through the specific connector. Further, it's important to understand that these different connector methods use different protocols to communicate with Tomcat. mod_proxy_html uses HTTP and mod_proxy_ajp and mod_jk use AJP. The default connector that's installed if you used the Railo Installers is mod_proxy_http, which is a more simplistic protocol then AJP, but also more readily available on all systems.

Andrew, if I were in your place I would research the different connector methods/protocols and see if either of them have ways to pass the variables you're wanting to pass.

Kind regards,
Jordan Michaels
>> <https://groups.google.com/d/msgid/lucee/CAG1WijUZjJc90PbpdkTqcMWXWBFDm9K%2Bb_Hx4y7JcMDkn7_0DQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Lucee" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lucee+un...@googlegroups.com.
> To post to this group, send email to lu...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lucee/CAFrbJ5XwgE8_BZYYqz0JiBcsDp2oe7vGvtULnmcGCW-VwieZuw%40mail.gmail.com
> <https://groups.google.com/d/msgid/lucee/CAFrbJ5XwgE8_BZYYqz0JiBcsDp2oe7vGvtULnmcGCW-VwieZuw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/CAG1WijVxpqAG6WcSRFV_c8FjBTOF1FYqiQdk_E%2BkUv_iw4aBqw%40mail.gmail.com.

Andrew Dixon

unread,
Feb 9, 2015, 6:31:51 PM2/9/15
to lu...@googlegroups.com
Hi Jordan,

In the httpd.conf file I have:

ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://localhost:8009/$1$2

am I right in thinking that this is using mod_proxy_ajp and the protocol on the URL is ajp://?


Kind regards,

Andrew

Gavin Pickin

unread,
Feb 9, 2015, 6:35:31 PM2/9/15
to lu...@googlegroups.com
Andrew, correct.
If you switch to http it uses a different module, I tested with ajp and http earlier and didn't see the variables in the cgi dump.

Although, I have 1 question.
If I dump CGI, is that only going to dump CGI that Lucee wants me to see?

I know with ColdFusion, you can access lower level items than what is shown when you just dump CGI.
Maybe if there is a way to see those “HIDDEN” CGI Vars, we could do more thorough testing.

Anyone have any ideas, or do I need to jump into the source?

Jordan Michaels

unread,
Feb 9, 2015, 7:07:19 PM2/9/15
to lu...@googlegroups.com
For some of those "hidden" variables, you can use GetHttpRequestData() to pull the HTTP request object directly. For example: GetHttpRequestData().headers['host']

I'm not sure how "ErrorDocument" is passed in the HTTP request, or if it's passed at all, but understanding how that works seems to be the key.

-Jordan
>> <javascript:>> wrote:
>>
>> > If it was me I wouldn't use mod_cfml in production had two many
>> instances
>> > of wrong context being shown randomly.
>> >
>> > But are you sure this is related to mod_cfml if u manually determine
>> your
>> > host config in server. XMLdoes it make a difference?
>> >
>> > A
>> >
>> > Sent from my phone
>> > On 7 Feb 2015 10:21, "Andrew Dixon" <andrew...@gmail.com <javascript:>>
>> >> email to lucee+un...@googlegroups.com <javascript:>.
>> >> To post to this group, send email to lu...@googlegroups.com
>> <javascript:>.
>> >> To view this discussion on the web visit
>> >>
>> https://groups.google.com/d/msgid/lucee/CAG1WijUZjJc90PbpdkTqcMWXWBFDm9K%2Bb_Hx4y7JcMDkn7_0DQ%40mail.gmail.com
>> >> <
>> https://groups.google.com/d/msgid/lucee/CAG1WijUZjJc90PbpdkTqcMWXWBFDm9K%2Bb_Hx4y7JcMDkn7_0DQ%40mail.gmail.com?utm_medium=email&utm_source=footer
>> >
>> >> .
>> >> For more options, visit https://groups.google.com/d/optout.
>> >>
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Lucee" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an
>> > email to lucee+un...@googlegroups.com <javascript:>.
>> > To post to this group, send email to lu...@googlegroups.com
>> <javascript:>.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/lucee/CAFrbJ5XwgE8_BZYYqz0JiBcsDp2oe7vGvtULnmcGCW-VwieZuw%40mail.gmail.com
>> > <
>> https://groups.google.com/d/msgid/lucee/CAFrbJ5XwgE8_BZYYqz0JiBcsDp2oe7vGvtULnmcGCW-VwieZuw%40mail.gmail.com?utm_medium=email&utm_source=footer
>> >
>> > .
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lucee" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to lucee+un...@googlegroups.com <javascript:>.
>> To post to this group, send email to lu...@googlegroups.com <javascript:>
>> .
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lucee/CAG1WijVxpqAG6WcSRFV_c8FjBTOF1FYqiQdk_E%2BkUv_iw4aBqw%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Lucee" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to lucee+un...@googlegroups.com <javascript:>.
>> To post to this group, send email to lu...@googlegroups.com <javascript:>
>> .
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lucee/1066754917.1213102.1423513793294.JavaMail.zimbra%40viviotech.net
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/de2bea11-132a-4449-9008-81719837fcaf%40googlegroups.com.

Gavin Pickin

unread,
Feb 9, 2015, 7:33:24 PM2/9/15
to lu...@googlegroups.com
With I get the following using GetHttpRequestData()
using HTTP with ProxyPassMatch I get the following

content
headers
accept
accept-encoding
accept-langage
connection
cookie
host
user-agent
x-forwarded-for
x-forwarded-host
x-forwarded-server
method
protocol

With AJP I get the following

content
headers
accept
accept-encoding
accept-langage
cache-control
connection
cookie
host
user-agent
method
protocol

So AJP has a cache-control header, but it is missing the following

x-forwarded-for
x-forwarded-host
x-forwarded-server

Note, no path or query string is visibly passed with an ErrorDocument 404 /404.cfm using this method.



Jordan Michaels

unread,
Feb 9, 2015, 7:43:21 PM2/9/15
to lu...@googlegroups.com
If it's not passed, then it's probably just used internally in Apache.
If that's the case, then you might need to configure Tomcat to only
handle a request if the requested resource is found. There's a config
for that... let me see if I can remember/find it...

Here we go:
resourceOnlyServlets

http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

I remember having to use this in the past for some similar reason... I
think it might have been so that Apache would produce an folder index??
I'm not sure, but that's the only reason I remember this option.

At the time, it prevented Tomcat from responding to a request that it
didn't need to. Perhaps it will work in your situation as well?

Warm Regards,
Jordan Michaels
> gpi...@gmail.com <mailto:gpi...@gmail.com>
> http://www.gpickin.com
>
>
>
> On Feb 9, 2015, at 4:07 PM, Jordan Michaels <jor...@viviotech.net
>>>> <http://pixl8.co.uk/>
>>>> <javascript:>> wrote:
>>>>
>>>>> If it was me I wouldn't use mod_cfml in production had two many
>>>> instances
>>>>> of wrong context being shown randomly.
>>>>>
>>>>> But are you sure this is related to mod_cfml if u manually determine
>>>> your
>>>>> host config in server. XMLdoes it make a difference?
>>>>>
>>>>> A
>>>>>
>>>>> Sent from my phone
>>>>> On 7 Feb 2015 10:21, "Andrew Dixon" <andrew...@gmail.com
>>>>> <http://gmail.com/><javascript:>>
>>>>>> <http://googlegroups.com/><javascript:>.
>>>>>> To post to this group, send email to lu...@googlegroups.com
>>>>>> <http://googlegroups.com/>
>>>>>> For more options, visithttps://groups.google.com/d/optout.
>>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>> Groups
>>>>> "Lucee" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an
>>>>> email to lucee+un...@googlegroups.com
>>>>> <http://googlegroups.com/><javascript:>.
>>>>> To post to this group, send email to lu...@googlegroups.com
>>>>> <http://googlegroups.com/>
>>>>> For more options, visithttps://groups.google.com/d/optout.
>>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups
>>>> "Lucee" group.
>>>> To unsubscribe from this group and stop receiving emails from it,
>>>> send an
>>>> email to lucee+un...@googlegroups.com
>>>> <http://googlegroups.com/><javascript:>.
>>>> To post to this group, send email to lu...@googlegroups.com
>>>> <http://googlegroups.com/><javascript:>
>>>> For more options, visithttps://groups.google.com/d/optout.
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups
>>>> "Lucee" group.
>>>> To unsubscribe from this group and stop receiving emails from it,
>>>> send an
>>>> email to lucee+un...@googlegroups.com
>>>> <http://googlegroups.com/><javascript:>.
>>>> To post to this group, send email to lu...@googlegroups.com
>>>> <http://googlegroups.com/><javascript:>
>>>> .
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/lucee/1066754917.1213102.1423513793294.JavaMail.zimbra%40viviotech.net
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Lucee" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to lucee+un...@googlegroups.com
>> <mailto:lucee+un...@googlegroups.com>.
>> To post to this group, send email to lu...@googlegroups.com
>> <mailto:lu...@googlegroups.com>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lucee/de2bea11-132a-4449-9008-81719837fcaf%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Lucee" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email tolucee+u...@googlegroups.com
>> <mailto:lucee+un...@googlegroups.com>.
>> To post to this group, send email tol...@googlegroups.com
>> <mailto:lu...@googlegroups.com>.
>> To view this discussion on the web
>> visithttps://groups.google.com/d/msgid/lucee/248147337.1213852.1423526832281.JavaMail.zimbra%40viviotech.net.
>> For more options, visithttps://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Lucee" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to lucee+un...@googlegroups.com
> <mailto:lucee+un...@googlegroups.com>.
> To post to this group, send email to lu...@googlegroups.com
> <mailto:lu...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lucee/F04DAD38-B238-4371-999C-AE91CEBCAE2D%40gmail.com
> <https://groups.google.com/d/msgid/lucee/F04DAD38-B238-4371-999C-AE91CEBCAE2D%40gmail.com?utm_medium=email&utm_source=footer>.

Andrew Dixon

unread,
Feb 10, 2015, 4:05:53 AM2/10/15
to lu...@googlegroups.com
Hi Gavin and Jordan,

Ok, I have made a small amount of progress here after much messing around with various things and just trying stuff out. In the .htaccess file if I have:

ErrorDocument 404 /404.cfm
RequestHeader set REDIRECT_URL 'hello'

and then in 404.cfm I have:

<cfdump var="#cgi.REDIRECT_URL#">

I get:

stringhello

If I then change the .htaccess "RequestHeader set" to:

RequestHeader set REDIRECT_URL %{REDIRECT_URL}e

I would then expect to get the right value but instead I get:

string(null)

I've checked and checked the syntax for picking up the Apache environment variables and from everything I can find that is the correct syntax. Also looking at this page from the Apache docs:


The REDIRECT_URL value should be defined. Very strange.

Any ideas?

Kind regards,

Andrew


To post to this group, send email to lu...@googlegroups.com
<mailto:lu...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/de2bea11-132a-4449-9008-81719837fcaf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google
Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send

To post to this group, send email tol...@googlegroups.com
<mailto:lu...@googlegroups.com>.
To view this discussion on the web
visithttps://groups.google.com/d/msgid/lucee/248147337.1213852.1423526832281.JavaMail.zimbra%40viviotech.net.
For more options, visithttps://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google
Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send
--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/54D95425.9040405%40viviotech.net.

Gavin Pickin

unread,
Feb 10, 2015, 4:47:51 AM2/10/15
to lu...@googlegroups.com
I did some research on this, and using AJP or HTTP doesn’t seem to path the right Headers through with ProxyPassMatch.

Although, I have 1 question.
If I dump CGI, is that only going to dump CGI that Lucee wants me to see? 

I know with ColdFusion, you can access lower level items than what is shown when you just dump CGI.
Maybe if there is a way to see those “HIDDEN” CGI Vars, we could do more thorough testing.

Anyone have any ideas, or do I need to jump into the source?

For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Gavin Pickin

unread,
Feb 10, 2015, 1:46:09 PM2/10/15
to lu...@googlegroups.com
I think we’re confusing some important aspects of this problem… although I could be wrong, and I might be. :)

Request Headers, Server Variables and Environment settings.

You set them and access them very differently… and it seems like Request Headers are being passed through, but only a limited set of CGI  Environment Variables are.
I also found something that said the ProxyPass is sometimes called BEFORE other settings are created… which isn’t helpful… but lets hope what I found gets around that.

The other thing we are forgetting is, there are 2 requests happening, and I believe, the variables are overwriting themselves.


From the Apache Docs

************************

To achieve this, Apache will define new CGI-like environment variables:

REDIRECT_HTTP_ACCEPT=*/*, image/gif, image/x-xbitmap, image/jpeg
REDIRECT_HTTP_USER_AGENT=Mozilla/1.1b2 (X11; I; HP-UX A.09.05 9000/712)
REDIRECT_PATH=.:/bin:/usr/local/bin:/etc
REDIRECT_QUERY_STRING=
REDIRECT_REMOTE_ADDR=121.345.78.123
REDIRECT_REMOTE_HOST=ooh.ahhh.com
REDIRECT_SERVER_NAME=crash.bang.edu
REDIRECT_SERVER_PORT=80
REDIRECT_SERVER_SOFTWARE=Apache/0.8.15
REDIRECT_URL=/cgi-bin/buggy.pl       

************************

Its not creating headers… its creating Environment Settings, so I wonder if we just need to create the request headers based on this?




Now, I have played a bunch… and this is what I found.

ErrorDocument 404 /404.cfm
SetEnvIf REQUEST_URI (.*) g=$1
SetEnvIf gHeader (.*) gg=$1
SetEnvIf ggHeader (.*) ggg=$1
RequestHeader set gHeader "%{g}e"
RequestHeader set ggHeader "%{gg}e”
RequestHeader set gggHeader "%{ggg}e"

excuse the gs… testing.
Basically, on the first request, 

we look for REQUEST_URI and store it in g environment variable and gHeader header
We look for gHeader which doesn’t exist.. set that as gg envar and ggHeader header
We look for ggHeader which doesn’t exist.. set that as ggg envar and gggHeader header

Next request, we should set that gHeader now exists, so we can populate ggHeader

There is no third request, so we don’t see any more trickle down.


So, if we request /gavin.htm doesn’t exist… we see this in the dump.

gggHeader
string
ggHeader
string /gavin.htm
gHeader
string /404.cfm

So, basically, to pass information through, we need to set 2 headers.. so we don’t overwrite ourselves.
The interesting thing is… I cannot get any of the environment variables to show up, on the first or 2nd request.

The method SetEnvIf looks for a header, but it doesn’t set headers, it sets environment settings right? 
SetEnvIf REQUEST_URI (.*) g=$1


So you would think this would work.

SetEnvIf gHeader (.*) gg=$1
SetEnvIf ggHeader (.*) ggg=$1
RequestHeader set gHeader “%{REDIRECT_URI}e"
RequestHeader set ggHeader "%{gg}e”
RequestHeader set gggHeader "%{ggg}e"

gggHeader
string
ggHeader
string (null)
gHeader
string (null)


I tried several of these error variable, REDIRECT_URI and REDIRECT_URL

It looks like although Apache might set the environment variables, I can’t access them in the first attempt, or second attempt… at least not when I’m trying to write headers.


So solution? 
Maybe set a trickle header affect for each of the variables we care about in the 404.
It seems to work, but its our hack, not the way we assumed apache would work.

Although, not everything passes through. I can’t play much longer right now, so I’ll let you know where I ended up.

It mentions mod_jk and how you can access this information like this 

 <cfdump var="#getPageContext().getRequest().getOriginalRequest().getAttribute('REMOTE_ADDR')#">

That always was empty:null for me.
But, if you dump the getOriginalRequest you can see a list of methods, and the direct methods work, but I couldn’t get the getAttribute to work, even for Remote_Addr or remote_host etc.

I looped through the getHeadernames() function, and the original headers were not available… so, it looks like we’ll have to hack our own solution.


Of course, I couldn’t get every variable to pass through… for example, query_string, trying to pull from headers and environment variables, i had no luck.
I will try later, but if anyone else wants to look into it, I hope my ramblings might help





To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.

Tom Chiverton

unread,
Apr 27, 2015, 8:22:27 AM4/27/15
to lu...@googlegroups.com

On Saturday, February 7, 2015 at 10:21:52 AM UTC, Andrew Dixon wrote:
Hi All,

I know this is something that has come up before, however I've just come across it again and was wondering if anyone ever managed to solve it. 

When using mod_cfml as a connector between Apache and Tomcat some of the cgi variables, particular the REDIRCET_* variables go missing, for example cgi.REDIRECT_URL. An example of when this variable would normally exist is when using the ErrorDocument directive in Apache, for example:

What I have just done is based on
https://groups.google.com/d/msg/railo/U9TSv3L4j94/ASz-2JQD29wJ
Sorry for the late reply, but I'm just now migrating some sites that used the CGI scope.

So in tomcat/conf/web.xml add
<filter>
  <filter-name>RemoteIpFilter</filter-name>
  <filter-class>org.apache.catalina.filters.RemoteIpFilter</filter-class>
</filter>

<filter-mapping>
  <filter-name>RemoteIpFilter</filter-name>
  <url-pattern>/*</url-pattern>
  <dispatcher>REQUEST</dispatcher>
</filter-mapping>

and then cgi.remote_addr and  remote_host take their values from what Apache saw, not what Tomcat saw.

Tom

Paul Klinkenberg

unread,
May 1, 2015, 3:12:50 PM5/1/15
to lu...@googlegroups.com, pa...@lucee.nl
Hi Gavin,

The way I solved it, is by using mod_jk, together with the following httpd settings in httpd.conf:

--------------------start--------------------------
# Load mod_jk module, if not yet loaded
<IfModule !jk_module>
    LoadModule jk_module modules/mod_jk.so
</IfModule>

# Where to find workers.properties
JkWorkersFile modjk/workers.properties
# Where to put jk shared memory
JkShmFile modjk/mod_jk.shm
# Where to put jk logs
JkLogFile modjk/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Make sure Apache httpd redirect headers are sent through to Tomcat
JkEnvVar REDIRECT_URL ""
JkEnvVar REDIRECT_REMOTE_HOST ""
JkEnvVar REDIRECT_PATH ""
JkEnvVar REDIRECT_QUERY_STRING ""
JkEnvVar REDIRECT_HTTP_ACCEPT ""
JkEnvVar REDIRECT_HTTP_USER_AGENT ""
JkEnvVar REDIRECT_REMOTE_ADDR ""
JkEnvVar REDIRECT_SERVER_NAME ""
JkEnvVar REDIRECT_SERVER_PORT ""
JkEnvVar REDIRECT_SERVER_SOFTWARE ""

# Send every request for .cfm and .cfc files to tomcat
JkMount /*.cfm worker1
JkMount /*.cfc worker1
JkMount /index.cfm/* worker1
# These SES links do not work by default on tomcat :-/
#JkMount /*.cfm/* worker1
#JkMount /*.cfc/* worker1
# Send every request for blazeDS to tomcat
JkMount /flashservices/gateway* worker1
JkMount /messagebroker* worker1
JkMount /flex2gateway* worker1
JkMount /openamf/gateway* worker1

## This setting makes sure that the above JK settings are propagated into all virtual hosts
JkMountCopy All
---------------------end-------------------------

Content of my workers.properties (running on OSX):
--------------------start--------------------------
workers.tomcat_home=/usr/local/Cellar/tomcat/8.0.21
workers.java_home=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=127.0.0.1
worker.worker1.port=8009
worker.worker1.socket_timeout=300
worker.worker1.ping_mode=A
ping_timeout=2000
connection_pool_timeout=50
---------------------end-------------------------

This was the _only_ way I could get these redirect_* headers to work, and I have put about 4 full days of research in this.

Kind regards,

Paul Klinkenberg


Reply all
Reply to author
Forward
0 new messages