Hi Scott
what happens if you place a index.html file in the DocumentRoot and
access it with http://.../index.html? A 404 error usually takes place
before mod_rivet is even invoked because is an error that arises as part
of the work the resource access, identification and authorization
modules do.
A working example for the request handler is in the repository
$(srcdir)/rivet/default_request_handler.tcl and it's installed with
'make install' wherever you told --prefix or --with-rivet-target-dir to
install the rivet stuff. Basically any script can work as default
handler provided it's doing what you want it to do. Any application
driven by urlencoded arguments don't need to load the referenced script
(generally index.rvt) but if you want to run scripts the traditional way
you have to eval [::rivet::url_script] somewhere
see
https://github.com/apache/tcl-rivet/blob/master/rivet/default_request_handler.tcl
Another question: what are meant for the braces around the file names in
RivetServerConf lines?
-- Massimo
On 3/10/26 14:04, Scott Pitcher wrote:
Hi,
I'm writing a test framework for a website that runs under Rivet. I'm
specified a Tcl script as the target of RequestHandler, but that script
does not seem to be invoked.
RivetServerConf RequestHandler "/home/Shares/Engineering/Web/rivet-
www-base/source/index.tcl"
I know the path is correct because I get crit errors in the error log if
I change to something that doesn't exist.
I know the script will run under rivet because I copied it over to the
document root and with Lynx I access URL .../index.tcl and it comes up
with the log message and the 500 response that the script returns (as a
test).
But accessing http://.../ just returns a 404 with the text "The request
URL was not found on this server."
Nothing in the logs and the log message the script will record, never
appears in the log.
My test apache.conf is:
# Apache test configuration sample simpleindex at Tue Mar 10 23:37:39
AEDT 2026
ServerRoot "/home/Shares/Engineering/Web/rivet-www-base/tmp"
PidFile "/home/Shares/Engineering/Web/rivet-www-base/tmp/apache.pid"
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-
Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}
i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog "/home/Shares/Engineering/Web/rivet-www-base/tmp/logs/
access.log" common
ErrorLog "/home/Shares/Engineering/Web/rivet-www-base/tmp/logs/error.log"
Listen 20080
LoadModule authz_core_module /usr/lib/apache2/modules/mod_authz_core.so
LoadModule authz_host_module /usr/lib/apache2/modules/mod_authz_host.so
LoadModule dir_module /usr/lib/apache2/modules/mod_dir.so
LoadModule mime_module /usr/lib/apache2/modules/mod_mime.so
LoadModule negotiation_module /usr/lib/apache2/modules/mod_negotiation.so
LoadModule rivet_module /usr/lib/apache2/modules/mod_rivetsvpts240102.so
LoadModule mpm_prefork_module /usr/lib/apache2/modules/mod_mpm_prefork.so
RivetServerConf MpmBridge prefork
RivetServerConf SeparateVirtualInterps no
<IfModule mod_mime.c>
TypesConfig /etc/mime.types
</IfModule>
<IfModule mod_rivet.c>
AddType application/x-httpd-rivet .rvt
AddType application/x-rivet-tcl .tcl
</IfModule>
RivetServerConf ChildInitScript "source {/home/Shares/Engineering/Web/
rivet-www-base/source/serverinit.tcl}"
RivetServerConf RequestHandler "/home/Shares/Engineering/Web/rivet-
www-base/source/index.tcl"
<VirtualHost localhost:20080>
DocumentRoot "/home/Shares/Engineering/Web/rivet-www-base/samples/
simpleindex"
ServerName sample_simpleindex
RivetServerConf ChildInitScript "source {/home/Shares/Engineering/
Web/rivet-www-base/samples/simpleindex/childinit.tcl}"
RivetServerConf RequestHandler "/home/Shares/Engineering/Web/
rivet-www-base/source/index.tcl"
CustomLog "/home/Shares/Engineering/Web/rivet-www-base/tmp/logs/
access.log" common
<Directory "/home/Shares/Engineering/Web/rivet-www-base/samples/
simpleindex">
Options All Indexes MultiViews
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
I'm running Debian 12 on this sever and it's Rivet module doesn't appear
to have the Rivet_RawPost patch applied yet, so I have to run my own
patched. I compiled that from source back on 2nd Jan 2024.
Debian 12 has -
libapache2-mod-rivet-doc/oldstable,now 3.2.2-1 all [installed]
libapache2-mod-rivet/oldstable,now 3.2.2-1 amd64 [installed]
My production Rivet web server is different and there I have a rule to
rewrite _all_ requests and forward to the index.tcl script, and that's
worked fine for a long time. But I thought that this RequestHandler
directive would do the same thing but without needing any rewriting.
I've probably read the documentation incorrectly (https://
tcl.apache.org/rivet/manual3.2/processing.html). I did look for a
working example of RequestHandler but I can't see anything there in the
tcl-rivet source.
Could you please shed some light on this and perhaps show a working
example of the RequestHandler directive?
Kind regards,
Scott
--
+-----------------------------------------------------------------------------+
|...will make the wilderness a pool of water, the dry land springs of water...|
+-----------------------------------------------------------------------------+
| Scott [email protected] |
| +61-3-9008-5695 (B) SVP Technical Services |
|PGP:https://gnupg.org/ ABN 79 220 496 603 |
|KEY:https://pgp.mit.edu/pks/lookup?op=vindex&search=0xEDBE43639EFD884D |
+-----------------------------------------------------------------------------+
DISCLAIMER:
The content of this email is confidential and strictly intended only for the
recipient(s) specified in the message. If you have received this message by
mistake it is strictly forbidden to keep this email in any form, electronic
or hard copy, or to share any part of it with any one else, without the prior,
written consent of the author. If you have received this message by mistake,
please let me know by replying to this email, and then destroy it and any
copies.
SECURITY:
I prefer to send and receive confidential messages protected by PGP public
key encryption. If you are willing to or are interested in protecting our
email communication with PGP encryption, please refer tohttps://gnupg.org/.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]