[interchange-docs] xmldocs - docelic modified 6 files

docs at icdevgroup.org docs at icdevgroup.org
Sat Jun 10 19:44:57 EDT 2006

User:      docelic
Date:      2006-06-10 23:44:56 GMT
Modified:  howtos   obtain-and-run-interchange
Added:     howtos   apache-rewrite-rules avoid-searches-in-href
Added:              find-dbconf-inconsistencies
Added:              fix-failing-mysql-statements mysql-based-sessions
* Some new howto items

Revision  Changes    Path
1.5       +2 -68     xmldocs/howtos/obtain-and-run-interchange

rev 1.5, prev_rev 1.4
Index: obtain-and-run-interchange
RCS file: /var/cvs/xmldocs/howtos/obtain-and-run-interchange,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- obtain-and-run-interchange	17 Sep 2005 21:24:01 -0000	1.4
+++ obtain-and-run-interchange	10 Jun 2006 23:44:56 -0000	1.5
@@ -26,71 +26,5 @@
-You will need &PERL; version 5.6.1 or higher to run &IC;, and
-Perl 5.8.3 or higher is recommended. &IC; requires the modules
-in <classname>Bundle::&IC;</classname> plus one of GDBM_File and DB_File.
-&IC; can run on Windows with the cygwin extensions,
-but it is not supported and there are no known production sites
-using Windows. The majority of &IC; sites run on Linux,
-but there are also sites running FreeBSD, Irix, Mac OS/X, and Solaris.
-&IC; can run on any Unix-like operating system.
-&IC; requires that a web server be installed on your system
-in the normal course of events.
-As detailed previously, &IC; is always running in the background
-as a daemon. It monitors either a UNIX-domain file-based socket (located
-in the &conf-RunDir; directory) or a series of INET-domain sockets.
-The small CGI &glos-link-program; is used to connect to one of those sockets
-and provide the link between &IC; and the web server.
-(Since Apache web servers are the most popular, in the rest of the HOW-TO
-we will talk in the terms they use.)
-You need to have a ScriptAlias or other CGI execution capability on your
-web server to use the &glos-link-program;. (The default ScriptAlias for many web
-servers is <literal>/cgi-bin</literal>.) If you have ExecCGI set for all of your
-directories, then any program ending in a particular file suffix (usually
-.cgi) will be seen as a CGI program.
-Unix domain sockets are not reachable from the Internet directly,
-but only locally from a request on your own server. The link program
-vlink is the provided facility for such communication with &IC;.
-(Note that this does not prevent visitors from seeing an &IC; website,
-in only makes it mandatory to run the Web server and &IC; server on 
-the same computer).  
-This is the most secure way to run your catalog, for there is no way
-for systems on the Internet to interact with &IC; except through
-its &glos-link-program;.
-The most important issue with UNIX-domain sockets on &IC; is the
-permissions with which the CGI program and the &IC; server run.
-To improve security, &IC; normally runs with the socket file
-having &glos-mode; <literal>0600 (rw&mdash;&mdash;&mdash;-)</literal>, which mandates that
-the CGI
-program and the server run as the same user ID. This means
-that the vlink program must be SUID to the same user ID as
-the server executes under. (Or that CGIWRAP or suexec is used
-on a single catalog system).
-With &IC; multiple catalog capability, the permissions situation
-gets a bit tricky. &IC; comes with a program, <command>makecat</command>, which
-configures catalogs for a multiple catalog system. It should properly set
-up ownership and permissions for multiple users if run as the superuser.
-INET domain sockets are sockets which are reachable from the Internet directly.
-The link program tlink is the provided facility for such communication with
-&IC;; you may also use your browser to talk to the socket directly
-if you have it mapped to a catalog with the global &conf-TcpMap; directive.
-To improve security, &IC; usually checks that the request comes
-from one of a limited number of systems, defined in the global
-&conf-TcpHost; directive.
-See &cvsfile-README; for further information.
+See our <olink targetdoc='install'>Installation Guide</olink> for complete

1.1                  xmldocs/howtos/apache-rewrite-rules

rev 1.1, prev_rev 1.0
Index: apache-rewrite-rules
Write Apache RewriteRule and RewriteCond directives to avoid cgi-bin/ in HTML links

The &APACHE; config file (or a corresponding vhost file) needs something
like the following:
RewriteEngine   on

RewriteRule     ^$      /cgi-bin/shop/  [L,NS,PT]
RewriteRule     ^/$      /cgi-bin/shop/  [L,NS,PT]
RewriteRule     ^/index.html$      /cgi-bin/shop/  [L,NS,PT]

RewriteCond     /home/shop/www/html/%{REQUEST_FILENAME} -f      [OR]
RewriteCond     /home/shop/www/html/%{REQUEST_FILENAME} -d
RewriteRule     ^(.+)$  -  [L,NS]

RewriteCond     /%{REQUEST_FILENAME}    !^.*/cgi-bin/shop.*$
RewriteRule     ^(.+)$  /cgi-bin/shop/$1  [L,NS,PT]
Thanks to Frederic Steinfels for providing this tip in March 2003.

1.1                  xmldocs/howtos/avoid-searches-in-href

rev 1.1, prev_rev 1.0
Index: avoid-searches-in-href
Avoid search strings in a href specification

Basically, you should never embed searches in a &glos-HTML; href specification.
In other words, you should never do something like:
[area href="scan/lf=category/ls=%Hot Dogs"]

The proper way to go about it, is to use any of the below two methods:
[area search="
  ls=%Hot Dogs
[area href=scan arg="
  ls=%Hot Dogs
That way you don't have to worry about escaping and formatting. Things
are fragile otherwise.

1.1                  xmldocs/howtos/find-dbconf-inconsistencies

rev 1.1, prev_rev 1.0
Index: find-dbconf-inconsistencies
Find database definition inconsistencies for various database types defined under dbconf/ directory

Here's a script that can help you find inconsistencies in database definition
files. (All files should essentially have the same definition, even if they
differ in database-specific syntax).

# This scrip needs to be run from the dbconf/ directory in order to
# find the relative filenames

@dbtypes = qw{mysql pgsql oracle sqlite};

%dbsuff = ( mysql => mysql,
            pgsql => pgsql,
            oracle => ora,
            sqlite => lite, );
$txt = '.txt';
foreach $gtable  (@gtables = grep { s/\.txt//g } `(cd ../products/; ls *.txt)`) {
   $gtable =~ s/\n//smg;
   $all_tables{$gtable} = 1;
   $fn = $gtable . '.txt';

   $flds = `(cd ../products/; head -1 $fn)`;
   my @flds =  split /\t/, $flds;
   foreach $fld (@flds) {
      $seen{$gtable}{$fld} =1; 

foreach $dbtype (@dbtypes) {
  # print "\n\ndbtype: $dbtype dbsuff: $dbsuff{$dbtype}\n";
  @tables = grep { s/\.$dbsuff{$dbtype}//g } `(cd $dbtype; ls *.$dbsuff{$dbtype})`;
  @tables = grep { s/\n//smg } @tables;
  foreach $table ( @tables) {
     my $M = qq{$dbtype/$table.$dbsuff{$dbtype}};
     # print "$M\n";
     @fields = `/bin/grep -i COLUMN_DEF $M | /bin/cut -d'"' -f2 `;
     # here I need to build a hash for each db type 
     foreach $field (@fields) { 
         my ($k, $v) = split (/=/, $field);
         $v =~ s/\n//smg;
         $table{$dbtype}->{$table}->{$k}= $v;
print "<html><body bgcolor=\"#ffffff\">\n";
foreach my $table (sort keys %all_tables) {
   print "<table border=\"1\" width=\"100%\">\n";
   print "<tr><td colspan=\"5\" align=\"center\"1>$table</td></tr>\n";
   print "<tr><td>&nbsp;</td>";
   foreach (@dbtypes) {
       print "<td>$_</td>";
   print "</tr>";
   foreach my $field (sort keys %{$seen{$table}}) {
       print "<tr><td>$field</td>";
       foreach $dbtype  ( @dbtypes) {
          print "<td>$table{$dbtype}->{$table}->{$field}</td>";
       print "</tr>\n";
   print "</table>\n<br><br>\n";
print "</body></html>\n";
Thanks Paul Vinciguerra for providing this tip in October 2003.

1.1                  xmldocs/howtos/fix-failing-mysql-statements

rev 1.1, prev_rev 1.0
Index: fix-failing-mysql-statements
Fix constantly failing MySQL statements

One possible cause for the failing &MYSQL; statements is the too-low
timeout value. Try increasing the timeout to say, 50 minutes, by inserting
the following in <filename>my.cnf</filename>:
set-variable = wait_timeout=3000
Thanks to Frederic Steinfels for providing this tip in March 2004.

1.1                  xmldocs/howtos/mysql-based-sessions

rev 1.1, prev_rev 1.0
Index: mysql-based-sessions
Implement MySQL-based sessions

As you might know, &IC; can use databases to store users' &glos-session;
data (instead of the usual files). Corresponding &ccf; definition might
look like this:
Message Starting MySQL-based sessions setup...

SessionType DBI

Database  session  session.txt dbi:mysql:sessionfiles:localhost
Database  session  USER         ds
Database  session  PASS         tenspeed
Database  session  KEY          code
Database  session  COLUMN_DEF   "code=varchar(64) NOT NULL PRIMARY KEY"
Database  session  COLUMN_DEF   "session=blob"
Database  session  COLUMN_DEF   "sessionlock=VARCHAR(64) DEFAULT ''"
Database  session  COLUMN_DEF   "last_accessed=TIMESTAMP(14)"

SessionDB   session

Message ...Done.
Thanks &danb; for providing this tip in January 2002.

More information about the docs mailing list