Forum OpenACS Q&A: Response to Support for multibyte: .tcl ok .adp not

Hi Henry,

I am using 3.2.5 with your patches, 3.3.1+ad12 version of AOLserver.

I *think* the problem is in the part where the template is returned. I have modified ad-style.tcl per Kenny Chiang's message above. I have tried both ns_adp_parse -string and ns_adp_eval -parser fancy in the ad_return_template proc definition, both give the same result.

You can see the error message at http://205.247.253.66/ecommerce .

In my server.log, I see

[28/Sep/2001:14:28:18][23963.6798848][-conn44-] Notice: ns_getform using encoding shiftjis for charset shift_jis

followed by the error messages.

My nsd.tcl config file (passwords and comments removed for brevity):

ns_log notice "nsd.tcl: starting to read config file..."

set httpport               80
set httpsport             443 

set hostname            205.247.253.66 

set address              205.247.253.66 


set server                 "server1" 
set servername             "somewhere.ne.jp"


set homedir                 [file dirname [ns_info config]]
set bindir                  [file dirname [ns_info nsd]] 

set pageroot                /home/akira/openacs-3.2.5/www
set directoryfile           index.adp,index.html,index.tcl,index.htm

set sslkeyfile ${homedir}/servers/${server}/modules/nsssl/keyfile.pem

set sslcertfile ${homedir}/servers/${server}/modules/nsssl/certfile.pem 

ns_section "ns/parameters" 
        ns_param   home         $homedir 
        ns_param   debug        false 
        ns_param   MailHost     localhost
        ns_param   ServerLog    ${homedir}/log/server.log 
        ns_param   LogRoll      on
        ns_param   maxthreads 20
        #ns_param  minthreads 7 

        ns_param   HackContentType 1
        ns_param   URLCharset      shift_jis
        ns_param   OutputCharset   shift_jis
        ns_param   HttpOpenCharset shift_jis


ns_section "ns/threads" 
ns_param   mutexmeter      true      ;# measure lock contention 
ns_param   stacksize [expr 128*1024] ;# Per-thread stack size for hungry C modules

ns_section "ns/mimetypes" 
        ns_param   default         "*/*"     ;# MIME type for unknown extension 
        ns_param   noextension     "*/*"     ;# MIME type for missing extension 
        #ns_param   ".xls"         "application/vnd.ms-excel''
        ns_param .html "text/html; charset=shift_jis"
        ns_param .tcl "text/html; charset=shift_jis"
        ns_param .adp "text/html; charset=shift_jis"

ns_section "ns/server/${server}/tcl" 
        ns_param autoclose      "on" 
        ns_param debug          "false" 
 

ns_param library "/home/akira/openacs-3.2.5/tcl"

ns_section "ns/servers" 
        ns_param   $server     $servername 

ns_section "ns/server/${server}" 
        ns_param   directoryfile        $directoryfile 
        ns_param   pageroot             $pageroot 
        ns_param   globalstats          true     ;# Enable built-in statistics 
        ns_param   urlstats             true     ;# Enable URL statistics 
        ns_param   maxurlstats          1000      ;# Max number of URL's to do stats on
        ns_param   enabletclpages       true      ;# Parse tcl files in pageroot (dangerous)

        ns_param   NotFoundResponse             "/global/file-not-found.html"
        ns_param   ServerBusyResponse           "/global/busy.html"
        ns_param   ServerInternalErrorResponse  "/global/error.html"
        ns_param   ForbiddenResponse            "/global/forbidden.html"
        ns_param   UnauthorizedResponse         "/global/unauthorized.html"


        ns_param   directoryproc    _ns_dirlist           ;#  ...but not both! 
        ns_param   directorylisting  fancy                ;# Can be simple or fancy 
# 
# ADP custom parsers -- see adp.c 
# 
ns_section "ns/server/${server}/adp/parsers" 
        ns_param   fancy            ".adp"

