FastCGI, Trailing Slashes

I just installed rt-2.0.13 with fastcgi (whatever was stable last
week). It’s quite good, but I’m noticing some behavior that wasn’t
there with mod_perl.

I’ve put a number of new non-standard directories in my local
mason component root. I use these to provide a mnemonic URL via
which the admins of various queues can access their custom queue
listings. So, accordingly, I create the directories and touch
the index.html files in the standard component root.

So, I can go to http://rt.wherever.com/myqueue/ and that works
great. However, if I remove the trailing slash, I have a problem.
Instead of the page I’m suspecting, I simply get a text message
error:

“could not find component for initial path ‘/myqueue’”

This didn’t happen with my installation of mod_perl and rt-2.0.9.
It Just Worked.

I’ve looked around the RT and apache configs, searched masonhq.com,
as well as searched newsgroups and various mailing lists (including
this one). But I haven’t found any clues.

Does anyone have experience with this problem? Ideally, you would
tell me I’ve simply incorrectly configured one variable… as
opposed to telling me it won’t work at all. :slight_smile:

Thanks,
Matt

So, I can go to http://rt.wherever.com/myqueue/ and that works
great. However, if I remove the trailing slash, I have a problem.
Instead of the page I’m suspecting, I simply get a text message
error:

“could not find component for initial path ‘/myqueue’”

I’m not sure how the myqueue/ part is implemented, but I had this
problem with http://www.wherever.com/rt not working, but /rt/ working.

I had:

ScriptAlias /rt /opt/rt2/bin/mason_handler.fcgi

I wanted:

ScriptAlias /rt /opt/rt2/bin/mason_handler.fcgi/

This required:

— rt-orig/webrt/autohandler Wed May 1 11:19:39 2002
+++ rt-esmith/webrt/autohandler Wed May 1 11:59:57 2002
@@ -6,7 +6,7 @@
$m->{‘rt_base_time’} = time;

#if it’s a noauth file, don’t ask for auth.
-if ($m->base_comp->path =~ ‘^/NoAuth/’) {
+if ($m->base_comp->path =~ ‘^/+NoAuth/’) {
$m->call_next();
$m->abort();
}

Hope that helps,

-Rich

Rich Lafferty --------------±----------------------------------------------
Ottawa, Ontario, Canada | Save the Pacific Northwest Tree Octopus!
http://www.lafferty.ca/ | http://zapatopi.net/treeoctopus.html
rich@lafferty.ca -----------±----------------------------------------------

Yes, that’s very much along the same lines, but I’ve been unable to
make the connection from the ScriptAlias line over to myqueue/.

Also, what is the effect your autohandler patch?

Thanks,
Matt

Rich Lafferty writes:

Yes, that’s very much along the same lines, but I’ve been unable to
make the connection from the ScriptAlias line over to myqueue/.

Unless there are people lurking with the secret of myqueue/ that know
the answer to this but are waiting some unspecified time to come out
with it, you’ll need to tell me where myqueue/ is coming from. :slight_smile:

Also, what is the effect your autohandler patch?

If you have

ScriptAlias /rt /opt/rt2/bin/mason_handler.fcgi/

then

http://www/rt -> /opt/rt2/bin/mason_handler.fcgi/

which is good, but

http://www/rt/ -> /opt/rt2/bin/mason_handler.fcgi//

which is indifferent and

http://www/rt/NoAuth/default.css ->
/opt/rt2/bin/mason_handler.fcgi//NoAuth/default.css

at which point $m->base_comp->path is “//NoAuth/default.css”, which
doesn’t match ‘^/NoAuth/’, but does match ‘^//NoAuth/’. It’s already
in 2.0.14, I believe.

-Rich

Rich Lafferty --------------±----------------------------------------------
Ottawa, Ontario, Canada | Save the Pacific Northwest Tree Octopus!
http://www.lafferty.ca/ | http://zapatopi.net/treeoctopus.html
rich@lafferty.ca -----------±----------------------------------------------

Rich Lafferty writes:

Unless there are people lurking with the secret of myqueue/ that know
the answer to this but are waiting some unspecified time to come out
with it, you’ll need to tell me where myqueue/ is coming from. :slight_smile:

Ok, sorry it wasn’t clearer earlier.

A number of groups use the RT installation at my site in very different
ways. For example, my group uses one queue for work requests and
another queue for knowledge-base/project-status-tracking, while another
group uses theirs only for process enforcement, and another group uses
theirs for both process enforcement (approvals to requests) and the
requests themselves. Why this matters to this discussion is that they
all want to see different information when they go to view their
queue. Therefore, using Search/Listing.html and the WebOptions from
config.pm is insufficient because that is site-wide.

The relatively easy alternative was to give each queue (i.e. QueueX,
QueueY, QueueZ) their own queue listing file. This resulted in
http://rt.mysite.com/QueueX/ and http://rt.mysite.com/QueueY/ . The
index.html files in these directories include the HTML and component
calls to display the queues for QueueX and QueueY, respectively, with
the queue-specific ticket information they want to see.

To try and stay organized and sane, I am attempting to keep all HTML
localizations in my local component root. If I do this and have
/opt/rt2/local/WebRT/html/QueueX/, I must also create
/opt/rt2/WebRT/html/QueueX/ and /opt/rt2/WebRT/html/QueueX/index.html.

Under my previous installation (using apache, mod_perl, and rt-2.0.9),
I was able to successfully reference either http://rt.mysite.com/QueueX
or http://rt.mysite.com/QueueX/ . Under my new installation (using
apache, fastcgi, and rt-2.0.13), this isn’t working. I always have to
have the trailing slash.

That may be more info than you care about (sorry!), but I hope that
makes more sense.

Thanks,
Matt

Just some additional information for the record…

It’s kind of still not fixed, though I have a workaround.

I don’t think I had done enough searching in regards to apache in
this. I mostly paying attention to mason coupled with fastcgi.

Upon searching more for apache-related solutions, I found some
suggestions about turning off UseCanonicalName or correctly
setting the ServerName directives. But, neither of these things
were helpful. I learned a little about mod_dir.

My eventual workaround solution was to use mod_alias to redirect
to the trailing slash path, like so:

RedirectMatch ^/myqueue$ /myqueue/

This is crappy because I have to add a line to httpd.conf and then hup
apache each time I add a new directory. It’s kind of my fault for
using a static architecture, but it’s frustrating because it works in
my previous installation.

If I find out what’s going on otherwise, I’ll follow-up.

Thanks,
Matt

Matt Disney writes: