Forum OpenACS Q&A: VAT Module

Collapse
Posted by Samer Abukhait on
I applied tom's VAT module as in instructions exactly, and currently 
the virtual hosts give me nothing on web.

The logs giving me correct setup (I guess) but it breaks somewhere in 
Template(version), looking for a current in my virtual host 
directory !


Am I doing something wrong or what shall be the fix?

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: Initializing 
Virtual Abstract Templating System

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: Setting Template 
Filter Methods to GET, POST and HEAD

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: Global Template 
Vars: server version module name

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: Virtual Host Root 
is '/web/portal/vhost'

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: default handler 
proc is: 'vat_default_handler'

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: adp handler proc 
is: 'vat_adp_handler'

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: tcl handler proc 
is: 'vat_tcl_handler'

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: html handler proc 
is: 'vat_adp_handler'

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: Mapping 
host 'v1.birzeit.edu' to server 'server1'

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: Mapping 
host 'v2.birzeit.edu' to server 'server2'

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: Processing 
*:server1

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: GET:server1 --
> /web/portal/vhost/server1/www

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: POST:server1 --
> /web/portal/vhost/server1/www

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: HEAD:server1 --
> /web/portal/vhost/server1/www

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: Processing 
*:server2

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: GET:server2 --
> /web/portal/vhost/server2/www

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: POST:server2 --
> /web/portal/vhost/server2/www

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: HEAD:server2 --
> /web/portal/vhost/server2/www

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: !!! 
ns_register_filter preauth  GET /* SetConn

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: !!! 
ns_register_filter preauth  POST /* SetConn

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: !!! 
ns_register_filter preauth  HEAD /* SetConn

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: !!! 
ns_register_filter postauth GET /* vhost_abstract_templates

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: !!! 
ns_register_filter postauth POST /* vhost_abstract_templates

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: !!! 
ns_register_filter postauth HEAD /* vhost_abstract_templates

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: Finished 
Registering Template Filters.

[21/Jul/2002:16:23:32][21444.1024][-main-] Notice: Finished 
Initializing Virtual Abstract Templating System

 

Every thing is ok till now, 2 servers set with 2 directories!


But when I entered the first server URL (v1.birzeit.edu) it gives me:

[21/Jul/2002:16:28:10][21527.4101][-conn0-] Debug: RP (4.848 ms): 
rp_filter: setting up request: GET / 

[21/Jul/2002:16:28:10][21527.4101][-conn0-] Debug: Security: Getting 
token_id 150, value 0E0CC7BEFBB1C6BAD2A62EF2CFB2366B2DCE6222

[21/Jul/2002:16:28:10][21527.4101][-conn0-] Debug: Security: 
Expire_Time is 1027259229 (compare to 1027258090), hash is 
4A9F8660F7A86E8D4D92DBC5732333374867D7E8

[21/Jul/2002:16:28:10][21527.4101][-conn0-] Debug: Security: Done 
calling get_cookie 624101,0 {150 1027259229 
4A9F8660F7A86E8D4D92DBC5732333374867D7E8} for ad_session_id; received 
1027259229 expiration, getting 624101,0 and 150 1027259229 
4A9F8660F7A86E8D4D92DBC5732333374867D7E8.

[21/Jul/2002:16:28:10][21527.4101][-conn0-] Debug: Template(host) set 
to v1.birzeit.edu

[21/Jul/2002:16:28:10][21527.4101][-conn0-] Debug: Pageroot for: 
GET:server1 set to /web/portal/vhost/server1/www

[21/Jul/2002:16:28:10][21527.4101][-conn0-] Debug: Method is GET

[21/Jul/2002:16:28:10][21527.4101][-conn0-] Debug: url 
is: /web/portal/vhost/server1/www/

[21/Jul/2002:16:28:10][21527.4101][-conn0-] Debug: No 
path: /web/portal/vhost/server1/current//index

[21/Jul/2002:16:28:10][21527.4101][-conn0-] Debug: arg is 
http://213.244.124.53/

[21/Jul/2002:16:28:10][21527.4101][-conn0-] Debug: ns_conn url is /

[21/Jul/2002:16:28:10][21527.4101][-conn0-] Notice: random: 
generating 1 seeds

 

it gives me correct result when trying a file under the server.. like 
(v1.birzeit.edu/index.html << this is working)

 

 

what shall I fix? Or what is this Template(version) and why it is 
looking to something under a directory named current!

 

 

I tried hopelessly to fix it, and gave up.

 

Here is my startup part for the VAT:

[ns/server/portal/module/vat]

VhostRoot=/web/portal/vhost

Precedence="[list tcl html adp htm]"

pageroot=/web/portal/www

default_handler=vat_default_handler

tcl_handler=vat_tcl_handler

html_handler=vat_adp_handler

adp_handler=vat_adp_handler

defaultServer=my.birzeit.edu

 

[ns/server/portal/module/vat/servermap]

v1.birzeit.edu=server1

v2.birzeit.edu=server2

 

[ns/server/portal/module/vat/maps]

*:server1=/web/portal/vhost/server1/www

*:server2=/web/portal/vhost/server2/www

 

 

Appreciated.
Collapse
2: Response to VAT Module (response to 1)
Posted by Samer Abukhait on
i converted my .ini startup file into a .tcl file,

ever thing went fine!

is there any document about the templating of this great VAT module?
Collapse
3: Response to VAT Module (response to 1)
Posted by Tom Jackson on

The templating works differently than in OpenACS. It was based on my needs for a db backed website that looked static, so search engines would gobble up the pages.

Once setup, a relative url of /mod/wheels would indicate the wheels template in the mod module. You could request this url on your server and see where the VAT module is looking for the file. If the VAT module doesn't find the directory, as in your example above, it continues on looking elsewhere, finally giving up and returning control to the next filter. Your example above was for /. Any request ending in / will search for an index file. The base directory for the search above was /web/portal/vhost/. 'server1' is the name of you gave your server variable set in the VAT module section of your .tcl file, and 'current' is the version variable, which gets set on each request. This is just hard coded as 'current' until you rewrite the tcl proc that sets it. If you create a simple version system where you keep different versions of a website in different directories, 'current' would usually be a symbolic link to the actual version in use. The module name is the first subdirectory in a website. in /mod/wheels, for instance, 'mod' is the module name. in your request for /, the module name is the empty string ''. Putting all this togeather explains why you got the 'No Path' debug statement:

Debug: No path: /web/portal/vhost/server1/current//index

This means $base$server/$version/$module/$template.

If you were to create files like:

/web/portal/vhost/server1/current/mod/index/index-01.tcl
/web/portal/vhost/server1/current/mod/index/index-02.adp
and request /mod/, then the VAT module would process the .tcl and the the .adp in the same tcl level, returning the result.