ns_section "ns/server/${server}/module/nssock" 
        ns_param   port         $httpport 
        ns_param   hostname     $hostname 
        ns_param   address      $address


ns_section "ns/db/drivers" 

ns_param   postgres     /usr/local/aolserver/bin/postgres.so  ; # Load PostgreSQL driver

# 
# Database Pools: This is how AOLserver  ``talks'' to the RDBMS. You need three for
# OpenACS: main, log, subquery. Make sure to replace ``yourdb'' and ``yourpassword''
# with the actual values for your db name and the password for it.
# AOLserver can have different pools connecting to different databases and even different
# different database servers.
# 
ns_section "ns/db/pools" 
    ns_param   main       "OpenACS Main Pool" 
    ns_param   log        "OpenACS Log Pool" 
    ns_param   subquery   "OpenACS Subquery Pool"

ns_section "ns/db/pool/main" 
    ns_param Driver postgres 
    ns_param Connections 5                  ;# 5 is a good number. Increase according to your needs
    ns_param DataSource localhost:5432:db
ns_param User username                   ;# User and password AOLserver will use to connect
    ns_param Password "password" 
    ns_param Verbose On                    ;# Set it to On to see all queries. Good for debugging SQL.
    ns_param LogSQLErrors On 
    ns_param ExtendedTableInfo On 
ns_param MaxOpen 1000000000            ;# Uncommenting these two cause AOLserver to keep the
ns_param MaxIdle 1000000000            ;# db connection open. Can be a good thing, up tp your needs.

ns_section "ns/db/pool/log" 
    ns_param Driver postgres 
    ns_param Connections 5 
    ns_param DataSource localhost::db
    ns_param User username 
    ns_param Password "password" 
    ns_param Verbose Off 
    ns_param LogSQLErrors On 
    ns_param ExtendedTableInfo On 
ns_param MaxOpen 1000000000 
 ns_param MaxIdle 1000000000 

ns_section "ns/db/pool/subquery" 
    ns_param Driver postgres 
    ns_param Connections 4 
    ns_param DataSource localhost::db
    ns_param User username 
    ns_param Password "password" 
    ns_param Verbose Off 
    ns_param LogSQLErrors On 
    ns_param ExtendedTableInfo On
 ns_param MaxOpen 1000000000 
 ns_param MaxIdle 1000000000 

ns_section "ns/server/${server}/db" 
        ns_param Pools          "*" 
        ns_param DefaultPool    "main"


ns_section "ns/server/${server}/module/nslog" 
        ns_param   rolllog         true      ;# Should we roll log? 
        ns_param   rollonsignal    true      ;# Roll log on SIGHUP 
        ns_param   rollhour        0         ;# Time to roll log 
        ns_param   maxbackup       360         ;# Max number to keep around when rolling 

ns_section "ns/server/${server}/modules" 
        ns_param   nssock          ${bindir}/nssock.so 
        ns_param   nslog            ${bindir}/nslog.so 
        ns_param   nsperm          ${bindir}/nsperm.so 
#        ns_param   nscgi           ${bindir}/nscgi.so 
#        ns_param   nsjava          ${bindir}/libnsjava.so

#
## nsssl: loads only if requisite files already exist (see top of this
# file). 
#
if { [file exists $sslcertfile] && [file exists $sslkeyfile] } { 
    ns_param nsssl ${bindir}/nsssle.so 
} else { 
    ns_log warning "nsd.tcl: nsssl not loaded because key/cert files do not exist."
}

# 
# To Source OpenACS Config File. You need a "yourservername.tcl" file in the
# OpenACS parameters dir. e.g.: say your server is "server1" then you'd need a
# file named /web/server1/parameters/server1.tcl
# (Hint: Rename ad.tcl to yourservername.tcl and edit it.)
#

source /home/user/openacs-3.2.5/parameters/acs.tcl

ns_log notice "nsd.tcl: finished reading config file."