Index: openacs-4/packages/acs-core-docs/www/acs-admin.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/acs-admin.html,v diff -u -N -r1.21 -r1.22 --- openacs-4/packages/acs-core-docs/www/acs-admin.html 11 Dec 2003 23:08:45 -0000 1.21 +++ openacs-4/packages/acs-core-docs/www/acs-admin.html 4 Feb 2004 16:47:32 -0000 1.22 @@ -1 +1 @@ -Part�II.�Administrator's Guide

Administrator's Guide

Table of Contents

2. Installation Overview
Basic Steps
Prerequisite Software
3. Complete Installation
Install a Unix-like system and supporting software
Install Oracle 8.1.7
Install PostgreSQL
Install AOLserver 3.3oacs1
Install OpenACS 5.0.0b4
OpenACS Installation Guide for Windows2000
OpenACS Installation Guide for Mac OS X
4. Configuring a New Service
5. Upgrading
Upgrading
6. Maintenance
Hosting Web Sites
Database Management
Backup and Recovery
A. Install Red Hat 8/9
B. Install additional supporting software
Unpack the OpenACS tarball
Initialize CVS (OPTIONAL)
Add PSGML commands to emacs init file (OPTIONAL)
Install Daemontools (OPTIONAL)
Install qmail (OPTIONAL)
Install Analog web file analyzer
Install nspam
Install Full Text Search
Install nsopenssl
Install tclwebtest.
C. Credits
Where did this document come from?
Linux Install Guides
Security Information
Resources
View comments on this page at openacs.org
+Part�II.�Administrator's Guide

Administrator's Guide

Table of Contents

2. Installation Overview
Basic Steps
Prerequisite Software
1. Complete Installation
Install a Unix-like system and supporting software
Install Oracle 8.1.7
Install PostgreSQL
Install AOLserver 3.3oacs1
Install AOLserver 4
Install OpenACS
OpenACS Installation Guide for Windows2000
OpenACS Installation Guide for Mac OS X
1. Configuring a new OpenACS Site
How Do I?
2. Upgrading
Overview
Upgrading OpenACS
Upgrading the OpenACS files
Upgrading Platform components
1. Maintenance
Running OpenACS in Production Environments
Database Management
Backup and Recovery
Diagnosing Performance Problems
A. Install Red Hat 8/9
B. Install additional supporting software
Unpack the OpenACS tarball
Initialize CVS (OPTIONAL)
Add PSGML commands to emacs init file (OPTIONAL)
Install Daemontools (OPTIONAL)
Install qmail (OPTIONAL)
Install Analog web file analyzer
Install nspam
Install Full Text Search
Install nsopenssl
Install tclwebtest.
Install PHP for use in AOLserver
Install Squirrelmail for use as a webmail system for OpenACS
A. Credits
Where did this document come from?
Linux Install Guides
Security Information
Resources
View comments on this page at openacs.org
Index: openacs-4/packages/acs-core-docs/www/acs-package-dev.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/acs-package-dev.html,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/acs-core-docs/www/acs-package-dev.html 11 Dec 2003 23:08:45 -0000 1.11 +++ openacs-4/packages/acs-core-docs/www/acs-package-dev.html 4 Feb 2004 16:47:32 -0000 1.12 @@ -1,2 +1,2 @@ -Part�III.�For OpenACS Package Developers

For OpenACS Package Developers

Tutorials and reference material for creating new OpenACS packages. -

View comments on this page at openacs.org
+Part�III.�For OpenACS Package Developers

For OpenACS Package Developers

Tutorials and reference material for creating new OpenACS packages. +

View comments on this page at openacs.org
Index: openacs-4/packages/acs-core-docs/www/acs-plat-dev.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/acs-plat-dev.html,v diff -u -N -r1.12 -r1.13 --- openacs-4/packages/acs-core-docs/www/acs-plat-dev.html 11 Dec 2003 23:08:45 -0000 1.12 +++ openacs-4/packages/acs-core-docs/www/acs-plat-dev.html 4 Feb 2004 16:47:32 -0000 1.13 @@ -1 +1 @@ -Part�IV.�For OpenACS Platform Developers

For OpenACS Platform Developers

Table of Contents

11. Kernel Documentation
Overview
Object Model Requirements
Object Model Design
Permissions Requirements
Permissions Design
Groups Requirements
Groups Design
Subsites Requirements
Subsites Design Document
Package Manager Requirements
Package Manager Design
Database Access API
OpenACS Internationalization Requirements
Internationalization
Security Requirements
Security Design
Security Notes
Request Processor Requirements
Request Processor Design
Documenting Tcl Files: Page Contracts and Libraries
Bootstrapping OpenACS
External Authentication Requirements
View comments on this page at openacs.org
+Part�IV.�For OpenACS Platform Developers

For OpenACS Platform Developers

Table of Contents

11. Kernel Documentation
Overview
Object Model Requirements
Object Model Design
Permissions Requirements
Permissions Design
Groups Requirements
Groups Design
Subsites Requirements
Subsites Design Document
Package Manager Requirements
Package Manager Design
Database Access API
OpenACS Internationalization Requirements
Internationalization
Security Requirements
Security Design
Security Notes
Request Processor Requirements
Request Processor Design
Documenting Tcl Files: Page Contracts and Libraries
Bootstrapping OpenACS
External Authentication Requirements
View comments on this page at openacs.org
Index: openacs-4/packages/acs-core-docs/www/analog-install.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/analog-install.html,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/acs-core-docs/www/analog-install.html 11 Dec 2003 23:08:45 -0000 1.7 +++ openacs-4/packages/acs-core-docs/www/analog-install.html 4 Feb 2004 16:47:32 -0000 1.8 @@ -1,17 +1,17 @@ -Install Analog web file analyzer

Install Analog web file analyzer

Download the Analog source tarball in -/tmp. Unpack, compile, and install analog.

[root@yourserver aolserver]# cd /usr/local/src
-[root@yourserver src]# tar xzf /tmp/analog-5.32.tar.gz
-[root@yourserver src]# cd analog-5.32
-[root@yourserver analog-5.32]# make
+Install Analog web file analyzer

Install Analog web file analyzer

Download the Analog source tarball in +/tmp. Unpack, compile, and install analog.

[root aolserver]# cd /usr/local/src
+[root src]# tar xzf /tmp/analog-5.32.tar.gz
+[root src]# cd analog-5.32
+[root analog-5.32]# make
 cd src && make
 make[1]: Entering directory `/usr/local/src/analog-5.32/src'
 (many lines omitted)
 ***IMPORTANT: You must read the licence before using analog
 ***
 make[1]: Leaving directory `/usr/local/src/analog-5.32/src'
-[root@yourserver analog-5.32]# cd ..
-[root@yourserver src]# mv analog-5.32 /usr/share/
-[root@yourserver src]#
+[root analog-5.32]# cd ..
+[root src]# mv analog-5.32 /usr/share/
+[root src]#
 cd /usr/local/src
 tar xzf /tmp/analog-5.32.tar.gz
 cd analog-5.32
Index: openacs-4/packages/acs-core-docs/www/aolserver.html
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/aolserver.html,v
diff -u -N -r1.25 -r1.26
--- openacs-4/packages/acs-core-docs/www/aolserver.html	11 Dec 2003 23:08:45 -0000	1.25
+++ openacs-4/packages/acs-core-docs/www/aolserver.html	4 Feb 2004 16:47:32 -0000	1.26
@@ -1,8 +1,8 @@
-Install AOLserver 3.3oacs1

Install AOLserver 3.3oacs1

by Vinod Kurup

+Install AOLserver 3.3oacs1

Install AOLserver 3.3oacs1

by Vinod Kurup

OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -
  1. Unpack the Aolserver tarball.�Download the aolserver tarball and unpack it.

    [root@yourserver root]# cd /usr/local/src
    -[root@yourserver src]# wget --passive http://uptime.openacs.org/aolserver-openacs/aolserver3.3oacs1.tar.gz
    +        
  1. Unpack the Aolserver tarball.�Download the aolserver tarball and unpack it.

    [root root]# cd /usr/local/src
    +[root src]# wget --passive http://uptime.openacs.org/aolserver-openacs/aolserver3.3oacs1.tar.gz
     --15:38:08--  http://uptime.openacs.org/aolserver-openacs/aolserver3.3oacs1.tar.gz
                => `aolserver3.3oacs1.tar.gz'
     Resolving uptime.openacs.org... done.
    @@ -13,16 +13,16 @@
     100%[====================================>] 3,858,074     66.56K/s    ETA 00:00
     
     15:39:05 (66.56 KB/s) - `aolserver3.3oacs1.tar.gz' saved [3858074/3858074]
    -[root@yourserver src]# tar xzf aolserver3.3oacs1.tar.gz
    -[root@yourserver src]#
    +[root src]# tar xzf aolserver3.3oacs1.tar.gz
    +[root src]#
     cd /usr/local/src
     wget --passive http://uptime.openacs.org/aolserver-openacs/aolserver3.3oacs1.tar.gz
     tar xzf aolserver3.3oacs1.tar.gz

    This section also relies on some OpenACS files, which you can get with the section called “Unpack the OpenACS tarball”.

  2. Compile AOLserver.�Compile and install AOLserver. First, prepare the installation directory and the source code. The message about BUILD-MODULES can be ignored.

    root@yourserver root]# mkdir -p /usr/local/aolserver
    -[root@yourserver root]# cd /usr/local/src/aolserver
    -[root@yourserver aolserver]# ./conf-clean
    +[root root]# cd /usr/local/src/aolserver
    +[root aolserver]# ./conf-clean
     cat: BUILD-MODULES: No such file or directory
     Done.
    -[root@yourserver aolserver]#mkdir -p /usr/local/aolserver
    +[root aolserver]#mkdir -p /usr/local/aolserver
     cd /usr/local/src/aolserver
     ./conf-clean

    If you are using Oracle, edit @@ -35,8 +35,8 @@ the environment variables properly.

    conf-inst should contain the location where AOLserver is to be installed. Overwrite the - tarball's default value with our default value, /usr/local/aolserver:

    [root@yourserver aolserver]# echo "/usr/local/aolserver" > conf-inst
    -[root@yourserver aolserver]#

    conf-make should contain the + tarball's default value with our default value, /usr/local/aolserver:

    [root aolserver]# echo "/usr/local/aolserver" > conf-inst
    +[root aolserver]#

    conf-make should contain the name of the GNU Make command on your system. It defaults to gmake. Debian users: ln -s /usr/bin/make /usr/bin/gmake.

    Set an environment variable that the nspostgres driver Makefile needs to compile correctly and run @@ -46,7 +46,7 @@ postgresql from apt-get may need to make these symlinks: ln -s /usr/include/postgresql/ /usr/include/pgsql - and ln -s /usr/lib/postgresql /usr/local/pgsql)

    [root@yourserver aolserver]# export POSTGRES=/usr/local/pgsql; ./conf
    +          and ln -s /usr/lib/postgresql /usr/local/pgsql)

    [root aolserver]# export POSTGRES=/usr/local/pgsql; ./conf
     Building in /usr/local/aolserver
     with the following modules:
     aolserver
    @@ -67,28 +67,28 @@
     Creating  ...
     ==================================================================
     Done Building Sat Mar  8 10:31:35 PST 2003
    -[root@yourserver aolserver]# 

    +[root aolserver]#

    This takes about 5 minutes. It builds aolserver, several modules, and the database driver. (Upgraders, note that the postgres database driver has changed from postgres.so to nspostgres.so). All of the results are logged to files in /usr/local/src/aolserver/log. If you run into problems running AOLserver, check these files for build errors.

  3. Add a database-specific wrapper script.�This script sets database environment variables before starting AOLserver; this allows the AOLserver instance can communicate with the database. There is one script each for Oracle and PostgreSQL. They don't conflict, so if you plan - to use both databases, install both.

    • Oracle

      [root@yourserver aolserver]# cd /usr/local/aolserver/bin
      -[root@yourserver bin]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/nsd-oracle.txt ./nsd-oracle
      -[root@yourserver bin]# chmod 750 nsd-oracle
      -[root@yourserver bin]#
      +	  to use both databases, install both.

      • Oracle

        [root aolserver]# cd /usr/local/aolserver/bin
        +[root bin]# cp /tmp//packages/acs-core-docs/www/files/nsd-oracle.txt ./nsd-oracle
        +[root bin]# chmod 750 nsd-oracle
        +[root bin]#
         cd /usr/local/aolserver/bin
        -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/nsd-oracle.txt ./nsd-oracle
        -chmod 750 nsd-oracle
      • PostgreSQL

        [root@yourserver aolserver]# cd /usr/local/aolserver/bin
        -[root@yourserver bin]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/nsd-postgres.txt ./nsd-postgres
        -[root@yourserver bin]# chmod 755 nsd-postgres
        -[root@yourserver bin]#
        +cp /tmp//packages/acs-core-docs/www/files/nsd-oracle.txt ./nsd-oracle
        +chmod 750 nsd-oracle
      • PostgreSQL

        [root aolserver]# cd /usr/local/aolserver/bin
        +[root bin]# cp /tmp//packages/acs-core-docs/www/files/nsd-postgres.txt ./nsd-postgres
        +[root bin]# chmod 755 nsd-postgres
        +[root bin]#
         cd /usr/local/aolserver/bin
        -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/nsd-postgres.txt ./nsd-postgres
        +cp /tmp//packages/acs-core-docs/www/files/nsd-postgres.txt ./nsd-postgres
         chmod 755 nsd-postgres
    • Install tDOM.�Download the tDOM tarball, unpack it, adjust the configuration file to match our patched - distribution of aolserver, and compile it.

      [root@yourserver root]# cd /usr/local/src
      -[root@yourserver src]# wget --passive http://www.tdom.org/tDOM-0.7.8.tar.gz
      +        distribution of aolserver, and compile it.

      [root root]# cd /usr/local/src
      +[root src]# wget --passive http://www.tdom.org/tDOM-0.7.8.tar.gz
       --16:40:58--  http://www.tdom.org/tDOM-0.7.8.tar.gz
                  => `tDOM-0.7.8.tar.gz'
       Resolving www.tdom.org... done.
      @@ -100,9 +100,9 @@
       
       16:41:04 (138.06 KB/s) - `tDOM-0.7.8.tar.gz' saved [826613/826613]
       
      -[root@yourserver src]# tar xzf tDOM-0.7.8.tar.gz
      -[root@yourserver src]# cd tDOM-0.7.8/unix
      -[root@yourserver unix]#
      +[root src]# tar xzf tDOM-0.7.8.tar.gz
      +[root src]# cd tDOM-0.7.8/unix
      +[root unix]#
       cd /usr/local/src
       wget --passive http://www.tdom.org/tDOM-0.7.8.tar.gz
       tar xzf tDOM-0.7.8.tar.gz
      @@ -114,22 +114,22 @@
       aolsrc="/usr/local/src/aolserver/aolserver"
       ../configure --enable-threads --disable-tdomalloc \
         --with-aolserver=$aolsrc \
      -  --with-tcl=$aolsrc/tcl8.3.2/unix

      And configure and compile:

      [root@yourserver unix]# sh CONFIG
      +  --with-tcl=$aolsrc/tcl8.3.2/unix

      And configure and compile:

      [root unix]# sh CONFIG
       creating cache ./config.cache
       checking for memmove... yes
         (many lines omitted)
       creating Makefile
       creating tdomConfig.sh
      -[root@yourserver unix]# make
      +[root unix]# make
       gcc -pipe -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_THREADS=1
       -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 
         (many lines omitted)
                 -Wl,-rpath,/usr/local/lib -o tcldomsh;\
       fi
      -[root@yourserver unix]# cp libtdom0.7.8.so /usr/local/aolserver/bin/
      -[root@yourserver unix]# cd /usr/local/aolserver/bin/
      -[root@yourserver bin]# ln -s libtdom0.7.8.so libtdom.so
      -[root@yourserver bin]#
      +[root unix]# cp libtdom0.7.8.so /usr/local/aolserver/bin/
      +[root unix]# cd /usr/local/aolserver/bin/
      +[root bin]# ln -s libtdom0.7.8.so libtdom.so
      +[root bin]#
       
       sh CONFIG
       make
      @@ -144,10 +144,10 @@
             or it will fail.  Grant the web
             group permission to write to
             /usr/local/aolserver/log and
      -      /usr/local/aolserver/servers.

      [root@yourserver root]# cd /usr/local/aolserver
      -[root@yourserver aolserver]# chown -R root.web log servers
      -[root@yourserver aolserver]# chmod -R g+w log servers
      -[root@yourserver aolserver]# ls -l
      +      /usr/local/aolserver/servers.

      [root root]# cd /usr/local/aolserver
      +[root aolserver]# chown -R root.web log servers
      +[root aolserver]# chmod -R g+w log servers
      +[root aolserver]# ls -l
       total 32
       drwxr-sr-x    2 root     root         4096 Mar  8 12:57 bin
       drwxr-xr-x    3 root     root         4096 Mar  8 10:34 include
      @@ -156,7 +156,7 @@
       drwxr-sr-x    3 root     root         4096 Mar  8 10:31 modules
       -rw-r--r--    1 root     root         7320 Mar 31  2001 sample-config.tcl
       drwxrwsr-x    3 root     web          4096 Mar  8 10:31 servers
      -[root@yourserver aolserver]#
      +[root aolserver]#
       
       cd /usr/local/aolserver
       chown -R root.web log servers
      @@ -165,8 +165,8 @@
                 correctly. We'll use the sample config file provided with
                 AOLserver. This file will attempt to guess your IP address and
                 hostname. It will then start up the server at port 8000 of that
      -          IP address.

      [root@yourserver aolserver]# ./bin/nsd -t sample-config.tcl -u nobody -g web
      -[root@yourserver aolserver]# [08/Mar/2003:15:07:18][31175.8192][-main-] Notice: config.tcl: starting to read config file...
      +          IP address.

      [root aolserver]# ./bin/nsd -t sample-config.tcl -u nobody -g web
      +[root aolserver]# [08/Mar/2003:15:07:18][31175.8192][-main-] Notice: config.tcl: starting to read config file...
       [08/Mar/2003:15:07:18][31175.8192][-main-] Warning: config.tcl: nsssl not loaded -- key/cert files do not exist.
       [08/Mar/2003:15:07:18][31175.8192][-main-] Warning: config.tcl: nscp not loaded
       -- user/password is not set.
      @@ -181,15 +181,15 @@
                 didn't guess your hostname or ip correctly, you'll get a
                 false negative test.
       
      -        

      [root@yourserver aolserver]# lynx localhost:8000

      +

      [root aolserver]# lynx localhost:8000

      You should see a "Welcome to AOLserver" page. If this doesn't work, try going to http://127.0.0.1:8000/. If this still doesn't work, check out the Troubleshooting AOLserver section below. Note that you will not be able to browse to the web page from another machine, because AOLserver is only listening to the local address. -

      Shutdown the test server:

      [root@yourserver aolserver]# killall nsd
      -[root@yourserver aolserver]#

      +

      Shutdown the test server:

      [root aolserver]# killall nsd
      +[root aolserver]#

      The killall command will kill all processes with the name nsd, @@ -230,4 +230,4 @@ set hostname [ns_info hostname] #set address [ns_info address] set address 0.0.0.0

    • Install - Analog web file analyzer. (OPTIONAL)

($Id$)
View comments on this page at openacs.org
+ Analog web file analyzer. (OPTIONAL)

($Id$)
View comments on this page at openacs.org
Index: openacs-4/packages/acs-core-docs/www/aolserver4.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/aolserver4.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/aolserver4.html 4 Feb 2004 16:47:32 -0000 1.2 @@ -0,0 +1,80 @@ +Install AOLserver 4

Install AOLserver 4

by Malte Sussdorff

+ OpenACS docs are written by the named authors, and may be edited + by OpenACS documentation staff. +
  1. Retrieve TCL 8.4 (or higher).�Download and install TCL 8.4

    If you have not installed TCL already, download the latest TCL version from Sourceforge

    [root root]# cd /usr/local/src
    +[root src]# wget http://heanet.dl.sourceforge.net/sourceforge/tcl/tcl8.4.5-src.tar.gz
    +[root src]# tar xfz tcl8.4.5-src.tar.gz
    +[root src]# cd tcl8.4.5/unix
    +[root unix]# ./configure --enable-threads
    +[root unix]# make install
    +[root root]# 
    +cd /usr/local/src
    +wget http://heanet.dl.sourceforge.net/sourceforge/tcl/tcl8.4.5-src.tar.gz
    +tar xfz tcl8.4.5-src.tar.gz
    +cd tcl8.4.5/unix
    +./configure --enable-threads
    +make install
    +
    +      
  2. Retrieve AOLserver.�Download the aolserver from CVS.

    [root root]# cd /usr/local/src
    +[root src]# mkdir aolserver
    +[root src]# cd aolserver
    +[root aolserver]# cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co  -r aolserver_v40_r2 aolserver
    +[root aolserver]# cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nscache
    +[root aolserver]# cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nsrewrite
    +[root aolserver]# cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nspostgres
    +[root aolserver]# cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nssha1
    +[root aolserver]# cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nsoracle
    +[root aolserver]# cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nsxml
    +[root aolserver]# wget http://www.tdom.org/tDOM-0.7.8.tar.gz
    +[root aolserver]# tar xvfz tDOM-0.7.8.tar.gz
    +[root root]# 
    +cd /usr/local/src
    +mkdir aolserver
    +cd aolserver
    +cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co -r aolserver_v40_r2 aolserver
    +cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nscache
    +cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nsrewrite
    +cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nspostgres
    +cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nssha1
    +cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nsoracle
    +cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nsxml
    +wget http://www.tdom.org/tDOM-0.7.8.tar.gz
    +tar xvfz tDOM-0.7.8.tar.gz
  3. Configure, compile and install AOLserver.�

    [root aolserver]# cd aolserver
    +[root aolserver]# cd aolserver
    +[root aolserver]# ./configure --with-tcl=/usr/local/lib/
    +[root aolserver]# make install
  4. Configure, compile and install the modules.� +

    1. Install nscache

      [root /usr/local/src/aolserver/aolserver]# cd ../nscache
      +[root /usr/local/src/aolserver/nscache]# make install
    2. Install nsrewrite

      [root /usr/local/src/aolserver/nscache]# cd ../nsrewrite
      +[root /usr/local/src/aolserver/nsrewrite]# make install
    3. Install nsoracle (if you want to use Oracle)

      [root /usr/local/src/aolserver/nscache]# cd ../nsoracle
      +[root /usr/local/src/aolserver/nsrewrite]# make install

      Steps so far

      cd /usr/local/src/aolserver/
      +./configure --with-tcl=/usr/local/lib/
      +make install
      +cd ../nscache
      +make install
      +cd ../nsrewrite
      +make install
      +cd ../nsoracle
      +make install
    4. Install nspostgres (if you want to use Postgres)

      [root nsrewrite]# cd ../nspostgres
      +[root nspostgres]# sudo make install POSTGRES=/usr/local/pgsql ACS=1 INST=/usr/local/aolserver 

      If you run into problems with libpq.a do the following (and repeat the step above)

      [root nspostgres]# sudo ranlib /usr/local/pgsql/lib/libpq.a

      If you run into problems with the linker, edit the Makefile. Add -lnsdb to the MODLIBS var.

      MODLIBS = -L$(PGLIB) -lpq -lnsdb
    5. Install nssha1

      [root nsrewrite]# cd ../nssha1
      +[root nssha1]# make

      If the make fails you will have to edit nssha1.c. Comment out the following 2 lines (lines 139-140):

      // typedef unsigned int u_int32_t;
      +// typedef unsigned char u_int8_t;

      Now install nssha1:

      [root nssha1]# make install
    6. Install tDOM

      [root nssha1]# cd ../tDOM-0.7.8/unix

      Edit the CONFIG file. Uncomment the instructions meant for AOLserver 4, but edit it to look like this:

      ../configure --enable-threads --disable-tdomalloc
      +          --prefix=/usr/local/aolserver --with-tcl=/usr/local/lib

      Now you can compile and configure tDOM

      [root unix]# sh CONFIG
      +[root unix]# make install

    +

  5. Add a database-specific wrapper script.�This script + sets database environment variables before starting + AOLserver; this allows the AOLserver instance can + communicate with the database. There is one script each for + Oracle and PostgreSQL. They don't conflict, so if you plan + to use both databases, install both.

    • Oracle

      [root aolserver]# cd /usr/local/aolserver/bin
      +[root bin]# cp /tmp//packages/acs-core-docs/www/files/nsd-oracle.txt ./nsd-oracle
      +[root bin]# chmod 750 nsd-oracle
      +[root bin]#
      +cd /usr/local/aolserver/bin
      +cp /tmp//packages/acs-core-docs/www/files/nsd-oracle.txt ./nsd-oracle
      +chmod 750 nsd-oracle
    • PostgreSQL

      [root aolserver]# cd /usr/local/aolserver/bin
      +[root bin]# cp /tmp//packages/acs-core-docs/www/files/nsd-postgres.txt ./nsd-postgres
      +[root bin]# chmod 755 nsd-postgres
      +[root bin]#
      +cd /usr/local/aolserver/bin
      +cp /tmp//packages/acs-core-docs/www/files/nsd-postgres.txt ./nsd-postgres
      +chmod 755 nsd-postgres
  6. Change startup script (optional).�If you want to run AOLserver on a port below 1024 (normally, for a webserver you will use 80), you will have to change the /var/lib/aolserver/service0/etc/daemontools/run script according to the documentation found there (namely: Add the -b yourip:yourport switch)

  7. Test AOLserver.

($Id: aolserver4.html,v 1.2 2004/02/04 16:47:32 joela Exp $)
View comments on this page at openacs.org
Index: openacs-4/packages/acs-core-docs/www/apm-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/apm-design.html,v diff -u -N -r1.23 -r1.24 --- openacs-4/packages/acs-core-docs/www/apm-design.html 11 Dec 2003 23:08:45 -0000 1.23 +++ openacs-4/packages/acs-core-docs/www/apm-design.html 4 Feb 2004 16:47:32 -0000 1.24 @@ -1,10 +1,10 @@ -Package Manager Design

Package Manager Design

By Bryan Quinn

+Package Manager Design

Package Manager Design

By Bryan Quinn

OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

Essentials

  • OpenACS Administrator directory

  • Package Manager Requirements

  • Packages

  • ER diagram

  • Tcl API

    Essentials

    Introduction

    In general terms, a package is a unit of software that serves a single well-defined purpose. That purpose may be to provide a @@ -87,7 +87,7 @@ packages for other OpenACS users to download and install.

    For a simple illustration of the difference between ACS without APM (pre-3.3) and ACS with APM (3.3 and beyond), consider a hypothetical ACS installation that uses only two of the thirty-odd modules available circa ACS -3.2 (say, bboard and e-commerce):

    APM itself is part of a package, the OpenACS Kernel, an OpenACS +3.2 (say, bboard and e-commerce):

    APM itself is part of a package, the OpenACS Kernel, an OpenACS service that is the only mandatory component of an OpenACS installation.

    Competitive Analysis

    The OpenACS is a platform for web-based application software, and any software platform has the potential to develop problems like those described above. Fortunately, there are many precedents for systematic solutions, Index: openacs-4/packages/acs-core-docs/www/apm-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/apm-requirements.html,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/acs-core-docs/www/apm-requirements.html 11 Dec 2003 23:08:45 -0000 1.18 +++ openacs-4/packages/acs-core-docs/www/apm-requirements.html 4 Feb 2004 16:47:32 -0000 1.19 @@ -1,4 +1,4 @@ -Package Manager Requirements

    Package Manager Requirements

    By Bryan Quinn and Todd Nightingale

    +Package Manager Requirements

    Package Manager Requirements

    By Bryan Quinn and Todd Nightingale

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    Introduction

    The following is a requirements document for the OpenACS Package Manager Index: openacs-4/packages/acs-core-docs/www/automated-testing-best-practices.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/automated-testing-best-practices.html,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-core-docs/www/automated-testing-best-practices.html 11 Dec 2003 23:08:45 -0000 1.3 +++ openacs-4/packages/acs-core-docs/www/automated-testing-best-practices.html 4 Feb 2004 16:47:32 -0000 1.4 @@ -1,4 +1,4 @@ -Automated Testing

    Automated Testing

    By Jeff Davis

    +Automated Testing

    Automated Testing

    By Jeff Davis

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    Best practices in writing OpenACS automated tests

    • Special characters in Tcl.� Index: openacs-4/packages/acs-core-docs/www/backup-recovery.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/backup-recovery.html,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/acs-core-docs/www/backup-recovery.html 23 Jan 2004 15:09:52 -0000 1.18 +++ openacs-4/packages/acs-core-docs/www/backup-recovery.html 4 Feb 2004 16:47:32 -0000 1.19 @@ -1,8 +1,13 @@ -Backup and Recovery

      Backup and Recovery

      By Don Baccus with additions - by Joel Aufrecht


      +Backup and Recovery

      Backup and Recovery

      By Don Baccus with additions + by Joel Aufrecht

      OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

      Backup Strategy

      +

      We will cover some basic backup and recovery strategies. These are intended to + be robust but simple enough to set up. For a large scale production site you would + probably need to create your own backup strategies (in particular full dumps from + oracle, while easy to set up, are far from the best solution). +

      There are three basic things which need to be backed up, the database data, the server + source tree, and the acs-content-repository (which is in the server source tree).

      Backup Strategy

      The purpose of backup is to enable recovery. Backup and recovery are always risky; here are some steps that minimize the chance recovery is necessary: @@ -31,177 +36,171 @@ OpenACS installations comprise files and database contents. If you follow the reference install and put all files, including configuration files, in - /var/lib/aolserver/service0/, + /var/lib/aolserver/service0/, and back up the database nightly to a file in - /var/lib/aolserver/service0/database-backup, + /var/lib/aolserver/service0/database-backup, then you can apply standard file-based backup strategies to - /var/lib/aolserver/service0 + /var/lib/aolserver/service0

      Manual backup and recovery

      This section describes how to make a one-time backup and - restore of the files and database. This is useful for rolling back to - known-good versions of a service, such as at initial + restore of the files and database. This is useful for rolling + back to known-good versions of a service, such as at initial installation and just before an upgrade. First, you back up the database to a file within the file tree. Then, you back up the file tree. All of the information needed to rebuild the site, - including the AOLserver config files, is then in tree for - regular file system backup.

      1. Back up the database to a file.�

        • Oracle.�

          • + including the AOLserver config files, is then in tree for regular + file system backup.

            1. Back up the database to a file.�

              • Oracle.�

                • Download the backup script. Save the file export-oracle.txt as - /tmp/export-oracle.txt + /tmp/export-oracle.txt

                • Login as root. The following commands will install the export script: -

                  -                joeuser:~$ su -
                  -                Password: ***********
                  -                root:~# cp /tmp/export-oracle.txt /usr/sbin/export-oracle
                  -              root:~# chmod 700 /usr/sbin/export-oracle
                • +

                  [joeuser ~]$ su -
                  +[root ~]# cp /tmp/export-oracle.txt /usr/sbin/export-oracle
                  +[root ~]# chmod 700 /usr/sbin/export-oracle
                • Setup the export directory; this is the directory where backups will be stored. We recommend the directory - /ora8/m02/oracle-exports.

                  -                root:~# mkdir /ora8/m02/oracle-exports
                  -                root:~# chown oracle.dba /ora8/m02/oracle-exports
                  -              root:~# chmod 770 /ora8/m02/oracle-exports
                • + /ora8/m02/oracle-exports.

                  [root ~]# mkdir /ora8/m02/oracle-exports
                  +[root ~]# chown oracle:dba /ora8/m02/oracle-exports
                  +[root ~]# chmod 770 /ora8/m02/oracle-exports
                • Now edit - /usr/sbin/export-oracle and + /usr/sbin/export-oracle and change the SERVICE_NAME and DATABASE_PASSWORD fields to their correct values. If you want to use a directory other than - /ora8/m02/oracle-exports, you + /ora8/m02/oracle-exports, you also need to change the exportdir setting.

                  Test the export procedure by running the command: -

                  -                root:~# /usr/sbin/export-oracle
                  -                mv: /ora8/m02/oracle-exports/oraexport-service_name.dmp.gz: No such file or directory
                  +              

                  [root ~]# /usr/sbin/export-oracle
                  +mv: /ora8/m02/oracle-exports/oraexport-service_name.dmp.gz: No such file or directory
                   
                  -                Export: Release 8.1.6.1.0 - Production on Sun Jun 11 18:07:45 2000
                  +Export: Release 8.1.6.1.0 - Production on Sun Jun 11 18:07:45 2000
                   
                  -                (c) Copyright 1999 Oracle Corporation.  All rights reserved.
                  +(c) Copyright 1999 Oracle Corporation.  All rights reserved.
                   
                  -
                  -                Connected to: Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
                  -                With the Partitioning option
                  -                JServer Release 8.1.6.0.0 - Production
                  -                Export done in US7ASCII character set and US7ASCII NCHAR character set
                  -                . exporting pre-schema procedural objects and actions
                  -                . exporting foreign function library names for user SERVICE_NAME 
                  -                . exporting object type definitions for user SERVICE_NAME 
                  -                About to export SERVICE_NAME's objects ...
                  -                . exporting database links
                  -                . exporting sequence numbers
                  -                . exporting cluster definitions
                  -                . about to export SERVICE_NAME's tables via Conventional Path ...
                  -                . exporting synonyms
                  -                . exporting views
                  -                . exporting stored procedures
                  -                . exporting operators
                  -                . exporting referential integrity constraints
                  -                . exporting triggers
                  -                . exporting indextypes
                  -                . exporting bitmap, functional and extensible indexes
                  -                . exporting posttables actions
                  -                . exporting snapshots
                  -                . exporting snapshot logs
                  -                . exporting job queues
                  -                . exporting refresh groups and children
                  -                . exporting dimensions
                  -                . exporting post-schema procedural objects and actions
                  -                . exporting statistics
                  -              Export terminated successfully without warnings.
              • PostgreSQL.�Create a backup file and verify that it was created and has a reasonable size (several megabytes).

                [root@localhost root]# su - service0
                -            [service0@localhost service0]$ pg_dump -f /var/lib/aolserver/service0/database-backup/before_upgrade_to_4.6.dmp service0
                -            [service0@localhost service0]$ ls -al /var/lib/aolserver/service0/database-backup/before_upgrade_to_4.6.dmp 
                -            -rw-rw-r-x    1 service0  service0   4005995 Feb 21 18:28 /var/lib/aolserver/service0/database-backup/before_upgrade_to_4.6.dmp
                -            [service0@localhost service0]$ exit
                -            [root@localhost root]#
                -            
                su - service0
                -            pg_dump -f /var/lib/aolserver/service0/database-backup/before_upgrade_to_4.6.dmp openacs-dev
                -            ls -al /var/lib/aolserver/service0/database-backup/before_upgrade_to_4.6.dmp
                -            exit
            2. Back up the file system.�Back up all of the files in the service, including the +Connected to: Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production +With the Partitioning option +JServer Release 8.1.6.0.0 - Production +Export done in US7ASCII character set and US7ASCII NCHAR character set + . exporting pre-schema procedural objects and actions + . exporting foreign function library names for user SERVICE_NAME + . exporting object type definitions for user SERVICE_NAME + About to export SERVICE_NAME's objects ... + . exporting database links + . exporting sequence numbers + . exporting cluster definitions + . about to export SERVICE_NAME's tables via Conventional Path ... + . exporting synonyms + . exporting views + . exporting stored procedures + . exporting operators + . exporting referential integrity constraints + . exporting triggers + . exporting indextypes + . exporting bitmap, functional and extensible indexes + . exporting posttables actions + . exporting snapshots + . exporting snapshot logs + . exporting job queues + . exporting refresh groups and children + . exporting dimensions + . exporting post-schema procedural objects and actions + . exporting statistics +Export terminated successfully without warnings.

  • PostgreSQL.�Create a backup file and verify that it was created and has a reasonable size (several megabytes).

    [root root]# su - service0
    +[service0 service0]$ pg_dump -f /var/lib/aolserver/service0/database-backup/before_upgrade_to_4.6.dmp service0
    +[service0 service0]$ ls -al /var/lib/aolserver/service0/database-backup/before_upgrade_to_4.6.dmp 
    +-rw-rw-r-x    1 service0  service0   4005995 Feb 21 18:28 /var/lib/aolserver/service0/database-backup/before_upgrade_to_4.6.dmp
    +[service0 service0]$ exit
    +[root root]#
    +su - service0
    +pg_dump -f /var/lib/aolserver/service0/database-backup/before_upgrade_to_4.6.dmp openacs-dev
    +ls -al /var/lib/aolserver/service0/database-backup/before_upgrade_to_4.6.dmp
    +exit
  • Back up the file system.�Back up all of the files in the service, including the database backup file but excluding the auto-generated - supervise directory, which is + supervise directory, which is unneccesary and has complicated permissions.

    In the tar command,

    [root@yourserver root]# su - service0
    -        [service0@yourserver service0]$ tar -cpsj --exclude /var/lib/aolserver/service0/etc/daemontools/supervise --file /tmp/service0-backup.tar.bz2 /var/lib/aolserver/service0/ 
    -        tar: Removing leading `/' from member names
    -        [service0@yourserver service0]$
  • Suffer a catastrophic failure on your production system.�(We'll simulate this step)

    [root@yourserver root]# svc -d /service/service0
    -        [root@yourserver root]# mv /var/lib/aolserver/service0/ /var/lib/aolserver/service0.lost
    -        [root@yourserver root]# rm /service/service0
    -        rm: remove symbolic link `/service/service0'? y
    -        [root@yourserver root]# ps -auxw | grep service0
    -        root      1496  0.0  0.0  1312  252 ?        S    16:58   0:00 supervise service0
    -        [root@yourserver root]# kill 1496
    -        [root@yourserver root]# ps -auxw | grep service0
    -        [root@yourserver root]# su - postgres
    -        [postgres@yourserver pgsql]$ dropdb service0
    -        DROP DATABASE
    -        [postgres@yourserver pgsql]$ dropuser service0
    -        DROP USER
    -        [postgres@yourserver pgsql]$ exit
    -        logout
    -        [root@yourserver root]#
  • Recovery.�

    1. Restore the operating system and required software. + recursive backup.

    [root root]# su - service0
    +[service0 service0]$ tar -cpsz --exclude /var/lib/aolserver/service0/etc/daemontools/supervise \
    +   --file /tmp/service0-backup.tar.gz /var/lib/aolserver/service0/
    +tar: Removing leading `/' from member names
    +[service0 service0]$
  • Suffer a catastrophic failure on your production system.�(We'll simulate this step)

    [root root]# svc -d /service/service0
    +[root root]# mv /var/lib/aolserver/service0/ /var/lib/aolserver/service0.lost
    +[root root]# rm /service/service0
    +rm: remove symbolic link `/service/service0'? y
    +[root root]# ps -auxw | grep service0
    +root      1496  0.0  0.0  1312  252 ?        S    16:58   0:00 supervise service0
    +[root root]# kill 1496
    +[root root]# ps -auxw | grep service0
    +[root root]# su - postgres
    +[postgres pgsql]$ dropdb service0
    +DROP DATABASE
    +[postgres pgsql]$ dropuser service0
    +DROP USER
    +[postgres pgsql]$ exit
    +logout
    +[root root]#
  • Recovery.�

    1. Restore the operating system and required software. You can do this with standard backup processes or by keeping copies of the install material (OS CDs, OpenACS tarball and supporting software) and repeating the install - guide. Recreate the service user (service0).

    2. Restore the OpenACS files and database backup file.

      [root@yourserver root]# su - service0
      -            [service0@yourserver service0]$ cd /var/lib/aolserver
      -            [service0@yourserver aolserver]$ tar xjf /tmp/service0-backup.tar.bz2
      -            [service0@yourserver aolserver]$ chmod -R 775 service0
      -            [service0@yourserver aolserver]$ chown -R service0.web service0
      -
      -            
    3. Restore the database

      • Oracle.�

        1. Set up a clean Oracle database user and - tablespace with the same names as the ones exported from (more information).

        2. Invoke the import command

          imp service0/service0 FILE=/var/lib/aolserver/service0/database-backup/nighty_backup.dmp FULL=Y
      • Postgres.�

        Because of a bug in Postgres backup-recovery, database objects are not guaranteed to be created in the right order. To compensate, we pre-creating some critical items first, which leads to some harmless errors.

        [root@yourserver root]# su - postgres
        -                [postgres@yourserver pgsql]$ createuser service0
        -                Shall the new user be allowed to create databases? (y/n) y
        -                Shall the new user be allowed to create more new users? (y/n) y
        -                CREATE USER
        -                [service0@yourserver web]$ createdb service0
        -                CREATE DATABASE
        -                [service0@yourserver web]$ psql -f /var/lib/aolserver/service0/packages/acs-kernel/sql/postgresql/postgresql.sql service0
        -                (many lines omitted)
        -                [service0@yourserver web]$ psql service0 < /var/lib/aolserver/service0/database-backup/database-backup.dmp
        -                (many lines omitted)
        -                [service0@yourserver web]$ exit
        -                [postgres@yourserver pgsql]$ exit
        -                logout
        -                
    4. Activate the service

      [root@yourserver root]# ln -s /var/lib/aolserver/service0/etc/daemontools /service/service0
      -            [root@yourserver root]# sleep 10
      -            [root@yourserver root]# svgroup web /service/service0
      -            [root@yourserver root]#
  • Automated Backup (OPTIONAL)

    The recommended backup strategy for a production sit is to use an automated script which first backs up the database to a file in /var/lib/aolserver/service0/database-backup and then backs up all of /var/lib/aolserver/service0 to a single zip file, and then copies that zip file to another computer.

    1. Make sure that the manual backup process described above works.

    2. Customize the default backup script. Edit /var/lib/aolserver/service0/etc/backup.sh with your specific parameters.

    3. + guide. Recreate the service user (service0).

    4. Restore the OpenACS files and database backup file.

      [root root]# su - service0
      +[service0 service0]$ cd /var/lib/aolserver
      +[service0 aolserver]$ tar xzf /tmp/service0-backup.tar.gz
      +[service0 aolserver]$ chmod -R 775 service0
      +[service0 aolserver]$ chown -R service0.web service0
    5. Restore the database

      • Oracle.�

        1. Set up a clean Oracle database user and + tablespace with the same names as the ones exported from (more information).

        2. Invoke the import command

          imp service0/service0 FILE=/var/lib/aolserver/service0/database-backup/nighty_backup.dmp FULL=Y
      • Postgres.�If the database user does not already exist, create it.

        [root root]# su - postgres
        +[postgres ~]$ createuser service0
        +Shall the new user be allowed to create databases? (y/n) y
        +Shall the new user be allowed to create more new users? (y/n) y
        +CREATE USER
        +[postgres ~]$ exit
        +

        Because of a bug in Postgres backup-recovery, database objects are not guaranteed to be created in the right order. In practice, running the OpenACS initialization script is always sufficient to create any out-of-order database objects. Next, restore the database from the dump file. The restoration will show some error messages at the beginning for objects that were pre-created from the OpenACS initialization script, which can be ignored.

        [root root]# su - service0
        +[service0 ~]$ createdb service0
        +CREATE DATABASE
        +[service0 ~]$ psql -f /var/lib/aolserver/service0/packages/acs-kernel/sql/postgresql/postgresql.sql service0
        +(many lines omitted)
        +[service0 ~]$ psql service0 < /var/lib/aolserver/service0/database-backup/database-backup.dmp
        +(many lines omitted)
        +[service0 ~]$ exit
        +[postgres ~]$ exit
        +logout
    6. Activate the service

      [root root]# ln -s /var/lib/aolserver/service0/etc/daemontools /service/service0
      +[root root]# sleep 10
      +[root root]# svgroup web /service/service0

    Automated Backup (OPTIONAL)

    The recommended backup strategy for a production sit is to use an automated script which first backs up the database to a file in /var/lib/aolserver/service0/database-backup and then backs up all of /var/lib/aolserver/service0 to a single zip file, and then copies that zip file to another computer.

    1. Make sure that the manual backup process described above works.

    2. Customize the default backup script. Edit /var/lib/aolserver/service0/etc/backup.sh with your specific parameters.

    3. Make sure the file is executable:

      chmod +x backup.sh
    4. Set this file to run automatically by adding a line to root's crontab. (Typically, with export EDITOR=emacs; crontab -e.) This example runs the backup script at 1:30 am every day.

      30 1 * * * *        sh /var/lib/aolserver/service0/etc/backup.sh

    Using CVS for backup-recovery

    CVS-only backup is often appropriate for development sites. If you are already using CVS and your data is not important, you probably don't - need to do anything to back up your files. Just make - sure that your current work is checked into the system. - You can then roll back based on date - note the - current system time, down to the minute. For maximum - safety, you can apply a tag to your current - files. You will still need to back up your database.

    Note that, if you did the CVS options in this document, the /var/lib/aolserver/service0/etc directory is not included in cvs and you may want to add it.

    [root@localhost root]# su - service0
    -    [service0@localhost service0]$ cd /var/lib/aolserver/service0
    -    [service0@localhost service0]$ cvs commit -m "last-minute commits before upgrade to 4.6"
    -    cvs commit: Examining .
    -    cvs commit: Examining bin
    -    (many lines omitted)
    -    [service0@localhost service0]$ cvs tag before_upgrade_to_4_6
    -    cvs server: Tagging bin
    -    T bin/acs-4-0-publish.sh
    -    T bin/ad-context-server.pl
    -    (many lines omitted)
    -    [service0@localhost service0]$ exit
    -    [root@localhost root]# 
    -    
    su - service0
    -    cd /var/lib/aolserver/service0
    -    cvs commit -m "last-minute commits before upgrade to 4.6"
    -    cvs tag before_upgrade_to_4_6
    -    exit

    To restore files from a cvs tag such as the one used above:

    [root@localhost root]# su - service0
    -    [service0@localhost service0]$ cd /var/lib/aolserver/service0
    -    [service0@localhost service0]$ cvs up -r current
    -    [service0@localhost service0]$ exit
    -    
    su - service0
    -    cd /var/lib/aolserver/service0
    -    cvs up -r current
    ($Id$)
    View comments on this page at openacs.org
    + need to do anything to back up your files. Just make + sure that your current work is checked into the system. + You can then roll back based on date - note the + current system time, down to the minute. For maximum + safety, you can apply a tag to your current + files. You will still need to back up your database.

    Note that, if you did the CVS options in this document, the /var/lib/aolserver/service0/etc directory is not included in cvs and you may want to add it.

    [root root]# su - service0
    +[service0 service0]$ cd /var/lib/aolserver/service0
    +[service0 service0]$ cvs commit -m "last-minute commits before upgrade to 4.6"
    +cvs commit: Examining .
    +cvs commit: Examining bin
    +(many lines omitted)
    +[service0 service0]$ cvs tag before_upgrade_to_4_6
    +cvs server: Tagging bin
    +T bin/acs-4-0-publish.sh
    +T bin/ad-context-server.pl
    +(many lines omitted)
    +[service0 service0]$ exit
    +[root root]# 
    +su - service0
    +cd /var/lib/aolserver/service0
    +cvs commit -m "last-minute commits before upgrade to 4.6"
    +cvs tag before_upgrade_to_4_6
    +exit

    To restore files from a cvs tag such as the one used above:

    [root root]# su - service0
    +[service0 service0]$ cd /var/lib/aolserver/service0
    +[service0 service0]$ cvs up -r current
    +[service0 service0]$ exit
    +su - service0
    +cd /var/lib/aolserver/service0
    +cvs up -r current
    ($Id$)
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/bootstrap-acs.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/bootstrap-acs.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/bootstrap-acs.html 11 Dec 2003 23:08:45 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/bootstrap-acs.html 4 Feb 2004 16:47:32 -0000 1.25 @@ -1,4 +1,4 @@ -Bootstrapping OpenACS

    Bootstrapping OpenACS

    By Jon Salz

    +Bootstrapping OpenACS

    Bootstrapping OpenACS

    By Jon Salz

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.
    • Tcl code: /tcl/0-acs-init.tcl and /packages/acs-kernel/bootstrap.tcl

    This document describes the startup (bootstrapping) process for an AOLserver Index: openacs-4/packages/acs-core-docs/www/complete-install.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/complete-install.html,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/acs-core-docs/www/complete-install.html 11 Dec 2003 23:08:45 -0000 1.6 +++ openacs-4/packages/acs-core-docs/www/complete-install.html 4 Feb 2004 16:47:32 -0000 1.7 @@ -1 +1 @@ -Chapter�3.�Complete Installation

    View comments on this page at openacs.org
    +Chapter�3.�Complete Installation
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/configuring-new-site.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/configuring-new-site.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/configuring-new-site.html 4 Feb 2004 16:47:32 -0000 1.2 @@ -0,0 +1,4 @@ +Chapter�4.�Configuring a new OpenACS Site

    Chapter�4.�Configuring a new OpenACS Site

    Table of Contents

    How Do I?

    by Joel Aufrecht

    + OpenACS docs are written by the named authors, and may be edited + by OpenACS documentation staff. +

    In this chapter, Configuring refers to making changes to a new OpenACS site through the web interface. In crude terms, these changes happen in the database, and are upgrade-safe. Customizing refers to changes that touch the file system, and require some planning if easy upgradability is to be maintained.

    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/credits.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/credits.html,v diff -u -N -r1.23 -r1.24 --- openacs-4/packages/acs-core-docs/www/credits.html 19 Nov 2003 15:44:49 -0000 1.23 +++ openacs-4/packages/acs-core-docs/www/credits.html 4 Feb 2004 16:47:32 -0000 1.24 @@ -1,4 +1,4 @@ -Appendix�C.�Credits

    Appendix�C.�Credits

    By Vinod Kurup

    +Appendix�C.�Credits

    Appendix�C.�Credits

    By Vinod Kurup

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    Vinod Kurup put @@ -32,4 +32,4 @@

    All questions and comments regarding this guide should be posted on the OpenACS forums. -

    ($Id$)
    View comments on this page at openacs.org
    +

    ($Id$)
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/cvs-tips.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/cvs-tips.html,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/acs-core-docs/www/cvs-tips.html 11 Dec 2003 23:08:45 -0000 1.8 +++ openacs-4/packages/acs-core-docs/www/cvs-tips.html 4 Feb 2004 16:47:32 -0000 1.9 @@ -1,19 +1,17 @@ -Appendix�D.�Using CVS with an OpenACS Site

    Appendix�D.�Using CVS with an OpenACS Site

    By Joel Aufrecht

    +Appendix�D.�Using CVS with an OpenACS Site

    Appendix�D.�Using CVS with an OpenACS Site

    By Joel Aufrecht

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

    Add the Service to CVS - OPTIONAL.� - These steps take an existing OpenACS directory and add +

    Add the Service to CVS - OPTIONAL.�These steps take an existing OpenACS directory and add it to a CVS - repository. -

    1. Create and set permissions on a subdirectory in the local cvs repository.

      [root@yourserver root]# mkdir /cvsroot/service0
      -[root@yourserver root]# chown service0.web /cvsroot/service0
      -[root@yourserver root]#
      +          repository.

      1. Create and set permissions on a subdirectory in the local cvs repository.

        [root root]# mkdir /cvsroot/service0
        +[root root]# chown service0.web /cvsroot/service0
        +[root root]#
         mkdir /cvsroot/service0
        -chown service0.web /cvsroot/service0
      2. Add the repository location to the user environment.

        [root@yourserver root]# su - service0
        -[service0@yourserver service0]$ emacs .bashrc

        Put this string into /home/service0/.bashrc:

        export CVSROOT=/cvsroot
        [service0@yourserver service0]$ exit
        +chown service0.web /cvsroot/service0
      3. Add the repository location to the user environment.

        [root root]# su - service0
        +[service0 service0]$ emacs .bashrc

        Put this string into /home/service0/.bashrc:

        export CVSROOT=/cvsroot
        [service0 service0]$ exit
         logout
         
        -[root@yourserver root]#
      4. Import all files into cvs. In order to work on +[root root]#

    2. Import all files into cvs. In order to work on files with source control, the files must be checked out from cvs. So we will import, move aside, and then check out all of the files. In the cvs import command, @@ -22,33 +20,33 @@ plus this string, i.e. /cvsroot/service0. - "OpenACS" is the vendor tag, and "openacs-5-0-0b4" is the + "OpenACS" is the vendor tag, and "" is the release tag. These tags will be useful in upgrading and - branching. -m sets the version comment.

      [root@yourserver root]# su - service0
      -[service0@yourserver service0]$ cd /web/service0
      -[service0@yourserver service0]$ cvs import -m "initial install" service0 OpenACS openacs-5-0-0b4
      +            branching.  -m sets the version comment.

      [root root]# su - service0
      +[service0 service0]$ cd /web/service0
      +[service0 service0]$ cvs import -m "initial install" service0 OpenACS 
       N service0/license.txt
       N service0/readme.txt
       (many lines omitted)
       N service0/www/SYSTEM/flush-memoized-statement.tcl
       
       No conflicts created by this import
       
      -[service0@yourserver service0]$
      +[service0 service0]$
       su - service0
       cd /web/service0
      -cvs import -m "initial install" service0 OpenACS openacs-5-0-0b4

      Move the original directory to a temporary location, and check out the cvs repository in its place. If the service starts correctly, come back and remove the temporary copy of the uploaded files.

      [service0@yourserver service0]$ cd ..
      -[service0@yourserver web]$ mv service0 service0.orig
      -[service0@yourserver web]$ cvs checkout service0
      +cvs import -m "initial install" service0 OpenACS 

      Move the original directory to a temporary location, and check out the cvs repository in its place. If the service starts correctly, come back and remove the temporary copy of the uploaded files.

      [service0 service0]$ cd ..
      +[service0 web]$ mv service0 service0.orig
      +[service0 web]$ cvs checkout service0
       cvs checkout: Updating service0
       U service0/license.txt
       (many lines omitted)
       U service0/www/SYSTEM/dbtest.tcl
       U service0/www/SYSTEM/flush-memoized-statement.tcl
      -[service0@yourserver web]$ exit
      +[service0 web]$ exit
       logout
       
      -[root@yourserver web]#
      +[root web]#
       cd ..
       mv service0 service0.orig
       cvs checkout service0
      Index: openacs-4/packages/acs-core-docs/www/database-management.html
      ===================================================================
      RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/database-management.html,v
      diff -u -N -r1.16 -r1.17
      --- openacs-4/packages/acs-core-docs/www/database-management.html	11 Dec 2003 23:08:45 -0000	1.16
      +++ openacs-4/packages/acs-core-docs/www/database-management.html	4 Feb 2004 16:47:32 -0000	1.17
      @@ -1,4 +1,4 @@
      -Database Management

      Database Management

      By Joel Aufrecht

      +Database Management

      Database Management

      By Joel Aufrecht

      OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

      Running a PostgreSQL database on another server

      To run a database on a different machine than the @@ -10,25 +10,21 @@ permit specific remote clients to access. Access can be controlled ... (add notes from forum post)

    3. Change the OpenACS service's configuration file to point to the remote database. Edit - /web/service0/etc/config.tcl + /var/lib/aolserver/service0/etc/config.tcl and change

      to

    Deleting a tablespace

    Skip down for instructions on Deleting a PostgreSQL tablespace.

    Deleting an Oracle tablespace

    Should it become necessary to rebuild a tablespace from scratch, you can use the drop user command in SVRMGRL with the cascade option. This command will drop the user and every database object - the user owns.

    -SVRMGR> drop user service0 cascade;

    + the user owns.

    SVRMGR> drop user service0 cascade;

    If this does not work because svrmgrl "cannot drop a user that is currently connected", make sure to kill the AOLserver using - this user. If it still does not work, do:

    -SVRMGR> select username, sid, serial# from v$session where lower(username)='service0';

    and then

    -SVRMGR> alter system kill session 'sid,serial#';

    + this user. If it still does not work, do:

    SVRMGR> select username, sid, serial# from v$session where lower(username)='service0';

    and then

    SVRMGR> alter system kill session 'sid, serial#';

    where sid and serial# are replaced with the corresponding values for the open session.

    Use with caution!

    If you feel the need to delete everything - related to the service, you can also issue the following:

    -SVRMGR> drop tablespace service0 including contents cascade constraints;

    Deleting a PostgreSQL tablespace

    + related to the service, you can also issue the following:

    SVRMGR> drop tablespace service0 including contents cascade constraints;

    Deleting a PostgreSQL tablespace

    Dropping a PostgreSQL tablespace is easy. You have to stop any AOLserver instances that are using the database that you wish to drop. If you're using daemontools, this is simple, just use the @@ -37,7 +33,7 @@ reread the inittab with /sbin/init q, and then restart-aolserver service0.

    Then, to drop the db, just do:

    -service0:~$ dropdb service0
    +[service0 ~]$ dropdb service0
     DROP DATABASE

    Vacuum Postgres nightly

    The "vacuum" command must be run periodically to reclaim space. The "vacuum analyze" form additionally collects statistics on the @@ -51,7 +47,6 @@ backup! The "vacuum" command is very reliable, but conservatism is the key to good system management. So, if you're using the export procedure described above, you don't need to do this extra step. -

    Edit your crontab:

    -joeuser:~$ crontab -e

    We'll set vacuum up to run nightly at 1 AM. Add the following +

    Edit your crontab:

    [joeuser ~]$ crontab -e

    We'll set vacuum up to run nightly at 1 AM. Add the following line:

    -0 1 * * * /usr/local/pgsql/bin/vacuumdb birdnotes
    ($Id$)
    View comments on this page at openacs.org
    +0 1 * * * /usr/local/pgsql/bin/vacuumdb service0
    ($Id$)
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/db-api-detailed.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/db-api-detailed.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/db-api-detailed.html 11 Dec 2003 23:08:45 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/db-api-detailed.html 4 Feb 2004 16:47:32 -0000 1.25 @@ -1,4 +1,4 @@ -Database Access API

    Database Access API

    By Jon Salz. Revised and expanded by Roberto Mello (rmello at fslc dot usu dot edu), July 2002.

    +Database Access API

    Database Access API

    By Jon Salz. Revised and expanded by Roberto Mello (rmello at fslc dot usu dot edu), July 2002.

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.
    • Tcl procedures: /packages/acs-kernel/10-database-procs.tcl

    • Tcl initialization: /packages/acs-kernel/database-init.tcl

    The Big Picture

    Index: openacs-4/packages/acs-core-docs/www/db-api.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/db-api.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/db-api.html 11 Dec 2003 23:08:45 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/db-api.html 4 Feb 2004 16:47:32 -0000 1.25 @@ -1,4 +1,4 @@ -The OpenACS Database Access API

    The OpenACS Database Access API

    +The OpenACS Database Access API

    The OpenACS Database Access API

    By Pete Su and Jon Salz. Modified by Roberto Mello.

    Overview

    One of OpenACS's great strengths is that code written for it is Index: openacs-4/packages/acs-core-docs/www/dev-guide.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/dev-guide.html,v diff -u -N -r1.19 -r1.20 --- openacs-4/packages/acs-core-docs/www/dev-guide.html 11 Dec 2003 23:08:45 -0000 1.19 +++ openacs-4/packages/acs-core-docs/www/dev-guide.html 4 Feb 2004 16:47:32 -0000 1.20 @@ -1 +1 @@ -Chapter�8.�Development Reference

    View comments on this page at openacs.org
    +Chapter�8.�Development Reference
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/doc-standards.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/doc-standards.html,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-core-docs/www/doc-standards.html 11 Dec 2003 21:39:47 -0000 1.2 +++ openacs-4/packages/acs-core-docs/www/doc-standards.html 4 Feb 2004 16:47:32 -0000 1.3 @@ -1 +1 @@ -Chapter�10.�Documentation Standards
    View comments on this page at openacs.org
    +Chapter�10.�Documentation Standards
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/docbook-primer.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/docbook-primer.html,v diff -u -N -r1.25 -r1.26 --- openacs-4/packages/acs-core-docs/www/docbook-primer.html 11 Dec 2003 23:08:45 -0000 1.25 +++ openacs-4/packages/acs-core-docs/www/docbook-primer.html 4 Feb 2004 16:47:32 -0000 1.26 @@ -1,4 +1,4 @@ -OpenACS Documentation Guide

    OpenACS Documentation Guide

    +OpenACS Documentation Guide

    OpenACS Documentation Guide

    By Claus Rasmussen, with additions by Roberto Mello and the OpenACS Community

    Overview of OpenACS Documentation

    @@ -36,7 +36,7 @@ In order to separate content and presentation, all OpenACS documentation will be marked up to conform to the DocBook XML DTD - + This enables us to publish in a variety of formats and relieves each contributor of the burden of presentation, freeing him to focus on content and sharing knowledge. @@ -57,7 +57,7 @@ list of elements and use more exotic features in your documents. The list is made up of SGML-elements but basically the same elements are valid in the XML DTD as long as you remember to: - +

    • Always close your tags with corresponding end-tags and to not use other tag minimization @@ -106,7 +106,7 @@ The documentation for each package will make up a little "book" that is structured like this - examples are emphasized: - +

           book                        : Docs for one package - templating
      @@ -130,20 +130,20 @@
             sources of these DocBook documents
             to get an idea of how they are tied together.
           

    Headlines, Sections

    - + Given that your job starts at the sect1-level, all your documents should open with a <sect1>-tag and end with the corresponding </sect1>.

    - + You need to feed every <sect1> two attributes. The first attribute, id, is standard and can be used with all elements. It comes in very handy when interlinking between documents (more about this when talking about links in the section called “Links”). The value of id has to be unique throughout the book you're making since the id's in your sect1's will turn into filenames when the book is parsed into HTML.

    - + The other attribute is xreflabel. The value of this is the text that will appear as the link when referring to this sect1.

    @@ -158,7 +158,7 @@ </sect1>

    - + Inside this container your document will be split up into <sect2>'s, each with the same requirements - id and xreflabel @@ -167,7 +167,7 @@ When it comes to naming your sect2's and below, prefix them with some abbreviation of the id in the sect1 such as requirements-overview.

    Code

    - + For displaying a snippet of code, a filename or anything else you just want to appear as a part of a sentence, we will use the tag <computeroutput>. @@ -177,12 +177,12 @@ <programlisting> is used. Just wrap your code block in it; mono-spacing, indents and all that stuff is taken care of automatically.

    Links

    - + Linking falls into two different categories: inside the book you're making and outside:

    1. Inside linking, cross-referencing other parts of your book

    By having unique id's you can cross-reference any part of your book with a simple tag, regardless of where that part is. -

    Check out how I link to a subsection of the Developer's Guide:

    Put this in your XML:

    +	  

    Check out how I link to a subsection of the Developer's Guide:

    Put this in your XML:

     - Find information about creating a package in
     <xref linkend="packages-making-a-package"></xref>.
     

    And the output is:

    @@ -206,7 +206,7 @@
     	    packages-looks, the
     	    parser will try its best to explain where the link takes you.
     	  

    2. Linking outside the documentation

    - + If you're hyper-linking out of the documentation, it works almost the same way as HTML - the tag is just a little different @@ -227,7 +227,7 @@ do it, so if you want to start converting your documents right away, start out with the ones without graphics ;)

    - + To insert a graphic we use the elements <mediaobject>, <imageobject>, @@ -253,7 +253,7 @@ Put your graphics in a separate directory ("images") and link to them only with relative paths.

    Lists

    - + Here's how you make the DocBook equivalent of the three usual HTML-lists:

    1. How to make an <ul>

    Making an unordered list is pretty much like doing the same thing in HTML - if you close your <li>, that is. The only differences are that each list item has to be wrapped in something more, such as @@ -298,7 +298,7 @@ </variablelist>

    Tables

    - + DocBook supports several types of tables, but in most cases, the <informaltable> is enough: @@ -335,7 +335,7 @@ <table> for an example.

    Emphasis

    - + Our documentation uses two flavors of emphasis - italics and bold type. DocBook uses one - <emphasis>.

    @@ -378,8 +378,8 @@ bash$ xsltproc /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl filename.xml

    You could also look at the acs-core-docs Makefile - for examples of how these documents are generated.` -

    Further Reading

    • + for examples of how these documents are generated. +

    Further Reading

    • Using Xinclude

    • The LDP Author Guide has a lot of good information, a table of docbook elements and their "look" in HTML and lots of good links Index: openacs-4/packages/acs-core-docs/www/eng-standards-constraint-naming.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/eng-standards-constraint-naming.html,v diff -u -N -r1.23 -r1.24 --- openacs-4/packages/acs-core-docs/www/eng-standards-constraint-naming.html 19 Nov 2003 15:44:50 -0000 1.23 +++ openacs-4/packages/acs-core-docs/www/eng-standards-constraint-naming.html 4 Feb 2004 16:47:32 -0000 1.24 @@ -1,4 +1,4 @@ -Constraint naming standard

      Constraint naming standard

      By Michael Bryzek

      +Constraint naming standard

      Constraint naming standard

      By Michael Bryzek

      OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

      The Big Picture

      Index: openacs-4/packages/acs-core-docs/www/eng-standards-filenaming.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/eng-standards-filenaming.html,v diff -u -N -r1.23 -r1.24 --- openacs-4/packages/acs-core-docs/www/eng-standards-filenaming.html 19 Nov 2003 15:44:50 -0000 1.23 +++ openacs-4/packages/acs-core-docs/www/eng-standards-filenaming.html 4 Feb 2004 16:47:32 -0000 1.24 @@ -1,4 +1,4 @@ -ACS File Naming and Formatting Standards

      ACS File Naming and Formatting Standards

      By Michael Yoon and Aurelius Prochazka

      +ACS File Naming and Formatting Standards

      ACS File Naming and Formatting Standards

      By Michael Yoon and Aurelius Prochazka

      OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

      Index: openacs-4/packages/acs-core-docs/www/eng-standards-plsql.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/eng-standards-plsql.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/eng-standards-plsql.html 11 Dec 2003 23:08:46 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/eng-standards-plsql.html 4 Feb 2004 16:47:32 -0000 1.25 @@ -1,4 +1,4 @@ -PL/SQL Standards

      PL/SQL Standards

      +PL/SQL Standards

      PL/SQL Standards

      By Richard Li and Yon Feldman

      OpenACS docs are written by the named authors, and may be edited Index: openacs-4/packages/acs-core-docs/www/eng-standards-versioning.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/eng-standards-versioning.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/eng-standards-versioning.html 11 Dec 2003 23:08:46 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/eng-standards-versioning.html 4 Feb 2004 16:47:32 -0000 1.25 @@ -1,41 +1,26 @@ -Release Version Numbering

      Release Version Numbering

      By Ron Henderson

      +Release Version Numbering

      Release Version Numbering

      By Ron Henderson

      Revised by Joel Aufrecht

      OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

      OpenACS version numbers help identify at a high-level what is in a particular release and what has changed since the last release. A "version number" is really just a string of the form: -

      major-minor-release

      -A change in the major version number indicates a fundamental -change in the architecture of the system, e.g. OpenACS 3 to ACS 4. A -change in the minor version number signifies the addition of -new modules and minor data model changes, e.g. OpenACS 3.1 to OpenACS 3.2. -The final release number indicates the relative maturity of a -release and marks things like bug fixes; it follows the ordered -progression: -

      -alpha
      -beta
      -0 (production release)
      -1
      -2
      -...
      -

      -So typical release version numbers would be: -

      -openacs-3.2.5
      -openacs-4.0.beta
      -

      -The first is a relatively mature release of the OpenACS 3.2 base code -and the second is a non-public release of OpenACS 4.0 that probably still -has lots of bugs. -

      +

      major.minor.dot[ milestone ]

      • A major number change indicates a fundamental change in the architecture of the system, e.g. OpenACS 3 to ACS 4. A major change is required if core backwards compatibility is broken, if upgrade is non-trivial, or if the platform changes substantially.

      • A minor change represents the addition of new functionality or changed UI.

      • A dot holds only bug fixes and security patches. Dot releases are always recommended and safe. +

      • A milestone marker indicates the state of the release:

        • d, for development, means the release is in active development and is not in its intended released form.

        • a, for alpha, means new development is complete and code checkins are frozen. Alpha builds should work well enough to be testable.

        • b, for beta, means most severe bugs are fixed and end users can start trying the release.

        • Release Candidate builds (rc) are believed to meet all of the criteria for release and can be installed on test instances of production systems.

        • Final releases have no milestone marker. (Exception: In CVS, they are tagged with -final to differentiate them from branch tags.) +

        Milestone markers are numbered: d1, d2, ..., a1, b1, rc1, etc.

      A complete sequence of milestones between two releases:

      5.0.0
      +5.0.0rc2
      +5.0.0rc1
      +5.0.0b4
      +5.0.0b1
      +5.0.0a4
      +5.0.0a3
      +5.0.0a1
      +5.0.0d1
      +4.6.3

      Version numbers are also recorded in the CVS repository so that the code tree can be restored to the exact state it was in for a particular release. To translate between a distribution tar file -(acs-3.2.2.tar.gz) and a CVS tag, just swap '.' for '-' and add the -release date. The entire release history of the toolkit is recorded -in the tags for the top-level readme.txt file: +(acs-3.2.2.tar.gz) and a CVS tag, just swap '.' for '-'.The entire release history of the toolkit is recorded in the tags for the top-level readme.txt file:

       > cvs log readme.txt
       RCS file: /usr/local/cvsroot/acs/readme.txt,v
      @@ -74,20 +59,4 @@
       

      Transition Rules

      So what distinguishes an alpha release from a beta release? Or from a production release? We follow a specific set of rules for how OpenACS makes the transition from one state of maturity to -the next.

      Every release must pass the minimum requirements that it cleanly -installs and cleanly upgrades from the previous version of OpenACS. In -addition to this the release label implies:

      development -

      This is the default state for the head of the current release branch. We -make no guarantees about this code.

      alpha -

      All tickets of severity critical have been closed and the -distribution has no known installation or upgrade problems.

      beta -

      All tickets of severity serious or greater have been closed -and all documentation is up to date (version history, release notes, -new module docs, etc.).

      production [0, 1, ...] -

      All tickets of severity medium or greater have been closed, -including issues reported from outside users.

      In the future we will guarantee that more mature releases -incorporate all the fixes for earlier problems by developing a -detailed set of regression tests. For now we try to enforce this by -restricting work on the release branch to fixing reported problem in -the current release, e.g. no new features or big changes to -fundamental behavior.

      ($Id$)
      View comments on this page at openacs.org
      +the next. These rules are fine-tuned with each release; an example is 5.0.0 Milestones and Milestone Criteria

      ($Id$)
      View comments on this page at openacs.org
      Index: openacs-4/packages/acs-core-docs/www/eng-standards.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/eng-standards.html,v diff -u -N -r1.16 -r1.17 --- openacs-4/packages/acs-core-docs/www/eng-standards.html 11 Dec 2003 23:08:46 -0000 1.16 +++ openacs-4/packages/acs-core-docs/www/eng-standards.html 4 Feb 2004 16:47:32 -0000 1.17 @@ -1 +1 @@ -Chapter�9.�Engineering Standards
      View comments on this page at openacs.org
      +Chapter�9.�Engineering Standards
      View comments on this page at openacs.org
      Index: openacs-4/packages/acs-core-docs/www/ext-auth-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/ext-auth-requirements.html,v diff -u -N -r1.13 -r1.14 --- openacs-4/packages/acs-core-docs/www/ext-auth-requirements.html 11 Dec 2003 23:08:46 -0000 1.13 +++ openacs-4/packages/acs-core-docs/www/ext-auth-requirements.html 4 Feb 2004 16:47:32 -0000 1.14 @@ -1,4 +1,4 @@ -External Authentication Requirements

      External Authentication Requirements

      Vision

      People have plenty of usernames and passwords already, we +External Authentication Requirements

      External Authentication Requirements

      Vision

      People have plenty of usernames and passwords already, we don't want them to have yet another. We want people to be able to log in to OpenACS with the same password they use to log in to any other system.

      Besides, administrators have better things to do than create @@ -44,7 +44,7 @@ only one implementation of the authentication API, namly the one included in OpenACS Core.

    • Authentication Driver API: The service contract which authentication drivers implement.

    Conceptual Pictures

    Authentication:

    -

    Account Management (NO PICTURE YET)

    Batch Synchronization (NO PICTURE YET)

    Requirements

    New API

    FeatureStatusDescription
    EXT-AUTH-01AExtend Authentication/Acct Status API
    EXT-AUTH-03AAccount Creation API
    EXT-AUTH-05APassword Management API
    EXT-AUTH-30AAuthority Management API

    Login

    FeatureStatusDescription
    EXT-AUTH-04ARewrite login, register, and admin pages to use APIs
    EXT-AUTH-38Aad_form complain feature
    EXT-AUTH-19ARewrite password recovery to use API
    EXT-AUTH-21ARewrite email verification with API
    EXT-AUTH-28AUsername is email switch

    Users will log in using a username, a authority, and a +

    Account Management (NO PICTURE YET)

    Batch Synchronization (NO PICTURE YET)

    Requirements

    New API

    FeatureStatusDescription
    EXT-AUTH-01AExtend Authentication/Acct Status API
    EXT-AUTH-03AAccount Creation API
    EXT-AUTH-05APassword Management API
    EXT-AUTH-30AAuthority Management API

    Login

    FeatureStatusDescription
    EXT-AUTH-04ARewrite login, register, and admin pages to use APIs
    EXT-AUTH-38Aad_form complain feature
    EXT-AUTH-19ARewrite password recovery to use API
    EXT-AUTH-21ARewrite email verification with API
    EXT-AUTH-28AUsername is email switch

    Users will log in using a username, a authority, and a password. The authority is the source for user/password verification. OpenACS can be an authority itself.

    Each user in OpenACS will belong to exactly one authority, which can either be the "local" OpenACS users table, in which case the Index: openacs-4/packages/acs-core-docs/www/filename.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/filename.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/filename.html 11 Dec 2003 23:08:46 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/filename.html 4 Feb 2004 16:47:32 -0000 1.25 @@ -1,4 +1,4 @@ -Detailed Design Documentation Template

    Detailed Design Documentation Template

    By You

    Start Note

    +Detailed Design Documentation Template

    Detailed Design Documentation Template

    By You

    Start Note

    NOTE: Some of the sections of this template may not apply to your package, e.g. there may be no user-visible UI elements for a component of the OpenACS Core. Furthermore, it may be easier in some circumstances @@ -114,7 +114,7 @@ within the OpenACS, this section's details are likely to shift from UI specifics to template interface specifics.

    Configuration/Parameters

    - Under OpenACS 5.0.0b4, parameters are set at two levels: at the global level by + Under OpenACS , parameters are set at two levels: at the global level by the OpenACS-admin, and at the subsite level by a sub-admin. In this section, list and discuss both levels of parameters.

    Future Improvements/Areas of Likely Change

    Index: openacs-4/packages/acs-core-docs/www/for-everyone.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/for-everyone.html,v diff -u -N -r1.14 -r1.15 --- openacs-4/packages/acs-core-docs/www/for-everyone.html 19 Nov 2003 15:44:50 -0000 1.14 +++ openacs-4/packages/acs-core-docs/www/for-everyone.html 4 Feb 2004 16:47:32 -0000 1.15 @@ -1 +1 @@ -Part�I.�OpenACS For Everyone

    View comments on this page at openacs.org
    +Part�I.�OpenACS For Everyone
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/form-builder.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/form-builder.html,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-core-docs/www/form-builder.html 11 Dec 2003 23:08:46 -0000 1.3 +++ openacs-4/packages/acs-core-docs/www/form-builder.html 4 Feb 2004 16:47:32 -0000 1.4 @@ -1,4 +1,4 @@ -Using HTML Forms

    Using HTML Forms

    Overview

    Multi-part Elements

    Some elements have more than one choice, or can submit more than one value.

    SELECT elements

    1. Creating the form element.�Populate a list of lists with values for the option list.

      set foo_options [db_list_of_lists foo_option_list "
      +Using HTML Forms

      Using HTML Forms

      Overview

      Multi-part Elements

      Some elements have more than one choice, or can submit more than one value.

      SELECT elements

      1. Creating the form element.�Populate a list of lists with values for the option list.

        set foo_options [db_list_of_lists foo_option_list "
             select foo,
                    foo_id
               from foos
        @@ -9,4 +9,6 @@
                 {options $foo_options}
             }

        This will result in a single name/value pair coming back in the submitted form. Handle this within the same ad_form structure, in the -new_data and -edit_data. In the example, it is available as $foo

      See also the W3C spec for "The SELECT, OPTGROUP, and OPTION elements". -

      ($Id$)
      View comments on this page at openacs.org
      +

    Common Errors

    Here are some common errors and what to do when you + encounter them:

    Error when selecting values

    This generally happens when there is an error in your + query.

    ($Id$)
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/general-documents.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/general-documents.html,v diff -u -N -r1.14 -r1.15 --- openacs-4/packages/acs-core-docs/www/general-documents.html 19 Nov 2003 15:44:50 -0000 1.14 +++ openacs-4/packages/acs-core-docs/www/general-documents.html 4 Feb 2004 16:47:32 -0000 1.15 @@ -1 +1 @@ -Chapter�1.�High level information: What is OpenACS?

    Chapter�1.�High level information: What is OpenACS?

    View comments on this page at openacs.org
    +Chapter�1.�High level information: What is OpenACS?

    Chapter�1.�High level information: What is OpenACS?

    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/groups-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/groups-design.html,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/acs-core-docs/www/groups-design.html 11 Dec 2003 23:08:46 -0000 1.17 +++ openacs-4/packages/acs-core-docs/www/groups-design.html 4 Feb 2004 16:47:32 -0000 1.18 @@ -1,4 +1,4 @@ -Groups Design

    Groups Design

    By Rafael H. Schloming and Mark Thomas

    +Groups Design

    Groups Design

    By Rafael H. Schloming and Mark Thomas

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    Essentials

    Revision History

    Document Revision #Action Taken, NotesWhen?By Whom?
    0.1Creation08/22/2000Rafael H. Schloming
    0.2Initial Revision08/30/2000 +

    Mark Thomas

    Revision History

    Document Revision #Action Taken, NotesWhen?By Whom?
    0.1Creation08/22/2000Rafael H. Schloming
    0.2Initial Revision08/30/2000 Mark Thomas
    0.3Additional revisions; tried to clarify membership/compostion09/08/2000 Mark Thomas Index: openacs-4/packages/acs-core-docs/www/groups-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/groups-requirements.html,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/acs-core-docs/www/groups-requirements.html 11 Dec 2003 23:08:46 -0000 1.17 +++ openacs-4/packages/acs-core-docs/www/groups-requirements.html 4 Feb 2004 16:47:32 -0000 1.18 @@ -1,4 +1,4 @@ -Groups Requirements

    Groups Requirements

    By Rafael H. Schloming, Mark Thomas

    +Groups Requirements

    Groups Requirements

    By Rafael H. Schloming, Mark Thomas

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    Introduction

    Almost all database-backed websites have users, and need to model the Index: openacs-4/packages/acs-core-docs/www/how-do-I.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/how-do-I.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/how-do-I.html 4 Feb 2004 16:47:32 -0000 1.2 @@ -0,0 +1,6 @@ +How Do I?

    How Do I?

    How do I edit the front page of a new site through a web interface?

    The easiest way is to install the Edit-This-Page package.

    1. Log in to the web site as an administrator.

    2. Click on Admin > Install Software > Install from OpenACS Repository / Install new application

    3. + Choose Edit This Page and install +
    4. Follow the instructions within Edit This Page (the link will only work after Edit This Page is installed).

    How do I let anybody who registers post to a weblog?

    Go to /admin/permissions and grant Create to Registered Users

    How do I replace the front page of a new site with the front page of an application on that site

    Suppose you install a new site and install Weblogger, and you want all visitors to see weblogger automatically.

    1. On the front page, click the Admin button.

    2. On the administration page, click Parameters link.

    3. Change the parameter IndexRedirectUrl to be the URI of the desired application. For a default weblogger installation, this would be weblogger/. Note the trailing slash.

    How do I put custom functionality on front page of a new site?

    Every page within an OpenACS site is part of a subsite More information). The home page of the entire site is the front page is a special, default instance of a subsite, served from /var/lib/aolserver/service0/www. If an index page is not found there, the default index page for all subsites is used. To customize the code on the front page, copy the default index page from the Subsite package to the Main site and edit it:

    1. cp /var/lib/aolserver/service0/packages/acs-subsite/www/index* /var/lib/aolserver/service0/www
    2. Edit the new index.adp to change the text; you shouldn't need to edit index.tcl unless you are adding new functionality.

    How do I change the site-wide style?

    Almost all pages on an OpenACS site use ACS Templating, and so their appearance is driven by a layer of different files. Let's examine how this works:

    • + A templated page uses an ADP/TCL pair. The first line in the ADP file is usually: +

      <master>

      If it appears exactly like this, without any arguments, the template processer uses default-master for that subsite. For pages in /var/lib/aolserver/service0/www, this is /var/lib/aolserver/service0/www/default-master.adp and the associated .tcl file. +

    • The default-master is itself a normal ADP page. It draws the subsite navigation elements and invokes site-master (/var/lib/aolserver/service0/www/site-master.adp and .tcl)

    • The site-master draws site-wide navigation elements and invokes blank-master (/var/lib/aolserver/service0/www/blank-master.adp and .tcl).

    • Blank-master does HTML housekeeping and provides a framework for special sitewide navigation "meta" elements such as Translator widgets and Admin widgets.

    Figure�4.1.�Site Templates

    Site Templates
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/i18n-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/i18n-requirements.html,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/acs-core-docs/www/i18n-requirements.html 11 Dec 2003 23:08:46 -0000 1.8 +++ openacs-4/packages/acs-core-docs/www/i18n-requirements.html 4 Feb 2004 16:47:32 -0000 1.9 @@ -1,4 +1,4 @@ -OpenACS Internationalization Requirements

    OpenACS Internationalization Requirements

    by Henry Minsky, +OpenACS Internationalization Requirements

    OpenACS Internationalization Requirements

    by Henry Minsky, Yon Feldman, Lars Pind, Peter Marklund, Index: openacs-4/packages/acs-core-docs/www/i18n.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/i18n.html,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/acs-core-docs/www/i18n.html 11 Dec 2003 23:08:46 -0000 1.15 +++ openacs-4/packages/acs-core-docs/www/i18n.html 4 Feb 2004 16:47:32 -0000 1.16 @@ -1,4 +1,4 @@ -Internationalization

    Internationalization

    +Internationalization

    Internationalization

    By Peter Marklund and Lars Pind

    @@ -28,7 +28,17 @@ database must use internationalized functions. All displayed dates must use internationalized functions. All displayed numbers must use internationalized functions. -

    Using the Message Catalog

    +

    AOLserver Configuration for Multilingual Sites

    + For multilingual websites we recommend using the UTF8 + charset. In order for AOLserver to use utf8 you need to set + the config parameters OutputCharset and + URLCharset to utf-8 in your AOLserver config file (use the etc/config.tcl + template file). For sites running on Oracle you need to make + sure that AOLserver is running with the NLS_LANG environment + variable set to .UTF8. You should set this variable in the + nsd-oracle run script (use the + acs-core-docs/www/files/nds-oracle.txt template file). +

    Using the Message Catalog

    Localizable text must be handled in ADP files, in TCL files, and in APM Parameters. OpenACS provides two approaches, message keys and localized ADP files. For ADP pages which are mostly @@ -38,7 +48,7 @@ which are static and mostly text, it may be easier to create a new ADP page for each language. In this case, the pages are distinguished by a file naming convention. -

    Separate Templates for each Locale

    If the request processor finds a file named filename.locale.adp, where locale matches the user's locale, it will process that file instead of filename.adp. For example, for a user with locale tl_PH, the file index.tl_PH.adp, if found, will be used instead of index.adp. The locale-specific file should thus contain text in the language appropriate for that locale. The code in the page, however, should still be in English. Message keys are still processed.

    Message Keys in Template Files (ADP Files)

    +

    Separate Templates for each Locale

    If the request processor finds a file named filename.locale.adp, where locale matches the user's locale, it will process that file instead of filename.adp. For example, for a user with locale tl_PH, the file index.tl_PH.adp, if found, will be used instead of index.adp. The locale-specific file should thus contain text in the language appropriate for that locale. The code in the page, however, should still be in English. Message keys are still processed.

    Message Keys in Template Files (ADP Files)

    Internationalizing templates is about replacing human readable text in a certain language with internal message keys, which can then be dynamically replaced with real human language in @@ -88,7 +98,109 @@ auto-generated by the APM. Example: <_ Title>

    We recommend the short notation for new package development. -

    APM Parameters

    +

    Message Keys in TCL Files

    + In adp files message lookups are typically done with the syntax + \#package_key.message_key\#. In Tcl + files all message lookups *must* be on either of the following formats: +

    +

    • Typical static key lookup: [_ package_key.message_key] - The message key and package key used here must be string literals, they can't result from variable evaluation. +
    • + Static key lookup with non-default locale: [lang::message::lookup $locale package_key.message_key] - The message key and package key used here must be string literals, they can't result from variable evaluation. +
    • + Dynamic key lookup: [lang::util::localize $var_with_embedded_message_keys] - In this case the message keys in the variable var_with_embedded_message_keys must appear as string literals \#package_key.message_key\# somewhere in the code. Here is an example of a dynamic lookup: + + + set message_key_array { + dynamic_key_1 \#package_key.message_key1\# + dynamic_key_2 \#package_key.message_key2\# + } + + set my_text [lang::util::localize $message_key_array([get_dynamic_key])] +

    +

    + Translatable texts in page TCL scripts are often found in page titles, + context bars, and form labels and options. Many times the texts are + enclosed in double quotes. The following is an example of grep commands + that can be used on Linux to highlight translatable text in TCL files: +

    + # Find text in double quotes + find -iname '*.tcl'|xargs egrep -i '"[a-z]' + # Find untranslated text in form labels, options and values + find -iname '*.tcl'|xargs egrep -i '\-(options|label|value)'|egrep -v '<#'|egrep -v '\-(value|label|options)[[:space:]]+\$[a-zA-Z_]+[[:space:]]*\\?[[:space:]]*$' + # Find text in page titles and context bars + find -iname '*.tcl'|xargs egrep -i 'set (title|page_title|context_bar) '|egrep -v '<#' + # Find text in error messages + find -iname '*.tcl'|xargs egrep -i '(ad_complain|ad_return_error)'|egrep -v '<#' +

    + You may mark up translatable text in TCL library files and TCL pages + with temporary tags on the <#key text#> syntax. + If you have a sentence or paragraph of text with + variables and or procedure calls in it you should in most cases + try to turn the whole text into one + message in the catalog (remember that translators is made easier the longer the phrases to translate are). In those cases, follow these steps: +

    • For each message call in the text, decide on a variable name and replace + the procedure call with a variable lookup on the syntax %var_name%. Remember + to initialize a tcl variable with the same name on some line above the text.
    • If the text is in a tcl file you must replace variable lookups + (occurences of $var_name or ${var_name}) with %var_name%
    • You are now ready to follow the normal procedure and mark up the text using a + tempoarary message tag (<#_ text_with_percentage_vars#>) and run the action + replace tags with keys in the APM.

    + The variable values in the message are usually fetched with upvar, here is an example from dotlrn: +

    + ad_return_complaint 1 "Error: A [parameter::get -parameter classes_pretty_name] + must have <em>no</em>[parameter::get -parameter class_instances_pretty_plural] to be deleted" +

    + was replaced by: +

    + set subject [parameter::get -localize -parameter classes_pretty_name] + set class_instances [parameter::get -localize -parameter class_instances_pretty_plural] + + ad_return_complaint 1 [_ dotlrn.class_may_not_be_deleted] +

    + This kind of interpolation also works in adp files where adp variable values will be inserted into the message. +

    + Alternatively, you may pass in an array list of the variable values to be interpolated into the message so that + our example becomes: +

    + set msg_subst_list [list subject [parameter::get -localize -parameter classes_pretty_name] + class_instances [parameter::get -localize -parameter class_instances_pretty_plural]] + + ad_return_complaint 1 [_ dotlrn.class_may_not_be_deleted $msg_subst_list] +

    + When we were done going through the tcl files we ran the following + commands to check for mistakes: +

    + # Message tags should usually not be in curly braces since then the message lookup may not be + # executed then (you can usually replace curly braces with the list command). Find message tags + # in curly braces (should return nothing, or possibly a few lines for inspection) + find -iname '*.tcl'|xargs egrep -i '\{.*<#' + # Check if you've forgotten space between default key and text in message tags (should return nothing) + find -iname '*.tcl'|xargs egrep -i '<#_[^ ]' + # Review the list of tcl files with no message lookups + for tcl_file in $(find -iname '*.tcl'); do egrep -L '(<#|\[_)' $tcl_file; done +

    + When you feel ready you may vist your package in the + package manager + and run the action "Replace tags with keys + and insert into catalog" on the TCL files that you've edited to + replace the temporary tags with calls to the message lookup + procedure. +

    Checking the Consistency of Catalog Files

    + This section describes how to check that the set of keys used in + message lookups in tcl, adp, and info files and the set of keys in + the catalog file are identical. The scripts below assume that + message lookups in adp and info files are on the format + \#package_key.message_key\#, and that message lookups in tcl files + are always is done with one of the valid lookups described above. The script further assumes + that you have perl installed and in your path. Run the script like + this: +

    + acs-lang/bin/check-catalog.sh package_key +

    + where package_key is the key of the package that you want to + test. If you don't provide the package_key argument then all + packages with catalog files will be checked. + The script will run its checks primarily on en_US xml catalog files. +

    APM Parameters

    Some parameters contain text that need to be localized. In this case, instead of storing the real text in the parameter, you should use message keys using the short notation above, @@ -151,98 +263,15 @@ Use the *_pretty version in your ADP page.

    To internationalize numbers, use lc_numeric $value, which formats the number using the appropriate decimal point and thousand separator for the locale. -

    Internationalizing Forms

    When coding forms, remember to use message keys for each piece of text that is user-visible, including form option labels and button labels.

    Internationalizing Existing Packages

    Internationalize Message text in ADP and TCL

    Acs-lang includes tools to automate some +

    Internationalizing Forms

    When coding forms, remember to use message keys for each piece of text that is user-visible, including form option labels and button labels.

    Internationalizing Existing Packages

    Internationalize Message text in ADP and TCL

    Acs-lang includes tools to automate some internationalization. From /acs-admin/apm/, select a package and then click on Internationalization, then Convert ADP, Tcl, and SQL files to using the - message catalog..

    1. - Replace text with tags: - Choose Find human language text and replace with <# ... #> tags. This automated process - automatically locates chunks of translatable text, - generates a reasonable message key, and replaces the text - with a "temporary" tag as described above. -

      Any pieces of text found but not extractable -- for - example, pieces of text with embedded adp variables - (i.e. @var_name@) -- will be listed on the result - page. Make sure to take note of these texts and translate - them manually. Suppose for example that our script tells you - that it left the text "Manage forum @forum_name@" - untouched. What you should do then is to edit the - corresponding adp file and manually replace that text with - something like "<#manage_forum Manage forum @forum_name@#>" - (to save you from too much typing you may use the shorthand - <#_ Manage forum @forum_name@#>; an underscore key will - result in the script auto-generating a key for you based on - the text). After you have made all such manual edits you can - simply run the second action labeled "Replace tags with keys - and insert into catalog". -

      Note: running this action will not find translatable text within HTML or adp tags on adp pages (i.e. text in alt tags of images), nor will it find translatable text in tcl files. Such texts will have to be found manually. If those texts are in adp files they are best replaced with the <#message_key text#> tags that can be extracted by the action described below. Here are some commands that we used on Linux to look for texts in adp pages not found by the script:

      -# List image tags with alt attributes, look for alt attributes with literal text
      -find -iname '*.adp'|xargs egrep -i '<img.*alt='
      -# List submit buttons, look for text in the value attribute 
      -find -iname '*.adp'|xargs egrep -i '<input[^>]*type="?submit'
      -

      - When you run this step, any modified files are backed up in - a file with a ".orig" suffix. Those files are - never overwritten, though, so the .orig file will always be - the original page file, not the second-to-last file. Running - this action multiple times is harmless. -

    2. - Manually verify each ADP - file. If necessary, you can add additional - <#...#> tags, or you can move or remove the ones set - by the automated step. -

    3. - Manually mark up Tcl - files, marking up translatable text with the - <#...#> notation. -

      Ttranslatable texts are often found in page titles, context bars, and form labels and options. Many times the texts are enclosed in double quotes. Use the following grep commands on Linux to highlight translatable text in tcl files for us:

      # Find text in double quotes
      -find -iname '*.tcl'|xargs egrep -i '"[a-z]'
      -# Find untranslated text in form labels, options and values
      -find -iname '*.tcl'|xargs egrep -i '\-(options|label|value)'|egrep -v '<#'|egrep -v '\-(value|label|options)[[:space:]]+\$[a-zA-Z_]+[[:space:]]*\\?[[:space:]]*$'
      -# Find text in page titles and context bars
      -find -iname '*.tcl'|xargs egrep -i 'set (title|page_title|context_bar) '|egrep -v '<#'
      -# Find text in error messages
      -find -iname '*.tcl'|xargs egrep -i '(ad_complain|ad_return_error)'|egrep -v '<#'

      You may mark up translatable text in tcl library files and tcl pages with temporary tags (on the <#key text#> syntax mentioned previously). If you have a sentence or paragraph of text with variables and or procedure calls in it you should in most cases try to turn the whole text into one message in the catalog. In those cases, follow these steps:

      1. For each message call in the text, decide on a variable - name and replace the procedure call with a variable - lookup on the syntax %var_name%. Remember to initialize - a tcl variable with the same name on some line above the - text.

      2. If the text is in a tcl file you must replace - variable lookups (occurences of $var_name or - ${var_name}) with %var_name%

      3. You are now ready to follow the normal procedure - and mark up the text using a tempoarary message tag (<#_ - text_with_percentage_vars#>) and run the action replace - tags with keys in the APM.

      The variable values in the message are usually fetched with upvar, here is an example from dotlrn:

      ad_return_complaint 1 "Error: A [parameter::get -parameter classes_pretty_name] 
      -             must have no[parameter::get -parameter class_instances_pretty_plural] to be deleted"
      -

      was replaced by:

      set subject [parameter::get -localize -parameter classes_pretty_name] 
      -set class_instances [parameter::get -localize -parameter class_instances_pretty_plural]
      -ad_return_complaint 1 [_ dotlrn.class_may_not_be_deleted]
      -
      -

      This kind of interpolation also works in adp files where adp variable values will be inserted into the message.

      Alternatively, you may pass in an array list of the variable values to be interpolated into the message so that our example becomes:

      set msg_subst_list [list subject [parameter::get -localize -parameter classes_pretty_name] 
      -                         class_instances [parameter::get -localize -parameter class_instances_pretty_plural]]
      -
      -ad_return_complaint 1 [_ dotlrn.class_may_not_be_deleted $msg_subst_list]
      -

      When we were done going through the tcl files we ran the following commands to check for mistakes: -

      # Message tags should usually not be in curly braces since then the message lookup may not be
      -# executed then (you can usually replace curly braces with the list command). Find message tags 
      -# in curly braces (should return nothing, or possibly a few lines for inspection)
      -find -iname '*.tcl'|xargs egrep -i '\{.*<#'
      -# Check if you've forgotten space between default key and text in message tags (should return nothing)
      -find -iname '*.tcl'|xargs egrep -i '<#_[^ ]'
      -# Review the list of tcl files with no message lookups
      -for tcl_file in $(find -iname '*.tcl'); do egrep -L '(<#|\[_)' $tcl_file; done
      -

      When you feel ready you may run the action "Replace tags with keys and insert into catalog" on the tcl files that you've edited to replace the temporary tags with calls to the message lookup procedure.

      The acs-lang/bin/check-catalog.sh script checks that the set of keys used in message lookups in tcl, adp, and info files and the set of keys in the catalog file are identical. The scripts below assume that message lookups in adp and info files are on the format #package_key.message_key#, and that message lookups in tcl files are always done with the underscore procedure. The script assumes that you have perl installed and in your path. Run the script like this:

      acs-lang/bin/check-catalog.sh package_key

      where package_key is the key of the package that you want to test. If you don't provide the package_key argument then all packages with catalog files will be checked. The script will run its checks on en_US xml catalog files.

    4. - Replace tags with keys: - This is an automated process, which will replace the - temporary <#...#> notation in both ADP and Tcl files - with the appropriate notation for the type of file, and - store the text in the message catalog. You need to run the - process twice, once for ADP files, and once for Tcl files. -

    Internationalize Package Parameters with visible messages

    - See Multilingual APM Parameters -

    Internationalize Date and Time queries

    1. Find datetime in .xql files. Use command line tools to find suspect SQL code:

      grep -r "to_char.*H" *
      +        message catalog..

    Internationalize Package Parameters with visible messages

    + See ??? +

    Internationalize Date and Time queries

    1. Find datetime in .xql files. Use command line tools to find suspect SQL code:

      grep -r "to_char.*H" *
       grep -r "to_date.*H" *
       
    2. In SQL statements, replace the format string with the ANSI standard format, YYYY-MM-DD HH24:MI:SS and change the field name to *_ansi so that it cannot be confused with previous, improperly formatting fields. For example,

      to_char(timestamp,'MM/DD/YYYY HH:MI:SS') as foo_date_pretty

      becomes

      to_char(timestamp,'YYYY-MM-DD HH24:MI:SS') as foo_date_ansi
    3. In TCL files where the date fields are used, convert the datetime from local server timezone, which is how it's stored in the database, to the user's timezone for display. Do this with the localizing function lc_time_system_to_conn:

       set foo_date_ansi [lc_time_system_to_conn $foo_date_ansi]

      When a datetime will be written to the database, first convert it from the user's local time to the server's timezone with lc_time_conn_to_system. Index: openacs-4/packages/acs-core-docs/www/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/index.html,v diff -u -N -r1.25 -r1.26 --- openacs-4/packages/acs-core-docs/www/index.html 23 Jan 2004 15:10:47 -0000 1.25 +++ openacs-4/packages/acs-core-docs/www/index.html 4 Feb 2004 16:47:32 -0000 1.26 @@ -1 +1 @@ -OpenACS Core Documentation

      OpenACS Core Documentation


      Table of Contents

      I. OpenACS For Everyone
      1. High level information: What is OpenACS?
      Overview
      OpenACS Release Notes
      II. Administrator's Guide
      1. Installation Overview
      Basic Steps
      Prerequisite Software
      1. Complete Installation
      Install a Unix-like system and supporting software
      Install Oracle 8.1.7
      Install PostgreSQL
      Install AOLserver 3.3oacs1
      Install OpenACS
      OpenACS Installation Guide for Windows2000
      OpenACS Installation Guide for Mac OS X
      1. Configuring a New Service
      2. Upgrading
      Upgrading
      1. Maintenance
      Hosting Web Sites
      Database Management
      Backup and Recovery
      Diagnosing Performance Problems
      A. Install Red Hat 8/9
      B. Install additional supporting software
      Unpack the OpenACS tarball
      Initialize CVS (OPTIONAL)
      Add PSGML commands to emacs init file (OPTIONAL)
      Install Daemontools (OPTIONAL)
      Install qmail (OPTIONAL)
      Install Analog web file analyzer
      Install nspam
      Install Full Text Search
      Install nsopenssl
      Install tclwebtest.
      A. Credits
      Where did this document come from?
      Linux Install Guides
      Security Information
      Resources
      III. For OpenACS Package Developers
      1. Development Tutorial
      Creating a Package
      Setting Up Database Objects
      Creating Web Pages
      Debugging and Automated Testing
      Advanced Topics
      1. Development Reference
      OpenACS Packages
      OpenACS Data Models and the Object System
      The Request Processor
      The OpenACS Database Access API
      Using Templates in OpenACS
      Groups, Context, Permissions
      Writing OpenACS Application Pages
      Parties in OpenACS
      OpenACS Permissions Tediously Explained
      Object Identity
      Programming with AOLserver
      Using HTML Forms
      1. Engineering Standards
      OpenACS Style Guide
      Release Version Numbering
      Constraint naming standard
      ACS File Naming and Formatting Standards
      PL/SQL Standards
      Variables
      Automated Testing
      2. Documentation Standards
      OpenACS Documentation Guide
      Using PSGML mode in Emacs
      Using nXML mode in Emacs
      Detailed Design Documentation Template
      System/Application Requirements Template
      A. Using CVS with an OpenACS Site
      A. How to package and release OpenACS
      How to Update the OpenACS.org repository
      IV. For OpenACS Platform Developers
      1. Kernel Documentation
      Overview
      Object Model Requirements
      Object Model Design
      Permissions Requirements
      Permissions Design
      Groups Requirements
      Groups Design
      Subsites Requirements
      Subsites Design Document
      Package Manager Requirements
      Package Manager Design
      Database Access API
      OpenACS Internationalization Requirements
      Internationalization
      Security Requirements
      Security Design
      Security Notes
      Request Processor Requirements
      Request Processor Design
      Documenting Tcl Files: Page Contracts and Libraries
      Bootstrapping OpenACS
      External Authentication Requirements
      Index
      View comments on this page at openacs.org
      +OpenACS Core Documentation

      OpenACS Core Documentation


      Table of Contents

      I. OpenACS For Everyone
      1. High level information: What is OpenACS?
      Overview
      OpenACS Release Notes
      II. Administrator's Guide
      1. Installation Overview
      Basic Steps
      Prerequisite Software
      1. Complete Installation
      Install a Unix-like system and supporting software
      Install Oracle 8.1.7
      Install PostgreSQL
      Install AOLserver 3.3oacs1
      Install AOLserver 4
      Install OpenACS
      OpenACS Installation Guide for Windows2000
      OpenACS Installation Guide for Mac OS X
      1. Configuring a new OpenACS Site
      How Do I?
      2. Upgrading
      Overview
      Upgrading OpenACS
      Upgrading the OpenACS files
      Upgrading Platform components
      1. Maintenance
      Running OpenACS in Production Environments
      Database Management
      Backup and Recovery
      Diagnosing Performance Problems
      A. Install Red Hat 8/9
      B. Install additional supporting software
      Unpack the OpenACS tarball
      Initialize CVS (OPTIONAL)
      Add PSGML commands to emacs init file (OPTIONAL)
      Install Daemontools (OPTIONAL)
      Install qmail (OPTIONAL)
      Install Analog web file analyzer
      Install nspam
      Install Full Text Search
      Install nsopenssl
      Install tclwebtest.
      Install PHP for use in AOLserver
      Install Squirrelmail for use as a webmail system for OpenACS
      A. Credits
      Where did this document come from?
      Linux Install Guides
      Security Information
      Resources
      III. For OpenACS Package Developers
      1. Development Tutorial
      Creating a Package
      Setting Up Database Objects
      Creating Web Pages
      Debugging and Automated Testing
      Advanced Topics
      1. Development Reference
      OpenACS Packages
      OpenACS Data Models and the Object System
      The Request Processor
      The OpenACS Database Access API
      Using Templates in OpenACS
      Groups, Context, Permissions
      Writing OpenACS Application Pages
      Parties in OpenACS
      OpenACS Permissions Tediously Explained
      Object Identity
      Programming with AOLserver
      Using HTML Forms
      1. Engineering Standards
      OpenACS Style Guide
      Release Version Numbering
      Constraint naming standard
      ACS File Naming and Formatting Standards
      PL/SQL Standards
      Variables
      Automated Testing
      2. Documentation Standards
      OpenACS Documentation Guide
      Using PSGML mode in Emacs
      Using nXML mode in Emacs
      Detailed Design Documentation Template
      System/Application Requirements Template
      A. Using CVS with an OpenACS Site
      A. How to package and release OpenACS
      How to Update the OpenACS.org repository
      IV. For OpenACS Platform Developers
      1. Kernel Documentation
      Overview
      Object Model Requirements
      Object Model Design
      Permissions Requirements
      Permissions Design
      Groups Requirements
      Groups Design
      Subsites Requirements
      Subsites Design Document
      Package Manager Requirements
      Package Manager Design
      Database Access API
      OpenACS Internationalization Requirements
      Internationalization
      Security Requirements
      Security Design
      Security Notes
      Request Processor Requirements
      Request Processor Design
      Documenting Tcl Files: Page Contracts and Libraries
      Bootstrapping OpenACS
      External Authentication Requirements
      Index
      View comments on this page at openacs.org
      Index: openacs-4/packages/acs-core-docs/www/individual-programs.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/individual-programs.html,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/acs-core-docs/www/individual-programs.html 11 Dec 2003 21:39:47 -0000 1.15 +++ openacs-4/packages/acs-core-docs/www/individual-programs.html 4 Feb 2004 16:47:32 -0000 1.16 @@ -1,12 +1,12 @@ -Prerequisite Software

      Prerequisite Software

      by Joel Aufrecht

      +Prerequisite Software

      Prerequisite Software

      by Joel Aufrecht

      OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

      OpenACS requires, at a minimum, an operating system, database, and webserver. Many additional programs, such as a Mail Transport Agent and source control system, are also needed for a fully effective instance. -

      • OpenACS 5.0.0b4.�The OpenACS tarball comprises the core packages and +

        Table�2.2.�Version Compatibility Matrix

        OpenACS Version3.2.5 4.5 4.6 4.6.14.6.24.6.35.0.0
        AOLserver3YesNo
        3.3+ad13MaybeYes
        3.3oacs1MaybeYes
        3.4.2No
        3.4.2oacs1MaybeYesMaybe
        3.5.5MaybeYesNo
        4.0MaybeYes
        PostgreSQL7.0YesNo
        7.2.xYesNo
        7.3.2 - 7.3.4NoYes
        7.4NoMaybe
        Oracle8.1.6MaybeYes
        8.1.7MaybeYes
        9iNoYes
        • OpenACS .�The OpenACS tarball comprises the core packages and many useful additional packages. This includes a full set of documentation. The tarball works with both PostgreSQL and Oracle.

        • Operating System.�OpenACS is designed for a Unix-like system. It is @@ -38,7 +38,7 @@ distributions.

        • TCL 8.3 development headers and libraries, OPTIONAL.� The site-wide-search service, OpenFTS, requires these to compile. (Debian users: apt-get install tcl8.3-dev). You need this - to install OpenFTS.

      • tDOM, REQUIRED.�OpenACS 5.0.0b4 stores + to install OpenFTS.

    4. tDOM, REQUIRED.�OpenACS stores queries in XML files, so we use an AOLserver module called tDOM to parse these files. (This replaces libxml2, which was used prior to 4.6.4.) tDOM is available from http://www.tdom.org).

    5. tclwebtest, OPTIONAL.�tclwebtest 0.3 is a tool for testing web interfaces @@ -49,7 +49,7 @@ running Apache with mod_nsd - see this post.

      • AOLserver 3.3oacs1, REQUIRED.�Mat Kovach's source distribution of AOLserver, including all of the patches listed below.

        Mat Kovach is graciously maintaining an AOLserver distribution that - includes all the patches and modules needed to run OpenACS 5.0.0b4. These + includes all the patches and modules needed to run OpenACS . These instructions will describe how to install using his source distribution. He also has binaries for SuSE 7.3 and OpenBSD 2.8 (and perhaps more to come), currently located at uptime.openacs.org. @@ -93,8 +93,7 @@ calender entries, and notes) is stored in the database. OpenACS seperates the database with an abstraction layer, which means that several different databases all function - identically. Currently OpenACS supports PostgreSQL 7.2 and - Oracle 8.1.7. While you can run the core OpenACS on any + identically. While you can run the core OpenACS on any supported database, not all contributed packages support all databases.

        • Oracle 8.1.7 (Either this or PostgreSQL is REQUIRED).�You can register and download Oracle from Oracle TechNet. You need this if you want to use an Index: openacs-4/packages/acs-core-docs/www/install-cvs.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-cvs.html,v diff -u -N -r1.14 -r1.15 --- openacs-4/packages/acs-core-docs/www/install-cvs.html 11 Dec 2003 23:08:46 -0000 1.14 +++ openacs-4/packages/acs-core-docs/www/install-cvs.html 4 Feb 2004 16:47:32 -0000 1.15 @@ -1,6 +1,6 @@ -Initialize CVS (OPTIONAL)

          Initialize CVS (OPTIONAL)

          CVS is a source control system. Create and initialize a - directory for a local cvs repository.

          [root@yourserver tmp]# mkdir /cvsroot
          -[root@yourserver tmp]# cvs -d /cvsroot init
          -[root@yourserver tmp]#
          +Initialize CVS (OPTIONAL)

          Initialize CVS (OPTIONAL)

          CVS is a source control system. Create and initialize a + directory for a local cvs repository.

          [root tmp]# mkdir /cvsroot
          +[root tmp]# cvs -d /cvsroot init
          +[root tmp]#
           mkdir /cvsroot
           cvs -d /cvsroot init
          View comments on this page at openacs.org
          Index: openacs-4/packages/acs-core-docs/www/install-daemontools.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-daemontools.html,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/acs-core-docs/www/install-daemontools.html 11 Dec 2003 23:08:46 -0000 1.15 +++ openacs-4/packages/acs-core-docs/www/install-daemontools.html 4 Feb 2004 16:47:32 -0000 1.16 @@ -1,33 +1,33 @@ -Install Daemontools (OPTIONAL)

          Install Daemontools (OPTIONAL)

          Daemontools is a collection of programs for controlling +Install Daemontools (OPTIONAL)

          Install Daemontools (OPTIONAL)

          Daemontools is a collection of programs for controlling other processes. We use daemontools to run and monitor AOLserver. It is installed in /package. These commands install daemontools and svgroup. svgroup is a script for granting permissions, to allow users other than root to use daemontools for specific - services.

          1. Install Daemontools

            download daemontools and install it.

            • Red Hat 8

              [root@yourserver root]# mkdir -p /package
              -[root@yourserver root]# chmod 1755 /package/
              -[root@yourserver root]# cd /package/
              -[root@yourserver package]# tar xzf /tmp/daemontools-0.76.tar.gz
              -[root@yourserver package]# cd admin/daemontools-0.76/
              -[root@yourserver daemontools-0.76]# package/install
              +      services.

              1. Install Daemontools

                download daemontools and install it.

                • Red Hat 8

                  [root root]# mkdir -p /package
                  +[root root]# chmod 1755 /package/
                  +[root root]# cd /package/
                  +[root package]# tar xzf /tmp/daemontools-0.76.tar.gz
                  +[root package]# cd admin/daemontools-0.76/
                  +[root daemontools-0.76]# package/install
                   Linking ./src/* into ./compile...
                   
                   Creating /service...
                   Adding svscanboot to inittab...
                   init should start svscan now.
                  -[root@yourserver root]#
                  +[root root]#
                   mkdir -p /package 
                   chmod 1755 /package 
                   cd /package 
                   tar xzf /tmp/daemontools-0.76.tar.gz 
                   cd admin/daemontools-0.76 
                   package/install
                • Red Hat 9

                  Make sure you have the source tarball in /tmp, or download it. -

                  [root@yourserver root]# mkdir -p /package
                  -[root@yourserver root]# chmod 1755 /package/
                  -[root@yourserver root]# cd /package/
                  -[root@yourserver package]# tar xzf /tmp/daemontools-0.76.tar.gz
                  -[root@yourserver package]# cd admin
                  -[root@yourserver admin]# wget http://moni.csi.hu/pub/glibc-2.3.1/daemontools-0.76.errno.patch
                  +

                  [root root]# mkdir -p /package
                  +[root root]# chmod 1755 /package/
                  +[root root]# cd /package/
                  +[root package]# tar xzf /tmp/daemontools-0.76.tar.gz
                  +[root package]# cd admin
                  +[root admin]# wget http://moni.csi.hu/pub/glibc-2.3.1/daemontools-0.76.errno.patch
                   --14:19:24--  http://moni.csi.hu/pub/glibc-2.3.1/daemontools-0.76.errno.patch
                              => `daemontools-0.76.errno.patch'
                   Resolving moni.csi.hu... done.
                  @@ -39,14 +39,14 @@
                   
                   14:19:24 (346.68 KB/s) - `daemontools-0.76.errno.patch' saved [355/355]
                   
                  -[root@yourserver admin]# cd daemontools-0.76
                  -[root@yourserver daemontools-0.76]# patch -p1 < ../daemontools-0.76.errno.patch
                  -[root@yourserver daemontools-0.76]# package/install
                  +[root admin]# cd daemontools-0.76
                  +[root daemontools-0.76]# patch -p1 < ../daemontools-0.76.errno.patch
                  +[root daemontools-0.76]# package/install
                   Linking ./src/* into ./compile...(many lines omitted)
                   Creating /service...
                   Adding svscanboot to inittab...
                   init should start svscan now.
                  -[root@yourserver root]#
                  +[root root]#
                   mkdir -p /package 
                   chmod 1755 /package 
                   cd /package 
                  @@ -55,13 +55,13 @@
                   wget http://moni.csi.hu/pub/glibc-2.3.1/daemontools-0.76.errno.patch
                   cd daemontools-0.76
                   patch -p1 < ../daemontools-0.76.errno.patch
                  -package/install
                • Debian

                  root:~# apt-get install daemontools-installer
                  -root:~# build-daemontools
              2. Verify that svscan is running. If it is, you should see - these two processes running:

                [root@yourserver root]# ps -auxw | grep service
                +package/install
              3. Debian

                [root ~]# apt-get install daemontools-installer
                +[root ~]# build-daemontools
          2. Verify that svscan is running. If it is, you should see + these two processes running:

            [root root]# ps -auxw | grep service
             root     13294  0.0  0.1  1352  272 ?        S    09:51   0:00 svscan /service
             root     13295  0.0  0.0  1304  208 ?        S    09:51   0:00 readproctitle service errors: .......................................
            -[root@yourserver root]#
          3. Install a script to grant non-root users permission to - control daemontools services.

            [root@yourserver root]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/svgroup.txt /usr/local/bin/svgroup
            -[root@yourserver root]# chmod 755 /usr/local/bin/svgroup
            -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/svgroup.txt /usr/local/bin/svgroup 
            +[root root]#
          4. Install a script to grant non-root users permission to + control daemontools services.

            [root root]# cp /tmp//packages/acs-core-docs/www/files/svgroup.txt /usr/local/bin/svgroup
            +[root root]# chmod 755 /usr/local/bin/svgroup
            +cp /tmp//packages/acs-core-docs/www/files/svgroup.txt /usr/local/bin/svgroup 
             chmod 755 /usr/local/bin/svgroup
          View comments on this page at openacs.org
          Index: openacs-4/packages/acs-core-docs/www/install-full-text-search.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/Attic/install-full-text-search.html,v diff -u -N -r1.13 -r1.14 --- openacs-4/packages/acs-core-docs/www/install-full-text-search.html 11 Dec 2003 23:08:46 -0000 1.13 +++ openacs-4/packages/acs-core-docs/www/install-full-text-search.html 4 Feb 2004 16:47:32 -0000 1.14 @@ -1,49 +1,52 @@ -Install Full Text Search

          Install Full Text Search

          Install OpenFTS module

          If you want full text search, and you are running PostgreSQL, install this module to support FTS. Do this step after you have installed both PostgreSQL and +Install Full Text Search

          Install Full Text Search

          By Joel Aufrecht and Malte Sussdorff

          + OpenACS docs are written by the named authors, and may be edited + by OpenACS documentation staff. +

          Install OpenFTS module

          If you want full text search, and you are running PostgreSQL, install this module to support FTS. Do this step after you have installed both PostgreSQL and AOLserver. You will need the openfts tarball in /tmp.

          1. Install Tsearch. This is a PostgreSQL module that - OpenFTS requires.

            [root@yourserver root]# su - postgres
            -[postgres@yourserver pgsql]$ cd /usr/local/src/postgresql-7.2.4/contrib/tsearch/
            -[postgres@yourserver tsearch]$ make
            +	  OpenFTS requires.

            [root root]# su - postgres
            +[postgres pgsql]$ cd /usr/local/src/postgresql-7.3.4/contrib/tsearch/
            +[postgres tsearch]$ make
             sed 's,MODULE_PATHNAME,$libdir/tsearch,g' tsearch.sql.in >tsearch.sql
             /usr/bin/flex  -8 -Ptsearch_yy -o'parser.c' parser.l(many lines omitted)
             rm -f libtsearch.so
             ln -s libtsearch.so.0.0 libtsearch.so
            -[postgres@yourserver tsearch]$ make install
            +[postgres tsearch]$ make install
             mkdir /usr/local/pgsql/share/contrib
             mkdir /usr/local/pgsql/doc/contrib
             (2 lines omitted)
             /bin/sh ../../config/install-sh -c -m 755 libtsearch.so.0.0 /usr/local/pgsql/lib/tsearch.so
            -[postgres@yourserver tsearch]$ exit
            +[postgres tsearch]$ exit
             logout
             
            -[root@yourserver root]#
            +[root root]#
             su - postgres
            -cd /usr/local/src/postgresql-7.2.4/contrib/tsearch
            +cd /usr/local/src/postgresql-7.3.4/contrib/tsearch
             make
             make install
             exit
          2. Unpack the OpenFTS tarball and compile and install - the driver.

            [root@yourserver root]# cd /usr/local/src
            -[root@yourserver src]# tar xzf /tmp/Search-OpenFTS-tcl-0.3.2.tar.gz
            -[root@yourserver src]# cd /usr/local/src/Search-OpenFTS-tcl-0.3.2/
            -[root@yourserver Search-OpenFTS-tcl-0.3.2]# ./configure --with-aolserver-src=/usr/local/src/aolserver/aolserver --with-tcl=/usr/lib/
            +              the driver.

            [root root]# cd /usr/local/src
            +[root src]# tar xzf /tmp/Search-OpenFTS-tcl-0.3.2.tar.gz
            +[root src]# cd /usr/local/src/Search-OpenFTS-tcl-0.3.2/
            +[root Search-OpenFTS-tcl-0.3.2]# ./configure --with-aolserver-src=/usr/local/src/aolserver/aolserver --with-tcl=/usr/lib/
             checking prefix... /usr/local
             checking for gcc... gcc
             (many lines omitted)
             configure: creating ./config.status
             config.status: creating Makefile.global
            -[root@yourserver Search-OpenFTS-tcl-0.3.2]# make
            +[root Search-OpenFTS-tcl-0.3.2]# make
             (cd parser; make all)
             make[1]: Entering directory `/usr/local/src/Search-OpenFTS-tcl-0.3.2/parser'
             (many lines omitted)
             packages provided were {Lingua::Stem::Snowball 0.3.2}
             processed fts_base_snowball.tcl
            -[root@yourserver Search-OpenFTS-tcl-0.3.2]# cd aolserver
            -[root@yourserver aolserver]# make
            +[root Search-OpenFTS-tcl-0.3.2]# cd aolserver
            +[root aolserver]# make
             gcc -c -fPIC  -DPACKAGE=\"OPENFTS\" -DVERSION=\"0.3.2\" -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STR
             (many lines omitted)
             n_stem.o italian_stem.o norwegian_stem.o portuguese_stem.o russian_stem.o nsfts.o  -o nsfts.so
            -[root@yourserver aolserver]# cp nsfts.so /usr/local/aolserver/bin/
            -[root@yourserver aolserver]#
            +[root aolserver]# cp nsfts.so /usr/local/aolserver/bin/
            +[root aolserver]#
             cd /usr/local/src 
             tar xzf /tmp/Search-OpenFTS-tcl-0.3.2.tar.gz
             cd /usr/local/src/Search-OpenFTS-tcl-0.3.2/
            @@ -52,44 +55,45 @@
             cd aolserver
             make
             cp nsfts.so /usr/local/aolserver/bin
            -
          3. Build some supplemental modules.

            [root@yourserver aolserver]# cd /usr/local/src/Search-OpenFTS-tcl-0.3.2
            -[root@yourserver Search-OpenFTS-tcl-0.3.2]# cp -r pgsql_contrib_openfts /usr/local/src/postgresql-7.2.4/contrib
            -[root@yourserver Search-OpenFTS-tcl-0.3.2]# cd /usr/local/src/postgresql-7.2.4/contrib/pgsql_contrib_openfts
            -[root@yourserver pgsql_contrib_openfts]# make
            +
          4. Build some supplemental modules.

            [root aolserver]# cd /usr/local/src/Search-OpenFTS-tcl-0.3.2
            +[root Search-OpenFTS-tcl-0.3.2]# cp -r pgsql_contrib_openfts /usr/local/src/postgresql-7.3.4/contrib
            +[root Search-OpenFTS-tcl-0.3.2]# cd /usr/local/src/postgresql-7.3.4/contrib/pgsql_contrib_openfts
            +[root pgsql_contrib_openfts]# make
             sed 's,MODULE_PATHNAME,$libdir/openfts,g' openfts.sql.in >openfts.sql
             gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -fpic -I. -I../../src/include   -c -o openfts.o openfts.c
             gcc -shared -o openfts.so openfts.o
             rm openfts.o
            -[root@yourserver pgsql_contrib_openfts]# su postgres
            -[postgres@yourserver pgsql_contrib_openfts]$ make install
            +[root pgsql_contrib_openfts]# su postgres
            +[postgres pgsql_contrib_openfts]$ make install
             /bin/sh ../../config/install-sh -c -m 644 openfts.sql /usr/local/pgsql/share/contrib
             /bin/sh ../../config/install-sh -c -m 755 openfts.so /usr/local/pgsql/lib
             /bin/sh ../../config/install-sh -c -m 644 ./README.openfts /usr/local/pgsql/doc/contrib
            -[postgres@yourserver pgsql_contrib_openfts]$ exit
            -[root@yourserver pgsql_contrib_openfts]#
            +[postgres pgsql_contrib_openfts]$ exit
            +[root pgsql_contrib_openfts]#
             cd /usr/local/src/Search-OpenFTS-tcl-0.3.2
            -cp -r pgsql_contrib_openfts /usr/local/src/postgresql-7.2.4/contrib
            -cd /usr/local/src/postgresql-7.2.4/contrib/pgsql_contrib_openfts
            +cp -r pgsql_contrib_openfts /usr/local/src/postgresql-7.3.4/contrib
            +cd /usr/local/src/postgresql-7.3.4/contrib/pgsql_contrib_openfts
             make
             su postgres
             make install
            -exit

          Install OpenFTS prerequisites in PostgreSQL instance

          If you are installing Full Text Search, add required +exit

    Install OpenFTS prerequisites in PostgreSQL instance

    If you are installing Full Text Search, add required packages to the new database. (In order for full text search to work, you must also install the PostgreSQL - OpenFTS module and prerequisites.)

    [service0@yourserver service0]$ /usr/local/pgsql/bin/psql service0 -f /usr/local/src/postgresql-7.2.4/contrib/tsearch/tsearch.sql
    +        OpenFTS module and prerequisites.)

    [service0 service0]$ /usr/local/pgsql/bin/psql service0 -f /usr/local/src/postgresql-7.3.4/contrib/tsearch/tsearch.sql
     BEGIN
     CREATE
     (many lines omitted)
     INSERT 0 1
     COMMIT
    -[service0@yourserver service0]$ /usr/local/pgsql/bin/psql service0 -f /usr/local/src/postgresql-7.2.4/contrib/pgsql_contrib_openfts/openfts.sql
    +[service0 service0]$ /usr/local/pgsql/bin/psql service0 -f /usr/local/src/postgresql-7.3.4/contrib/pgsql_contrib_openfts/openfts.sql
     CREATE
     CREATE
    -[service0@yourserver service0]$
    -/usr/local/pgsql/bin/psql service0 -f /usr/local/src/postgresql-7.2.4/contrib/tsearch/tsearch.sql
    -/usr/local/pgsql/bin/psql service0 -f /usr/local/src/postgresql-7.2.4/contrib/pgsql_contrib_openfts/openfts.sql

    Enable OpenFTS in config.tcl

    If you have installed OpenFTS, you can enable it for this service. Uncomment this line from config.tcl. (To uncomment a line in a tcl file, remove the # at the beginning of the line.)

    #ns_param   nsfts           ${bindir}/nsfts.so

    Install Full Text Search Engine

    1. Click Package Manager on the right side of the default home page. If prompted, log in with the account and password you entered during install.

    2. Click on the Install -packages link.

    3. On the next screen, after it loads, click on Uncheck all boxes, then click the checkbox next to OpenFTS Driver 4.2. Then click Next.

    4. Click Install Packages

    5. Restart the service.

      [service0@yourserver service0]$ svc -t /service/service0
      -[service0@yourserver service0]$
    6. Wait a minute, then browse back to the home page.

    7. Click on Site Map on the top right side of the screen.

    8. Mount the OpenFTS Full Text Search Engine in the site map.

      1. Click the new sub folder link on the "/" line, the first line under Main Site:/.

      2. Type openfts +[service0 service0]$ +/usr/local/pgsql/bin/psql service0 -f /usr/local/src/postgresql-7.3.4/contrib/tsearch/tsearch.sql +/usr/local/pgsql/bin/psql service0 -f /usr/local/src/postgresql-7.3.4/contrib/pgsql_contrib_openfts/openfts.sql

      Enable OpenFTS in config.tcl

      If you have installed OpenFTS, you can enable it for this service. Uncomment this line from config.tcl. (To uncomment a line in a tcl file, remove the # at the beginning of the line.)

      #ns_param   nsfts           ${bindir}/nsfts.so

      Install Full Text Search Engine

      1. Click Admin on the top of the default home page. If prompted, log in with the account and password you entered during install.

      2. Click on the Install +software link.

      3. Click on the Install +new service link.

      4. Click on the Install link next to OpenFTS Driver.

      5. Restart the service.

        [service0 service0]$ svc -t /service/service0
        +[service0 service0]$
      6. Wait a minute, then browse back to the home page.

      7. Click on Admin on the top of the screen.

      8. Click on Main Site Administration in the "Subsite Administration" section.

      9. Click on Site Map in the "Advanced Features" section.

      10. Mount the OpenFTS Full Text Search Engine in the site map.

        1. Click the new sub folder link on the "/" line, the first line under Main Site:/.

        2. Type openfts and click New.

        3. On the new openfts line, click the mount link.

        4. Click OpenFTS Driver.

        5. On the openfts line, click set parameters.

        6. Change openfts_tcl_src_path to /usr/local/src/Search-OpenFTS-tcl-0.3.2/ and click Set Parameters

      11. Mount the Search interface in the site map.

        1. Click the @@ -103,13 +107,17 @@ search from the drop-down list, and click New. -

      12. Restart the service.

        [service0@yourserver service0]$ svc -t /service/service0
        -[service0@yourserver service0]$
      13. Wait a minute, then click on Main Site at the top of the page.

      14. Initialize the OpenFTS Engine. This creates a set of tables in the database to support FTS.

        Near the bottom of the page, click on the OpenFTS Driver link. Click on Administration. +

    9. Restart the service.

      [service0 service0]$ svc -t /service/service0
      +[service0 service0]$
    10. Wait a minute, then click on Main Site at the top of the page.

    11. Initialize the OpenFTS Engine. This creates a set of tables in the database to support FTS.

      Near the bottom of the page, click on the OpenFTS Driver link. Click on Administration. Click on Initialize OpenFTS Engine. -Click Initialize OpenFTS Engine.

    12. Add the FTS Engine service contract

      1. Click on the Main -Site.

      2. Click on the ACS -Service Contract link near the bottom of the home page.

      3. On the FtsEngineDriver +Click Initialize OpenFTS Engine.

      4. Add the FTS Engine service contract

        1. Click on the DevAdmin.

        2. Click on the Service Contract link.

        3. On the FtsEngineDriver line, click Install. -

      5. Restart the service.

        [service0@yourserver service0]$ svc -t /service/service0
        -[service0@yourserver service0]$
      6. Test FTS. (INCOMPLETE). Add a package that supports search,like "note," add some content, and search for it.

    View comments on this page at openacs.org
    +

  • Restart the service.

    [service0 service0]$ svc -t /service/service0
    +[service0 service0]$
  • Enable Full Text Search in packages

    Enabling Full Text Search in packages at the moment is not trivial. It involves a couple of steps, which I will illustrate taking lars-blogger as an example package

    1. Install the package. +

      1. Click Admin on the top of the default home page. If prompted, log in with the account and password you entered during install.

      2. Click on the Install + software link.

      3. Click on the Install + new application link.

      4. Click on the Install link next to Weblogger.

      5. Install all required packages as well (always say okay until you shall restart the server)

      +

    2. Load the service contracts datamodell and enable the service contract

      [service0 service0]$ cd packages/lars-blogger/sql/postgresql
      +[service0 postgresql]$ psql service0 -f lars-blogger-sc-create.sql

      Note: Usually this script is called package_name-sc-create.sql

    3. Restart the service.

      [service0 postgresql]$ svc -t /service/service0
      +                [service0 postgresl]$

    If you are lucky, Full Text Search is enabled now, if not consult http://openacs.org/forums/message-view?message_id=154759. This link also contains some hints on how to make sure it is enabled.

    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/install-more-software.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-more-software.html,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/acs-core-docs/www/install-more-software.html 19 Nov 2003 15:44:50 -0000 1.7 +++ openacs-4/packages/acs-core-docs/www/install-more-software.html 4 Feb 2004 16:47:32 -0000 1.8 @@ -1,4 +1,4 @@ -Appendix�B.�Install additional supporting software

    Appendix�B.�Install additional supporting software

    By Joel Aufrecht

    +Appendix�B.�Install additional supporting software

    Appendix�B.�Install additional supporting software

    By Joel Aufrecht

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    This section assumes that the source tarballs for supporting Index: openacs-4/packages/acs-core-docs/www/install-nsopenssl.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-nsopenssl.html,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/acs-core-docs/www/install-nsopenssl.html 11 Dec 2003 23:08:46 -0000 1.9 +++ openacs-4/packages/acs-core-docs/www/install-nsopenssl.html 4 Feb 2004 16:47:32 -0000 1.10 @@ -1,23 +1,26 @@ -Install nsopenssl

    Install nsopenssl

    This AOLserver module is required if you want people to connect to your site via +Install nsopenssl

    Install nsopenssl

    By Joel Aufrecht and Malte Sussdorff

    + OpenACS docs are written by the named authors, and may be edited + by OpenACS documentation staff. +

    This AOLserver module is required if you want people to connect to your site via https. These commands compile nsopenssl and install it, along with a tcl helper script to handle https connections. You will also need ssl certificates. Because those should be different for each server service, you won't need those instructions until - later. You will need the unpacked Aolserver tarball in + later.

    Install on AOLserver3

    You will need the unpacked Aolserver tarball in /usr/local/src/aolserver and the nsopenssl tarball in /tmp.

    Red Hat 9 note: see this - thread for details on compiling nsopenssl.)

    [root@yourserver bin]# cd /usr/local/src/aolserver
    -[root@yourserver aolserver]# wget --passive http://www.scottg.net/download/nsopenssl-2.1.tar.gz
    -[root@yourserver aolserver]# tar xzf nsopenssl-2.1.tar.gz 
    -[root@yourserver aolserver]# cd nsopenssl-2.1
    -[root@yourserver nsopenssl-2.1]# make OPENSSL=/usr/local/ssl
    +          thread for details on compiling nsopenssl.)

    [root bin]# cd /usr/local/src/aolserver
    +[root aolserver]# wget --passive http://www.scottg.net/download/nsopenssl-2.1.tar.gz
    +[root aolserver]# tar xzf nsopenssl-2.1.tar.gz 
    +[root aolserver]# cd nsopenssl-2.1
    +[root nsopenssl-2.1]# make OPENSSL=/usr/local/ssl
     gcc -I/usr/local/ssl/include -I../aolserver/include -D_REENTRANT=1 -DNDEBUG=1 -g -fPIC -Wall -Wno-unused -mcpu=i686 -DHAVE_CMMSG=1 -DUSE_FIONREAD=1 -DHAVE_COND_EINTR=1   -c -o nsopenssl.o nsopenssl.c
     (many lines omitted)
     gcc -shared -nostartfiles -o nsopenssl.so nsopenssl.o config.o init.o ssl.o thread.o tclcmds.o -L/usr/local/ssl/lib -lssl -lcrypto
    -[root@yourserver nsopenssl-2.1]# cp nsopenssl.so /usr/local/aolserver/bin
    -[root@yourserver nsopenssl-2.1]# cp https.tcl /usr/local/aolserver/modules/tcl/
    -[root@yourserver nsopenssl-2.1]#
    +[root nsopenssl-2.1]# cp nsopenssl.so /usr/local/aolserver/bin
    +[root nsopenssl-2.1]# cp https.tcl /usr/local/aolserver/modules/tcl/
    +[root nsopenssl-2.1]#
     cd /usr/local/src/aolserver
     wget --passive http://www.scottg.net/download/nsopenssl-2.1.tar.gz
     tar xzf nsopenssl-2.1.tar.gz 
    @@ -31,4 +34,29 @@
     cd nsopenssl-2.1
     make OPENSSL=/usr/lib/ssl
     cp nsopenssl.so /usr/local/aolserver/bin
    -cp https.tcl /usr/local/aolserver/modules/tcl/
    View comments on this page at openacs.org
    +cp https.tcl /usr/local/aolserver/modules/tcl/

    Install on AOLserver4

    You will need the AOLserver4 source in /usr/local/src/aolserver/aolserver and OpenSSL installed in /usr/local/ssl (or at least symlinked there).

    [root bin]# cd /usr/local/src/aolserver
    +[root aolserver]# cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver login
    +[root aolserver]# cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nsopenssl
    +[root aolserver]# cd nsopenssl
    +[root nsopenssl]# make OPENSSL=/usr/local/ssl
    +gcc -I/usr/local/ssl/include (many items omitted)  -c -o sslcontext.o sslcontext.c
    +(many lines omitted)
    +[root nsopenssl-2.1]# make install OPENSSL=/usr/local/ssl INST=/usr/local/aolserver
    +[root nsopenssl-2.1]#
    +cd /usr/local/src/aolserver
    +cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver login
    +cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/aolserver co nsopenssl
    +cd nsopenssl
    +make OPENSSL=/usr/local/ssl 
    +make install OPENSSL=/usr/local/ssl INST=/usr/local/aolserver

    If you have problems starting your server with nsopenssl.so due to missing libssl.so.0.9.7 (or lower), you have to create symlinks +

    +[root nsopenssl]# cd /usr/local/aolserver/lib
    +[root lib]# ln -s /usr/local/ssl/lib/libssl.so.0.9.7 libssl.so.0.9.7
    +[root lib]# ln -s /usr/local/ssl/lib/libcrypto.so.0.9.7 libcrypto.so.0.9.7
    +[root lib]#
    +cd /usr/local/aolserver/lib
    +ln -s /usr/local/ssl/lib/libssl.so.0.9.7 libssl.so.0.9.7
    +ln -s /usr/local/ssl/lib/libcrypto.so.0.9.7 libcrypto.so.0.9.7
    +
    +

    +

    To enable SSL support in your server, make sure your config.tcl file has a section on "OpenSSL 3 with AOLserver4". If your ports for SSL are priviledged (below 1024), you will have to start AOLserver with prebinds for both your HTTP and your HTTPS port (usually by adding -b your_ip:your_http_port,your_ip:your_https_port to the nsd call).

    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/install-nspam.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-nspam.html,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-core-docs/www/install-nspam.html 19 Nov 2003 15:44:50 -0000 1.3 +++ openacs-4/packages/acs-core-docs/www/install-nspam.html 4 Feb 2004 16:47:32 -0000 1.4 @@ -1 +1 @@ -Install nspam
    View comments on this page at openacs.org
    +Install nspam
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/install-origins.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-origins.html,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-core-docs/www/install-origins.html 19 Nov 2003 15:44:50 -0000 1.3 +++ openacs-4/packages/acs-core-docs/www/install-origins.html 4 Feb 2004 16:47:32 -0000 1.4 @@ -1,4 +1,4 @@ -Where did this document come from?

    Where did this document come from?

    +Where did this document come from?

    Where did this document come from?

    This document was created by Vinod Kurup, but it's really just plagiarism from a number of documents that came before it. If I've used something that you've written without proper credit, let me Index: openacs-4/packages/acs-core-docs/www/install-overview.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-overview.html,v diff -u -N -r1.19 -r1.20 --- openacs-4/packages/acs-core-docs/www/install-overview.html 19 Nov 2003 15:44:50 -0000 1.19 +++ openacs-4/packages/acs-core-docs/www/install-overview.html 4 Feb 2004 16:47:33 -0000 1.20 @@ -1,4 +1,4 @@ -Chapter�2.�Installation Overview

    Chapter�2.�Installation Overview

    by Vinod Kurup

    +Chapter�2.�Installation Overview

    Chapter�2.�Installation Overview

    by Vinod Kurup

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/install-php.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-php.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/install-php.html 4 Feb 2004 16:47:33 -0000 1.2 @@ -0,0 +1,11 @@ +Install PHP for use in AOLserver

    Install PHP for use in AOLserver

    By Malte Sussdorff

    + OpenACS docs are written by the named authors, and may be edited + by OpenACS documentation staff. +

    To be able to use PHP software with AOLserver (and OpenACS), you have to install PHP with AOLserver support. Get the latest version from www.php.net. For convenience we get version 4.3.4 from a mirror

    [root root]# cd /usr/local/src
    +[root src]# wget http://de3.php.net/distributions/php-4.3.4.tar.gz
    +[root src]# tar xfz php-4.3.4.tar.gz
    +[root src]# cd php-4.3.4
    +[root php-4.3.4]# cd php-4.3.4
    +[root php-4.3.4]#  ./configure --with-aolserver=/usr/local/aolserver/ --with-pgsql=/usr/local/pg74 --without-mysql
    +[root php-4.3.4]# make install
    +      

    Once installed you can enable this by configuring your config file. Make sure your config file supports php (it should have a php section with it). Furthermore add index.php as the last element to your directoryfile directive.

    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/install-qmail.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-qmail.html,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/acs-core-docs/www/install-qmail.html 11 Dec 2003 23:08:46 -0000 1.15 +++ openacs-4/packages/acs-core-docs/www/install-qmail.html 4 Feb 2004 16:47:33 -0000 1.16 @@ -1,35 +1,35 @@ -Install qmail (OPTIONAL)

    Install qmail (OPTIONAL)

    Qmail is a Mail Transfer Agent. It handles incoming and +Install qmail (OPTIONAL)

    Install qmail (OPTIONAL)

    Qmail is a Mail Transfer Agent. It handles incoming and outgoing mail. Install qmail if you want your OpenACS server to send and receive mail, and you don't want to use an alternate MTA.

    Red Hat 9: all djb tools (qmail, daemontools, ucspi) will fail to compile in Red Hat 9 because of changes to glibc (patches)

    1. Install ucspi.�This program handles incoming tcp connections. - Download ucspi and install it.

      [root@yourserver root]# cd /usr/local/src
      -[root@yourserver src]# wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
      -[root@yourserver src]# tar xzf ucspi-tcp-0.88.tar.gz
      +            Download ucspi and install it.

      [root root]# cd /usr/local/src
      +[root src]# wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
      +[root src]# tar xzf ucspi-tcp-0.88.tar.gz
       cd /usr/local/src 
       wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
       tar xzf ucspi-tcp-0.88.tar.gz 

      Red Hat 9 only

      wget http://moni.csi.hu/pub/glibc-2.3.1/ucspi-tcp-0.88.errno.patch
       cd ucspi-tcp-0.88
       patch -p1 <../ucspi-tcp-0.88.errno.patch
      -cd ..

      All platforms continue:

      [root@yourserver src]# cd ucspi-tcp-0.88
      -[root@yourserver ucspi-tcp-0.88]# make
      +cd ..

      All platforms continue:

      [root src]# cd ucspi-tcp-0.88
      +[root ucspi-tcp-0.88]# make
       ( cat warn-auto.sh; \
       echo 'main="$1"; shift'; \(many lines omitted)
       ./compile instcheck.c
       ./load instcheck hier.o auto_home.o unix.a byte.a
      -[root@yourserver ucspi-tcp-0.88]# make setup check
      +[root ucspi-tcp-0.88]# make setup check
       ./install
       ./instcheck
      -[root@yourserver ucspi-tcp-0.88]#
      +[root ucspi-tcp-0.88]#
       
       cd ucspi-tcp-0.88 
       make 
       make setup check

      Verify that ucspi-tcp was installed successfully by -running the tcpserver program which is part of ucspi-tcp:

      [root@yourserver ucspi-tcp-0.88]# tcpserver
      +running the tcpserver program which is part of ucspi-tcp:

      [root ucspi-tcp-0.88]# tcpserver
       tcpserver: usage: tcpserver [ -1UXpPhHrRoOdDqQv ] [ -c limit ] [ -x rules.cdb ] [ -B banner ] [ -g gid ] [ -u uid
       ] [ -b backlog ] [ -l localname ] [ -t timeout ] host port program
      -[root@yourserver ucspi-tcp-0.88]#
      -

      +[root ucspi-tcp-0.88]# +

      (I'm not sure if this next step is 100% necessary, but when I skip it I get problems. If you get the error 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) then you need to do this.) AOLserver sends outgoing mail via the ns_sendmail command, which pipes a command to the sendmail executable. Or, in our @@ -40,13 +40,13 @@ Unless this mail is addressed to the same machine, qmail thinks that it's an attempt to relay mail, and rejects it. So these two commands set up an exception so that any mail sent from 127.0.0.1 is allowed to -send outgoing mail.

      [root@yourserver ucspi-tcp-0.88]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/tcp.smtp.txt /etc/tcp.smtp
      -[root@yourserver ucspi-tcp-0.88]# tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
      -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/tcp.smtp.txt /etc/tcp.smtp 
      -tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp 
    2. Install Qmail.�

      Download qmail, - set up the standard supporting users and build the binaries:

      [root@yourserver root]# cd /usr/local/src
      -[root@yourserver src]# wget http://www.qmail.org/netqmail-1.04.tar.gz
      -[root@yourserver src]# tar xzf netqmail-1.04.tar.gz
      +send outgoing mail.

      [root ucspi-tcp-0.88]# cp /tmp//packages/acs-core-docs/www/files/tcp.smtp.txt /etc/tcp.smtp
      +[root ucspi-tcp-0.88]# tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
      +cp /tmp//packages/acs-core-docs/www/files/tcp.smtp.txt /etc/tcp.smtp 
      +tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp 
    3. Install Qmail.�

      Download qmail, + set up the standard supporting users and build the binaries:

      [root root]# cd /usr/local/src
      +[root src]# wget http://www.qmail.org/netqmail-1.04.tar.gz
      +[root src]# tar xzf netqmail-1.04.tar.gz
       --15:04:11--  http://www.qmail.org/netqmail-1.04.tar.gz
                  => `netqmail-1.04.tar.gz'
       Resolving www.qmail.org... done.
      @@ -58,18 +58,18 @@
       
       15:04:21 (24.04 KB/s) - `netqmail-1.04.tar.gz' saved [242310/242310]
       
      -[root@yourserver src]# mkdir /var/qmail
      -[root@yourserver src]# groupadd nofiles
      -[root@yourserver src]# useradd -g nofiles -d /var/qmail/alias alias
      -[root@yourserver src]# useradd -g nofiles -d /var/qmail qmaild
      -[root@yourserver src]# useradd -g nofiles -d /var/qmail qmaill
      -[root@yourserver src]# useradd -g nofiles -d /var/qmail qmailp
      -[root@yourserver src]# groupadd qmail
      -[root@yourserver src]# useradd -g qmail -d /var/qmail qmailq
      -[root@yourserver src]# useradd -g qmail -d /var/qmail qmailr
      -[root@yourserver src]# useradd -g qmail -d /var/qmail qmails
      -[root@yourserver src]# cd netqmail-1.04
      -[root@yourserver netqmail-1.04]# ./collate.sh
      +[root src]# mkdir /var/qmail
      +[root src]# groupadd nofiles
      +[root src]# useradd -g nofiles -d /var/qmail/alias alias
      +[root src]# useradd -g nofiles -d /var/qmail qmaild
      +[root src]# useradd -g nofiles -d /var/qmail qmaill
      +[root src]# useradd -g nofiles -d /var/qmail qmailp
      +[root src]# groupadd qmail
      +[root src]# useradd -g qmail -d /var/qmail qmailq
      +[root src]# useradd -g qmail -d /var/qmail qmailr
      +[root src]# useradd -g qmail -d /var/qmail qmails
      +[root src]# cd netqmail-1.04
      +[root netqmail-1.04]# ./collate.sh
       
       You should see 7 lines of text below.  If you see anything
       else, then something might be wrong.
      @@ -80,8 +80,8 @@
       [5] Renaming qmail-1.03 to netqmail-1.04...
       [6] Continue installing qmail using the instructions found at:
       [7] http://www.lifewithqmail.org/lwq.html#installation
      -[root@yourserver netqmail-1.04]# cd netqmail-1.04
      -[root@yourserver netqmail-1.04]# make setup check
      +[root netqmail-1.04]# cd netqmail-1.04
      +[root netqmail-1.04]# make setup check
       ( cat warn-auto.sh; \
       echo CC=\'`head -1 conf-cc`\'; \(many lines omitted)
       ./install
      @@ -102,11 +102,11 @@
       cd netqmail-1.04
       ./collate.sh
       cd netqmail-1.04
      -make setup check

      Replace sendmail with qmail's wrapper.

      [root@yourserver qmail-1.03]# rm -f /usr/bin/sendmail /usr/sbin/sendmail
      -[root@yourserver qmail-1.03]# ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
      -[root@yourserver qmail-1.03]#
      +make setup check

      Replace sendmail with qmail's wrapper.

      [root qmail-1.03]# rm -f /usr/bin/sendmail /usr/sbin/sendmail
      +[root qmail-1.03]# ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
      +[root qmail-1.03]#
       rm -f /usr/bin/sendmail /usr/sbin/sendmail
      -ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail

      Configure qmail - specifically, run the config script to set up files in /var/qmail/control specifying the computer's identity and which addresses it should accept mail for. This command will automatically set up qmail correctly if you have correctly set a valid host nome. If not, you'll want to read /var/qmail/doc/INSTALL.ctl to find out how to configure qmail.

      [root@yourserver qmail-1.03]# ./config-fast yourserver.test
      +ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail

      Configure qmail - specifically, run the config script to set up files in /var/qmail/control specifying the computer's identity and which addresses it should accept mail for. This command will automatically set up qmail correctly if you have correctly set a valid host nome. If not, you'll want to read /var/qmail/doc/INSTALL.ctl to find out how to configure qmail.

      [root qmail-1.03]# ./config-fast yourserver.test
       Your fully qualified host name is yourserver.test.
       Putting yourserver.test into control/me...
       Putting yourserver.test into control/defaultdomain...
      @@ -115,67 +115,67 @@
       Putting yourserver.test into control/rcpthosts...
       Now qmail will refuse to accept SMTP messages except to yourserver.test.
       Make sure to change rcpthosts if you add hosts to locals or virtualdomains!
      -[root@yourserver qmail-1.03]#
      -./config-fast yourserver.test

      All incoming mail that isn't for a specific user is handled by the alias user. This includes all root mail. These commands prepare the alias user to receive mail.

      [root@yourserver qmail-1.03]# cd ~alias; touch .qmail-postmaster .qmail-mailer-daemon .qmail-root
      -[root@yourserver alias]# chmod 644 ~alias/.qmail*
      -[root@yourserver alias]# /var/qmail/bin/maildirmake ~alias/Maildir/
      -[root@yourserver alias]# chown -R alias.nofiles /var/qmail/alias/Maildir
      -[root@yourserver alias]#
      +[root qmail-1.03]#
      +./config-fast yourserver.test

      All incoming mail that isn't for a specific user is handled by the alias user. This includes all root mail. These commands prepare the alias user to receive mail.

      [root qmail-1.03]# cd ~alias; touch .qmail-postmaster .qmail-mailer-daemon .qmail-root
      +[root alias]# chmod 644 ~alias/.qmail*
      +[root alias]# /var/qmail/bin/maildirmake ~alias/Maildir/
      +[root alias]# chown -R alias.nofiles /var/qmail/alias/Maildir
      +[root alias]#
       cd ~alias; touch .qmail-postmaster .qmail-mailer-daemon .qmail-root 
       chmod 644 ~alias/.qmail* 
       /var/qmail/bin/maildirmake ~alias/Maildir/ 
      -chown -R alias.nofiles /var/qmail/alias/Maildir

      Configure qmail to use the Maildir delivery format - (instead of mbox), and install a version of the qmail startup script modified to use Maildir.

      [root@yourserver alias]# echo "./Maildir" > /var/qmail/bin/.qmail
      -[root@yourserver alias]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail.rc.txt /var/qmail/rc
      -[root@yourserver alias]# chmod 755 /var/qmail/rc
      -[root@yourserver alias]# 
      +chown -R alias.nofiles /var/qmail/alias/Maildir

      Configure qmail to use the Maildir delivery format + (instead of mbox), and install a version of the qmail startup script modified to use Maildir.

      [root alias]# echo "./Maildir" > /var/qmail/bin/.qmail
      +[root alias]# cp /tmp//packages/acs-core-docs/www/files/qmail.rc.txt /var/qmail/rc
      +[root alias]# chmod 755 /var/qmail/rc
      +[root alias]# 
       echo "./Maildir" > /var/qmail/bin/.qmail 
      -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail.rc.txt /var/qmail/rc 
      +cp /tmp//packages/acs-core-docs/www/files/qmail.rc.txt /var/qmail/rc 
       chmod 755 /var/qmail/rc 
       

      Set up the skeleton directory so that new users will - be configured for qmail.

      [root@yourserver root]# /var/qmail/bin/maildirmake /etc/skel/Maildir
      -[root@yourserver root]# echo "./Maildir/" > /etc/skel/.qmail
      -[root@yourserver root]# 
      +          be configured for qmail.

      [root root]# /var/qmail/bin/maildirmake /etc/skel/Maildir
      +[root root]# echo "./Maildir/" > /etc/skel/.qmail
      +[root root]# 
       /var/qmail/bin/maildirmake /etc/skel/Maildir
       echo "./Maildir/" > /etc/skel/.qmail

      As recommended, we will run qmail with daemontools - control files. Create daemontools control directories, set up a daemontools control script, copy the supervise control files, and set permissions. The last line links the control directories to /service, which will cause supervise to detect them and execute the run files, causing qmail to start.

      [root@yourserver root]# mkdir -p /var/qmail/supervise/qmail-send/log
      -[root@yourserver root]# mkdir -p /var/qmail/supervise/qmail-smtpd/log
      -[root@yourserver root]# mkdir /var/log/qmail
      -[root@yourserver root]# chown qmaill /var/log/qmail
      -[root@yourserver root]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmailctl.txt /var/qmail/bin/qmailctl
      -[root@yourserver root]# chmod 755 /var/qmail/bin/qmailctl
      -[root@yourserver root]# ln -s /var/qmail/bin/qmailctl /usr/bin
      -[root@yourserver root]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-send-run.txt /var/qmail/supervise/qmail-send/run 
      -[root@yourserver root]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-send-log-run.txt /var/qmail/supervise/qmail-send/log/run
      -[root@yourserver root]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-smtpd-run.txt /var/qmail/supervise/qmail-smtpd/run
      -[root@yourserver root]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-smtpd-log-run.txt /var/qmail/supervise/qmail-smtpd/log/run
      -[root@yourserver root]# chmod 755 /var/qmail/supervise/qmail-send/run
      -[root@yourserver root]# chmod 755 /var/qmail/supervise/qmail-send/log/run
      -[root@yourserver root]# chmod 755 /var/qmail/supervise/qmail-smtpd/run
      -[root@yourserver root]# chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
      -[root@yourserver root]# ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service
      -[root@yourserver root]# ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service
      +          control files.  Create daemontools control directories, set up a daemontools control script, copy the supervise control files, and set permissions.  The last line links the control directories to /service, which will cause supervise to detect them and execute the run files, causing qmail to start.

      [root root]# mkdir -p /var/qmail/supervise/qmail-send/log
      +[root root]# mkdir -p /var/qmail/supervise/qmail-smtpd/log
      +[root root]# mkdir /var/log/qmail
      +[root root]# chown qmaill /var/log/qmail
      +[root root]# cp /tmp//packages/acs-core-docs/www/files/qmailctl.txt /var/qmail/bin/qmailctl
      +[root root]# chmod 755 /var/qmail/bin/qmailctl
      +[root root]# ln -s /var/qmail/bin/qmailctl /usr/bin
      +[root root]# cp /tmp//packages/acs-core-docs/www/files/qmail-send-run.txt /var/qmail/supervise/qmail-send/run 
      +[root root]# cp /tmp//packages/acs-core-docs/www/files/qmail-send-log-run.txt /var/qmail/supervise/qmail-send/log/run
      +[root root]# cp /tmp//packages/acs-core-docs/www/files/qmail-smtpd-run.txt /var/qmail/supervise/qmail-smtpd/run
      +[root root]# cp /tmp//packages/acs-core-docs/www/files/qmail-smtpd-log-run.txt /var/qmail/supervise/qmail-smtpd/log/run
      +[root root]# chmod 755 /var/qmail/supervise/qmail-send/run
      +[root root]# chmod 755 /var/qmail/supervise/qmail-send/log/run
      +[root root]# chmod 755 /var/qmail/supervise/qmail-smtpd/run
      +[root root]# chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
      +[root root]# ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service
      +[root root]# ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service
       mkdir -p /var/qmail/supervise/qmail-send/log
       mkdir -p /var/qmail/supervise/qmail-smtpd/log
       mkdir /var/log/qmail
       chown qmaill /var/log/qmail
      -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmailctl.txt /var/qmail/bin/qmailctl
      +cp /tmp//packages/acs-core-docs/www/files/qmailctl.txt /var/qmail/bin/qmailctl
       chmod 755 /var/qmail/bin/qmailctl
       ln -s /var/qmail/bin/qmailctl /usr/bin
      -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-send-run.txt /var/qmail/supervise/qmail-send/run
      -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-send-log-run.txt /var/qmail/supervise/qmail-send/log/run
      -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-smtpd-run.txt /var/qmail/supervise/qmail-smtpd/run
      -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/qmail-smtpd-log-run.txt /var/qmail/supervise/qmail-smtpd/log/run
      +cp /tmp//packages/acs-core-docs/www/files/qmail-send-run.txt /var/qmail/supervise/qmail-send/run
      +cp /tmp//packages/acs-core-docs/www/files/qmail-send-log-run.txt /var/qmail/supervise/qmail-send/log/run
      +cp /tmp//packages/acs-core-docs/www/files/qmail-smtpd-run.txt /var/qmail/supervise/qmail-smtpd/run
      +cp /tmp//packages/acs-core-docs/www/files/qmail-smtpd-log-run.txt /var/qmail/supervise/qmail-smtpd/log/run
       chmod 755 /var/qmail/supervise/qmail-send/run
       chmod 755 /var/qmail/supervise/qmail-send/log/run
       chmod 755 /var/qmail/supervise/qmail-smtpd/run
       chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
       ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service
      -

      Wait ten seconds or so, and then verify that that the four qmail processes are running. If uptimes don't rise above 1 second, this may indicate broken scripts that are continuously restarting. In that case, start debugging by checking permissions.

      [root@yourserver root]# qmailctl stat
      +

      Wait ten seconds or so, and then verify that that the four qmail processes are running. If uptimes don't rise above 1 second, this may indicate broken scripts that are continuously restarting. In that case, start debugging by checking permissions.

      [root root]# qmailctl stat
       /service/qmail-send: up (pid 32700) 430 seconds
       /service/qmail-send/log: up (pid 32701) 430 seconds
       /service/qmail-smtpd: up (pid 32704) 430 seconds
       /service/qmail-smtpd/log: up (pid 32705) 430 seconds
       messages in queue: 0
       messages in queue but not yet preprocessed: 0
      -[root@yourserver root]#

      Further verify by sending and receiving email. Incoming mail for root is stored in /var/qmail/alias/Maildir.

    View comments on this page at openacs.org
    +[root root]#

    Further verify by sending and receiving email. Incoming mail for root is stored in /var/qmail/alias/Maildir.

    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/install-redhat.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-redhat.html,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/acs-core-docs/www/install-redhat.html 11 Dec 2003 23:08:46 -0000 1.15 +++ openacs-4/packages/acs-core-docs/www/install-redhat.html 4 Feb 2004 16:47:33 -0000 1.16 @@ -1,4 +1,4 @@ -Appendix�A.�Install Red Hat 8/9

    Appendix�A.�Install Red Hat 8/9

    by Joel Aufrecht

    +Appendix�A.�Install Red Hat 8/9

    Appendix�A.�Install Red Hat 8/9

    by Joel Aufrecht

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    This section takes a blank PC and sets up some supporting @@ -26,7 +26,7 @@

    1. Unplug the network cable from your computer. We don't want to connect to the network until we're sure the computer is secure. - + (Wherever you see the word secure, you should always read it as, "secure enough for our purposes, given the amount of work we're @@ -54,7 +54,7 @@ Review (and modify if needed) the partitions created and click Next

    2. On the pop-up window asking "Are you sure you want to do this?" click Yes - IF YOU ARE WIPING YOUR HARD DRIVE.

    3. Click Next on the boot loader screen

  • Configure Networking. + IF YOU ARE WIPING YOUR HARD DRIVE.

  • Click Next on the boot loader screen

  • Configure Networking. Again, if you know what you're doing, do this step yourself, being sure to note the firewall holes. Otherwise, follow the instructions in this step to set up a computer directly connected to the internet with a dedicated IP address.

    1. DHCP is a system by which a computer that @@ -75,7 +75,7 @@ Mail (SMTP). In the Other ports box, enter 443, 8000, 8443. Click Next. -Port 443 is for https (http over ssl), and 8000 and 8443 are http and https access to the development server we'll be setting up.

  • Select any additional languages you want the +Port 443 is for https (http over ssl), and 8000 and 8443 are http and https access to the development server we'll be setting up.

  • Select any additional languages you want the computer to support and then click Next

  • Choose your time zone and click Next.

  • Type in a root password, twice.

  • On the Package selection page, we're going to @@ -87,13 +87,13 @@ risk that's still screened by the firewall, or a resource hog. Just don't install a database or web server, because that would conflict with the database and web server we'll install later. -

    check Editors (this installs emacs),
    click Details next to Text-based Internet, check lynx, and click OK;
    check Authoring and Publishing (this installs docbook),
    uncheck Server Configuration Tools,
    uncheck Web Server,
    uncheck Windows File Server,
    check SQL Database Server (this installs PostgreSQL),
    check Development Tools (this installs gmake and other build tools),
    uncheck Administration Tools, and
    uncheck Printing Support.

    At the bottom, check Select Individual Packages and click Next

  • We need to fine-tune the exact list of packages. +

    check Editors (this installs emacs),
    click Details next to Text-based Internet, check lynx, and click OK;
    check Authoring and Publishing (this installs docbook),
    uncheck Server Configuration Tools,
    uncheck Web Server,
    uncheck Windows File Server,
    check SQL Database Server (this installs PostgreSQL),
    check Development Tools (this installs gmake and other build tools),
    uncheck Administration Tools, and
    uncheck Printing Support.

    At the bottom, check Select Individual Packages and click Next

  • We need to fine-tune the exact list of packages. The same rules apply as in the last step - you can add more stuff, but you shouldn't remove anything the guide adds. We're going to go through all the packages in one big list, so select Flat View and wait. In a minute, a -list of packages will appear.

    uncheck apmd (monitors power, not very useful for servers),
    check ImageMagick (required for the photo-album packages,
    uncheckisdn4k-utils (unless you are using isdn, this installs a useless daemon),
    check mutt (a mail program that reads Maildir),
    uncheck nfs-utils (nfs is a major security risk),
    uncheck pam-devel (I don't remember why, but we don't want this),
    uncheck portmap,
    uncheck postfix (this is an MTA, but we're going to install qmail later),
    check postgresql-devel,
    uncheck rsh (rsh is a security hole),
    uncheck sendmail (sendmail is an insecure MTA; we're going to install qmail instead later),
    check tcl (we need tcl), and
    uncheck xinetd (xinetd handles incoming tcp connections. We'll install a different, more secure program, ucspi-tcp).
    Click Next
  • Red Hat isn't completely happy with the combination +list of packages will appear.

    uncheck apmd (monitors power, not very useful for servers),
    check ImageMagick (required for the photo-album packages,
    uncheckisdn4k-utils (unless you are using isdn, this installs a useless daemon),
    check mutt (a mail program that reads Maildir),
    uncheck nfs-utils (nfs is a major security risk),
    uncheck pam-devel (I don't remember why, but we don't want this),
    uncheck portmap,
    uncheck postfix (this is an MTA, but we're going to install qmail later),
    check postgresql-devel,
    uncheck rsh (rsh is a security hole),
    uncheck sendmail (sendmail is an insecure MTA; we're going to install qmail instead later),
    check tcl (we need tcl), and
    uncheck xinetd (xinetd handles incoming tcp connections. We'll install a different, more secure program, ucspi-tcp).
    Click Next
  • Red Hat isn't completely happy with the combination of packages we've selected, and wants to satisfy some dependencies. Don't let it. On the next screen, choose Ignore Package @@ -110,7 +110,7 @@

  • After it finishes rebooting and shows the login prompt, log in:

    yourserver login: root
     Password:
    -[root@yourserver root]#
  • Install any security patches. For example, insert your CD with +[root root]#

  • Install any security patches. For example, insert your CD with patches, mount it with mount /dev/cdrom, then cd /mnt/cdrom, then rpm -UVH @@ -119,7 +119,7 @@ upgrading all of that. Since you are upgrading the kernel, reboot after this step.

  • Lock down SSH

    1. - + SSH is the protocol we use to connect securely to the computer (replacing telnet, which is insecure). sshd is the daemon that listens for incoming @@ -148,11 +148,11 @@ (The reason for this discrepencies is that, while daemontools is better, it's a pain in the ass to deal with and nobody's had any trouble leaving PostgreSQL the way it is.) -

      [root@yourserver root]# service pcmcia stop
      -[root@yourserver root]# service netfs stop
      -[root@yourserver root]# chkconfig --del pcmcia
      -[root@yourserver root]# chkconfig --del netfs
      -[root@yourserver root]#
      +       

      [root root]# service pcmcia stop
      +[root root]# service netfs stop
      +[root root]# chkconfig --del pcmcia
      +[root root]# chkconfig --del netfs
      +[root root]#
       service pcmcia stop
       service netfs stop
       chkconfig --del pcmcia
      @@ -167,15 +167,15 @@
       Warning: Permanently added 'yourserver.test (1.2.3.4)' (DSA) to the list of known hosts.
       Password:
       Last login: Mon Mar  3 21:15:27 2003 from host-12-01.dsl-sea.seanet.com
      -[remadmin@yourserver remadmin]$ su -
      +[remadmin remadmin]$ su -
       Password: 
      -[root@yourserver root]#
    2. If you didn't burn a CD of patches and use it, can still +[root root]#

    3. If you didn't burn a CD of patches and use it, can still download and install the necessary patches. Here's how to do it for the kernel; you should also check for other critical packages.

      Upgrade the kernel to fix a security hole. The default Red Hat 8.0 system kernel (2.4.18-14, which you can check - with uname -a) has several security problems. Download the new kernel, install it, and reboot.

      [root@yourserver root]# cd /tmp
      -[root@yourserver tmp]# wget http://updates.redhat.com/7.1/en/os/i686/kernel-2.4.18-27.7.x.i686.rpm
      +          with uname -a) has several security problems.  Download the new kernel, install it, and reboot.

      [root root]# cd /tmp
      +[root tmp]# wget http://updates.redhat.com/7.1/en/os/i686/kernel-2.4.18-27.7.x.i686.rpm
       --20:39:00--  http://updates.redhat.com/7.1/en/os/i686/kernel-2.4.18-27.7.x.i686.rpm
                  => `kernel-2.4.18-27.7.x.i686.rpm'
       Resolving updates.redhat.com... done.
      @@ -191,13 +191,13 @@
       warning: kernel-2.4.18-27.7.x.i686.rpm: V3 DSA signature: NOKEY, key ID db42a60e
       Preparing...                ########################################### [100%]
          1:kernel                 ########################################### [100%]
      -[root@yourserver tmp]# reboot
      +[root tmp]# reboot
       
       Broadcast message from root (pts/0) (Sat May  3 20:46:39 2003):
       
       The system is going down for reboot NOW!
      -[root@yourserver tmp]#
      +[root tmp]#
       cd /tmp
       wget http://updates.redhat.com/7.1/en/os/i686/kernel-2.4.18-27.7.x.i686.rpm
       rpm -Uvh kernel-2.4.18-27.7.x.i686.rpm
      -reboot
  • View comments on this page at openacs.org
    +reboot
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/install-resources.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-resources.html,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-core-docs/www/install-resources.html 19 Nov 2003 15:44:50 -0000 1.3 +++ openacs-4/packages/acs-core-docs/www/install-resources.html 4 Feb 2004 16:47:33 -0000 1.4 @@ -1,4 +1,4 @@ -Resources

    Resources

    +Resources

    Resources

    Here are some resources that OpenACS users have found useful.

    Books

    • Index: openacs-4/packages/acs-core-docs/www/install-squirrelmail.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-squirrelmail.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/install-squirrelmail.html 4 Feb 2004 16:47:33 -0000 1.2 @@ -0,0 +1,10 @@ +Install Squirrelmail for use as a webmail system for OpenACS

      Install Squirrelmail for use as a webmail system for OpenACS

      By Malte Sussdorff

      + OpenACS docs are written by the named authors, and may be edited + by OpenACS documentation staff. +

      This section is work in progress. It will detail how you can install Squirrelmail as a webmail frontend for OpenACS, thereby neglecting the need to have a seperate webmail package within OpenACS

      [service0 service0]# cd www
      +[service0 www]# wget http://cesnet.dl.sourceforge.net/sourceforge/squirrelmail/squirrelmail-1.4.2.tar.gz
      +[service0 www]# tar xfz squirrelmail-1.4.2.tar.gz
      +[service0 www]# mv squirrelmail-1.4.2 mail
      +[service0 www]# cd mail/config
      +[service0 www]# ./conf.pl
      +      

      Now you are about to configure Squirrelmail. The configuration heavily depends on your setup, so no instructions are given here.

      View comments on this page at openacs.org
      Index: openacs-4/packages/acs-core-docs/www/install-steps.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-steps.html,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/acs-core-docs/www/install-steps.html 11 Dec 2003 23:08:46 -0000 1.8 +++ openacs-4/packages/acs-core-docs/www/install-steps.html 4 Feb 2004 16:47:33 -0000 1.9 @@ -1,28 +1,24 @@ -Basic Steps

      Basic Steps

      +Basic Steps

      Basic Steps

      The basic steps for getting OpenACS installed are:

      1. Install an OS and supporting software (see Install a Unix-like OS or Appendix�A, Install Red Hat 8/9 for more details).

      2. Install a database (see Install Oracle or Install PostgreSQL).

      3. Install AOLserver (see Install AOLserver 3.3oacs1).

      4. Create a unique database and system user. Install the OpenACS tarball, start and AOLserver instance, and use the OpenACS web pages to complete installation - (see Install OpenACS 5.0.0b4).

      There are specific instructions available for Mac OS X and + (see Install OpenACS ).

    There are specific instructions available for Mac OS X and Windows2000 available (see the section called “OpenACS Installation Guide for Mac OS X” or the section called “OpenACS Installation Guide for Windows2000” for those).

    Binaries and other shortcuts

    1. The patched version of AOLserver we use is not currently available in a precompiled binary.

    2. The packaged version of - PostgreSQL in Debian and Red Hat and FreeBSD ports works fine.

    3. An experimental script automates the OpenACS checkout and + PostgreSQL in Debian and Red Hat and FreeBSD ports works fine.

    4. An experimental script automates the OpenACS checkout and installation.

    System Requirements

    You will need a PC (or equivalent) with at least these minimum requirements:

    • 128MB RAM (much more if you want Oracle)

    • 1GB free space on your hard drive (much more if you want Oracle)

    • A Unix-like operating system with Tcl, tDOM, and a mail transport agent like sendmail or qmail. (see the section called “Prerequisite Software”)

    - All of the software that you will need is free and open-source, + All of the software mentioned is free and open-source, except for Oracle. You can obtain a free copy of Oracle for development purposes. This is described in the Acquire Oracle section. -

    Table�2.1.�Version Compatibility Matrix

    OpenACS Version3.2.5 4.5 4.6 4.6.14.6.24.6.35.0.0
    AOLserver3VerifiedNo
    3.3+ad13UntestedVerified
    3.3oacs1UntestedVerified
    3.4.2No
    3.4.2oacs1UntestedVerifiedUntested
    3.5.5UntestedVerifiedNo
    4.0UntestedVerified
    PostgreSQL7.0VerifiedNo
    7.2.xVerifiedNo
    7.3.2 - 7.3.4NoVerified
    7.4NoUntested
    Oracle8.1.6Verified
    8.1.7Verified
    9iNoUntested

    - At the time of writing AOLserver 4.0 has been tested with OpenACS and works but has not been used in - production. OpenACS 5.0.0 installs successfully on PostgreSQL 7.4 and Oracle 9i but not all packages - outside core have been tested.

    How to use this guide

    • This is text you will see on screen, such as a Button or link in a radio button list or menu.

    • This is text that you will type.

    • This is text from a program or file which you may need to @@ -31,19 +27,19 @@ }

    • This is text that you will see and type in a command shell, including text you may have to change. It is followed by a list of just the commands, - which you can copy and paste.

      -[root@localhost root]# su - nsadmin
      -[nsadmin@localhost aolserver]$ svc -d /service/server1
      -[nsadmin@localhost aolserver]$ dropdb server1
      +          which you can copy and paste. The command prompt varies by system; in the examples we use the form[service0 aolserver]$, where service0 is the current user and aolserver is the current directory.  The root prompt is shown ending in # and all other prompts in $.

      +[root root]# su - service0
      +[service0 aolserver]$ svc -d /service/service0
      +[service0 aolserver]$ dropdb service0
       DROP DATABASE
      -[nsadmin@localhost aolserver]$ createdb server1
      +[service0 aolserver]$ createdb service0
       CREATE DATABASE
      -su - nsadmin
      -svc -d /service/server1
      -dropdb server1
      -createdb server1

    Paths and Users

    Table�2.2.�Default directories for a standard install

    Fully qualified domain name of your serveryourserver.test
    name of administrative access accountremadmin
    OpenACS serviceservice0
    OpenACS service accountservice0
    OpenACS database nameservice0
    Root of OpenACS service file tree (SERVERROOT)/var/lib/aolserver/service0
    Location of source code tarballs for new software/tmp
    The OpenACS tarball contains some files which +su - service0 +svc -d /service/service0 +dropdb service0 +createdb service0

    Paths and Users

    Table�2.1.�Default directories for a standard install

    Fully qualified domain name of your serveryourserver.test
    name of administrative access accountremadmin
    OpenACS serviceservice0
    OpenACS service accountservice0
    OpenACS database nameservice0
    Root of OpenACS service file tree (SERVERROOT)/var/lib/aolserver/service0
    Location of source code tarballs for new software/tmp
    The OpenACS tarball contains some files which are useful while setting up other software. Those - files are located at:/tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files
    Database backup directory/var/lib/aolserver/service0/database-backup
    Service config files/var/lib/aolserver/service0/etc
    Service log files/var/lib/aolserver/service0/log
    Compile directory/usr/local/src
    PostgreSQL directory/usr/local/pgsql
    AOLserver directory/usr/local/aolserver

    + files are located at:

    /tmp//packages/acs-core-docs/www/files
    Database backup directory/var/lib/aolserver/service0/database-backup
    Service config files/var/lib/aolserver/service0/etc
    Service log files/var/lib/aolserver/service0/log
    Compile directory/usr/local/src
    PostgreSQL directory/usr/local/pgsql
    AOLserver directory/usr/local/aolserver

    None of these locations are set in stone - they're simply the values that we've chosen. The values that you'll probably want to change, such as service name, are Index: openacs-4/packages/acs-core-docs/www/install-tclwebtest.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/install-tclwebtest.html,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/acs-core-docs/www/install-tclwebtest.html 11 Dec 2003 23:08:46 -0000 1.5 +++ openacs-4/packages/acs-core-docs/www/install-tclwebtest.html 4 Feb 2004 16:47:33 -0000 1.6 @@ -1,8 +1,8 @@ -Install tclwebtest.

    Install tclwebtest.

    Download the tclwebtest +Install tclwebtest.

    Install tclwebtest.

    Download the tclwebtest source, unpack it, and put it an appropriate place. As root:

    cd /tmp
     tar xvzf tclwebtest-0.3.tar.gz
     mv tclwebtest-0.3 /usr/local/
     ln -s /usr/local/tclwebtest-0.3 /usr/local/tclwebtest
     ln -s /usr/local/tclwebtest/tclwebtest /usr/local/bin
    -
    View comments on this page at openacs.org
    +
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/ix01.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/ix01.html,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-core-docs/www/ix01.html 11 Dec 2003 23:08:46 -0000 1.3 +++ openacs-4/packages/acs-core-docs/www/ix01.html 4 Feb 2004 16:47:33 -0000 1.4 @@ -1,2 +1,2 @@ -Index

    Index

    A

    AOLserver
    configuration, Install from tarball
    Automated tests, Write automated tests

    C

    computeroutput
    code, Code
    cvs
    initializing, Initialize CVS (OPTIONAL)
    setup, Using CVS with an OpenACS Site

    D

    daemontools
    installation, Install Daemontools (OPTIONAL)
    docbook
    installation, Install Red Hat 8/9
    DocBook
    DTD, Why DocBook?
    emacs configuration for, Add PSGML commands to emacs init file (OPTIONAL)
    Document structure, Document Structure

    E

    emacs
    installation, Install Red Hat 8/9
    emphasis
    bold, italics, Emphasis

    G

    Graphics
    Images, Graphics

    I

    informaltable
    table, Tables

    L

    language
    installation, Install Red Hat 8/9
    Linking, Links
    lists, Lists

    O

    OpenACS Package, What a Package Looks Like

    P

    photo-album
    installation (see ImageMagick)
    Postgres
    Vacuuming, Install from tarball

    Q

    qmail
    installation, Install qmail (OPTIONAL)
    Maildir, Install qmail (OPTIONAL)
    rcpthosts error message, Install qmail (OPTIONAL)

    T

    The publish point for new packages should be - fixed., Prepare the package for distribution.

    U

    ulink, Links
    Unicode
    in PostgreSQL, Install PostgreSQL
    upgrade
    OpenACS 4.5 to 4.6
    Linux/Unix, Upgrading 4.5 to 4.6

    X

    XML guidelines, Why DocBook?
    xref
    linkend, Links
    xreflabel, Headlines, Sections
    View comments on this page at openacs.org
    +Index

    Index

    A

    AOLserver
    configuration, Install from tarball
    Automated tests, Write automated tests

    C

    computeroutput
    code, Code
    cvs
    initializing, Initialize CVS (OPTIONAL)
    setup, Using CVS with an OpenACS Site

    D

    daemontools
    installation, Install Daemontools (OPTIONAL)
    docbook
    installation, Install Red Hat 8/9
    DocBook
    DTD, Why DocBook?
    emacs configuration for, Add PSGML commands to emacs init file (OPTIONAL)
    Document structure, Document Structure

    E

    emacs
    installation, Install Red Hat 8/9
    emphasis
    bold, italics, Emphasis

    G

    Graphics
    Images, Graphics

    I

    informaltable
    table, Tables

    L

    language
    installation, Install Red Hat 8/9
    Linking, Links
    lists, Lists

    O

    OpenACS Package, What a Package Looks Like

    P

    photo-album
    installation (see ImageMagick)
    Postgres
    Vacuuming, Install from tarball

    Q

    qmail
    installation, Install qmail (OPTIONAL)
    Maildir, Install qmail (OPTIONAL)
    rcpthosts error message, Install qmail (OPTIONAL)

    T

    The publish point for new packages should be + fixed., Prepare the package for distribution.

    U

    ulink, Links
    Unicode
    in PostgreSQL, Install PostgreSQL
    upgrade
    OpenACS 4.5 to 4.6.x
    Linux/Unix, Upgrading 4.5 or higher to 4.6.3

    X

    XML guidelines, Why DocBook?
    xref
    linkend, Links
    xreflabel, Headlines, Sections
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/kernel-doc.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/kernel-doc.html,v diff -u -N -r1.19 -r1.20 --- openacs-4/packages/acs-core-docs/www/kernel-doc.html 11 Dec 2003 23:08:46 -0000 1.19 +++ openacs-4/packages/acs-core-docs/www/kernel-doc.html 4 Feb 2004 16:47:33 -0000 1.20 @@ -1 +1 @@ -Chapter�11.�Kernel Documentation
    View comments on this page at openacs.org
    +Chapter�11.�Kernel Documentation
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/kernel-overview.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/kernel-overview.html,v diff -u -N -r1.14 -r1.15 --- openacs-4/packages/acs-core-docs/www/kernel-overview.html 11 Dec 2003 23:08:46 -0000 1.14 +++ openacs-4/packages/acs-core-docs/www/kernel-overview.html 4 Feb 2004 16:47:33 -0000 1.15 @@ -1,4 +1,4 @@ -Overview

    Overview

    • +Overview

      Overview

      • The OpenACS Kernel, which handles system-wide necessities such as metadata, security, users and groups, subsites, and package Index: openacs-4/packages/acs-core-docs/www/mac-installation.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/mac-installation.html,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/acs-core-docs/www/mac-installation.html 19 Nov 2003 15:44:50 -0000 1.18 +++ openacs-4/packages/acs-core-docs/www/mac-installation.html 4 Feb 2004 16:47:33 -0000 1.19 @@ -1,2 +1,8 @@ -OpenACS Installation Guide for Mac OS X

        OpenACS Installation Guide for Mac OS X

        There are several resources for installing on OS X.

        ($Id$)
        View comments on this page at openacs.org
        +OpenACS Installation Guide for Mac OS X

        OpenACS Installation Guide for Mac OS X

        Prerequisites.�Install readline:

        1. Download readline from http://ftp.gnu.org/pub/gnu/readline/readline-4.3.tar.gz into /usr/local/src

        2. Extract readline in /usr/local/src, configure, compile, and install:

          su - root
          +cd /usr/local/src
          +tar xvfz readline-4.3.tar.gz
          +readline-4.3
          +./configure
          +make
          +make install
        3. Proceed with the Unix-like system instructions. OS X is incompatible with Oracle 8, and Oracle 9i on OSX is not yet verified for OpenACS. So continue with Install PostgreSQL. Additional special steps for OS X are documented inline with the standard Unix-like instructions.

        Additional resources for installing on OS X.

        ($Id$)
        View comments on this page at openacs.org
        Index: openacs-4/packages/acs-core-docs/www/maint-performance.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/maint-performance.html,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-core-docs/www/maint-performance.html 28 Jan 2004 11:17:01 -0000 1.3 +++ openacs-4/packages/acs-core-docs/www/maint-performance.html 4 Feb 2004 16:47:33 -0000 1.4 @@ -1,7 +1,7 @@ Diagnosing Performance Problems

        Diagnosing Performance Problems

        • Did performance problems happen overnight, or did they sneak up on you? Any clue what caused the performance problems (e.g. loading 20K users into .LRN)

        • Is the file system out of space? Is the machine swapping to disk constantly?

        • Isolating and solving database problems.

          • Without daily internal maintenance, most databases slowly degrade in performance. For PostGreSQL, see the section called “Vacuum Postgres nightly”. For Oracle, use exec dbms_stats.gather_schema_stats('SCHEMA_NAME') (Andrew Piskorski's Oracle notes).

          • You can track the exact amount of time each database query on a page takes:

            1. Go to Main Site : Site-Wide Administration : Install Software

            2. Click on "Install New Application" in "Install from OpenACS Repository"

            3. Choose "ACS Developer Support">

            4. After install is complete, restart the server.

            5. Browse to Developer Support, which is automatically mounted at /ds. -

            6. Turn on Database statistics

            7. Browse directly to a slow page and click "Request Information" at the bottom of the page.

            8. This should return a list of database queries on the page, including the exact query (so it can be cut-paste into psql or oracle) and the time each query took.

              Figure�6.1.�Query Analysis example

              Query Analysis example
          • Identify a runaway Oracle query: first, use ps aux or top to get the UNIX process ID of a runaway Oracle process.

            Log in to SQL*Plus as the admin:

            [service0 ~]$ svrmgrl
            +              

          • Turn on Database statistics

          • Browse directly to a slow page and click "Request Information" at the bottom of the page.

          • This should return a list of database queries on the page, including the exact query (so it can be cut-paste into psql or oracle) and the time each query took.

            Figure�6.1.�Query Analysis example

            Query Analysis example
        • Identify a runaway Oracle query: first, use ps aux or top to get the UNIX process ID of a runaway Oracle process.

          Log in to SQL*Plus as the admin:

          [service0 ~]$ svrmgrl
           
           Oracle Server Manager Release 3.1.7.0.0 - Production
           
          Index: openacs-4/packages/acs-core-docs/www/maintenance-web.html
          ===================================================================
          RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/maintenance-web.html,v
          diff -u -N -r1.16 -r1.17
          --- openacs-4/packages/acs-core-docs/www/maintenance-web.html	11 Dec 2003 23:08:46 -0000	1.16
          +++ openacs-4/packages/acs-core-docs/www/maintenance-web.html	4 Feb 2004 16:47:33 -0000	1.17
          @@ -1,21 +1,21 @@
          -Hosting Web Sites

          Hosting Web Sites

          By Joel Aufrecht

          +Running OpenACS in Production Environments

          Running OpenACS in Production Environments

          By Joel Aufrecht

          OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

          Maintenance tasks, optional software, and alternate configurations for AOLserver.

          Keep AOLserver Alive

          Assuming AOLserver started cleanly in the previous step, we'll set it up so that it's always running, and automatically restarts whenever it dies or is stopped. This step is strongly recommended, even for development sites, because it makes install and maintenance much simpler.

          The Reference Platform uses Daemontools to control AOLserver. A simpler method, using init, is here.

          1. Daemontools must already be installed. If not, install it.

          2. Each service controlled by daemontools must have a +

          Maintenance tasks, optional software, and alternate configurations for AOLserver.

          Starting and Stopping an OpenACS instance.

          The simplest way to start and stop and OpenACS site is to run the startup shell script provided, /var/lib/aolserver/service0/etc/daemontools/run. This runs as a regular task, and logs to the logfile. To stop the site, kill the script.

          A more stable way to run OpenACS is with a "keepalive" mechanism of some sort, so that whenever the server halts or is stopped for a reset, it restarts automatically. This is recommended for development and production servers.

          The Reference Platform uses Daemontools to control AOLserver. A simpler method, using init, is here.

          1. Daemontools must already be installed. If not, install it.

          2. Each service controlled by daemontools must have a directory in /service. That directory must have a file called run. Daemontools then creates additional files and directories to track status and log. A daemontools directory is included in the OpenACS tarball at - /var/lib/aolserver/service0/etc/daemontools. To use it, first ill any existing AOLserver instances. As root, link the daemontools directory into the /service directory. Daemontools' svscan process checks this directory every five seconds, and will quickly execute run.

            [service0@yourserver etc]$ killall nsd
            +        /var/lib/aolserver/service0/etc/daemontools.  To use it, first ill any existing AOLserver instances.  As root, link the daemontools directory into the /service directory.  Daemontools' svscan process checks this directory every five seconds, and will quickly execute run.

            [service0 etc]$ killall nsd
             nsd: no process killed
            -[service0@yourserver etc]$ exit
            +[service0 etc]$ exit
             
            -[root@yourserver root]# ln -s /var/lib/aolserver/service0/etc/daemontools/ /service/service0

            Verify that AOLserver is running.

            [root@yourserver root]# ps -auxw | grep nsd
            +[root root]# ln -s /var/lib/aolserver/service0/etc/daemontools/ /service/service0

            Verify that AOLserver is running.

            [root root]# ps -auxw | grep nsd
             service0   5562 14.2  6.2 22436 15952 ?       S    11:55   0:04 /usr/local/aolserver/bin/nsd -it /var/lib/aolserver/service0/etc/config.tcl -u serve
             root      5582  0.0  0.2  3276  628 pts/0    S    11:55   0:00 grep nsd
            -[root@yourserver root]#
          3. The user service0 can now control the service service0 with these commands:

            • +[root root]#

        • The user service0 can now control the service service0 with these commands:

          • svc -d /service/service0 - Bring the server down @@ -43,18 +43,18 @@ this option. This does not take the server out of keepalive mode, so it should still bounce back up immediately.

        • Install a script to automate the stopping and starting - of AOLserver services via daemontools. You can then restart a service via restart-aolserver service0

          [root@yourserver root]# cp /var/lib/aolserver/service0/packages/acs-core-docs/www/files/restart-aolserver-daemontools.txt /usr/local/bin/restart-aolserver
          -[root@yourserver root]# chmod 755 /usr/local/bin/restart-aolserver
          -[root@yourserver root]#
        • + of AOLserver services via daemontools. You can then restart a service via restart-aolserver service0

          [root root]# cp /var/lib/aolserver/service0/packages/acs-core-docs/www/files/restart-aolserver-daemontools.txt /usr/local/bin/restart-aolserver
          +[root root]# chmod 755 /usr/local/bin/restart-aolserver
          +[root root]#
        • At this point, these commands will work only for the - root user. Grant permission for the web group to use svc commands on the service0 server.

          [root@yourserver root]# svgroup web /service/service0
          -[root@yourserver root]#
        • Verify that the controls work. You may want to tail -f /var/lib/aolserver/service0/log/service0-error.log in another window, so you can see what happens when you type these commands. + root user. Grant permission for the web group to use svc commands on the service0 server.

          [root root]# svgroup web /service/service0
          +[root root]#
        • Verify that the controls work. You may want to tail -f /var/lib/aolserver/service0/log/service0-error.log in another window, so you can see what happens when you type these commands.

          Most of this information comes from Tom Jackson's AOLserver+Daemontools Mini-HOWTO.

        AOLserver keepalive with inittab

        This is an alternative method for keeping the AOLserver - process running. The recommended method is to run AOLserver + process running. The recommended method is to run AOLserver supervised.

        This step should be completed as root. This can break every service on your machine, so proceed with caution. @@ -89,25 +89,25 @@ have Perl installed and also a symbolic link to it in /usr/local/bin.

        -joeuser:~$ su - 
        +[joeuser ~]$ su - 
         Password: ***********
        -root:~# cp /tmp/restart-aolserver.txt /usr/local/bin/restart-aolserver
        -root:~# chown root.web /usr/local/bin/restart-aolserver
        -root:~# chmod 4750 /usr/local/bin/restart-aolserver
        -root:~# ln -s /usr/bin/perl /usr/local/bin/perl
        -root:~# exit
      • +[root ~]# cp /tmp/restart-aolserver.txt /usr/local/bin/restart-aolserver +[root ~]# chown root.web /usr/local/bin/restart-aolserver +[root ~]# chmod 4750 /usr/local/bin/restart-aolserver +[root ~]# ln -s /usr/bin/perl /usr/local/bin/perl +[root ~]# exit

      • Test the restart-aolserver script. We'll first kill all running servers to clean the slate. Then, we'll start one server and use restart-aolserver to kill it. If it works, then there should be no more servers running. You should see the following lines.

        -joeuser:~$ killall nsd
        +[joeuser ~]$ killall nsd
         nsd: no process killed
        -joeuser:~$ /usr/local/aolserver/bin/nsd-postgres -t ~/var/lib/aolserver/birdnotes/nsd.tcl
        -joeuser:~$ restart-aolserver birdnotes
        +[joeuser ~]$ /usr/local/aolserver/bin/nsd-postgres -t ~/var/lib/aolserver/birdnotes/nsd.tcl
        +[joeuser ~]$ restart-aolserver birdnotes
         Killing 23727 
        -joeuser:~$ killall nsd
        +[joeuser ~]$ killall nsd
         nsd: no process killed

        The number 23727 indicates the process id(s) (PIDs) of the processes being killed. It is important that no processes are killed by the second @@ -118,9 +118,9 @@ script worked, login as root and open /etc/inittab for editing.

        -joeuser:~$ su -
        +[joeuser ~]$ su -
         Password: ************
        -root:~# emacs -nw /etc/inittab
      • +[root ~]# emacs -nw /etc/inittab

      • Copy this line into the bottom of the file as a template, making sure that the first field nss1 is unique. @@ -133,19 +133,19 @@

      • Still as root, enter the following command to re-initialize /etc/inittab.

        -root:~# killall nsd    
        +[root ~]# killall nsd    
         nsd: no process killed
        -root:~# /sbin/init q
      • +[root ~]# /sbin/init q

      • See if it worked by running the restart-aolserver script again.

        -root:~# restart-aolserver birdnotes
        +[root ~]# restart-aolserver birdnotes
         Killing 23750

      If processes were killed, congratulations, your server is now automated for startup and shutdown.

      Running AOLserver on Port 80

      If you want your webserver to be http://yourserver.com, it must run on port 80, the default HTTP port. You set this in the config.tcl file. You will need to start the service as root. If you follow the instructions - above for automating + above for automating startup, this will be taken care of, but if you ever start the server from the command line, be sure to su - first. @@ -159,7 +159,7 @@ able to exploit your web server to execute a command on your server, they would not be able to gain root access.

      Running multiple services on one machine

      Services on different ports.�To run a different service on another port but the same - ip, simply repeat Install OpenACS 5.0.0b4 replacing + ip, simply repeat Install OpenACS replacing service0, and change the

      set httpport              8000
       set httpsport             8443 

      @@ -179,24 +179,24 @@ adds support for the ssl encryption layer. To use it, you must install the software, create or purchase certificates, and configure your OpenACS instance to use it.

      1. Uncomment this line from config.tcl.

        #ns_param   nsopenssl       ${bindir}/nsopenssl.so
        -
      2. Prepare a certificate directory for the service.

        [service0@yourserver etc]$ mkdir /var/lib/aolserver/service0/etc/certs
        -[service0@yourserver etc]$ chmod 700 /var/lib/aolserver/service0/etc/certs
        -[service0@yourserver etc]$ 
        +
      3. Prepare a certificate directory for the service.

        [service0 etc]$ mkdir /var/lib/aolserver/service0/etc/certs
        +[service0 etc]$ chmod 700 /var/lib/aolserver/service0/etc/certs
        +[service0 etc]$ 
         mkdir /var/lib/aolserver/service0/etc/certs
        -chmod 700 /var/lib/aolserver/service0/etc/certs
      4. It takes two files to support an SSL connection. The certificate is the public half of the key pair - the server sends the certificate to browser requesting ssl. The key is the private half of the key pair. In addition, the certificate must be signed by Certificate Authority or browsers will protest. Each web browser ships with a built-in list of acceptable Certificate Authorities (CAs) and their keys. Only a site certificate signed by a known and approved CA will work smoothly. Any other certificate will cause browsers to produce some messages or block the site. Unfortunately, getting a site certificate signed by a CA costs money. In this section, we'll generate an unsigned certificate which will work in most browsers, albeit with pop-up messages.

        Use an OpenSSL perl script to generate a certificate and key.

        [service0@yourserver service0]$ cd /var/lib/aolserver/service0/etc/certs
        -[service0@yourserver certs]$ perl /usr/share/ssl/misc/CA -newcert
        +chmod 700 /var/lib/aolserver/service0/etc/certs
      5. It takes two files to support an SSL connection. The certificate is the public half of the key pair - the server sends the certificate to browser requesting ssl. The key is the private half of the key pair. In addition, the certificate must be signed by Certificate Authority or browsers will protest. Each web browser ships with a built-in list of acceptable Certificate Authorities (CAs) and their keys. Only a site certificate signed by a known and approved CA will work smoothly. Any other certificate will cause browsers to produce some messages or block the site. Unfortunately, getting a site certificate signed by a CA costs money. In this section, we'll generate an unsigned certificate which will work in most browsers, albeit with pop-up messages.

        Use an OpenSSL perl script to generate a certificate and key.

        [service0 service0]$ cd /var/lib/aolserver/service0/etc/certs
        +[service0 certs]$ perl /usr/share/ssl/misc/CA -newcert
         Using configuration from /usr/share/ssl/openssl.cnf
         Generating a 1024 bit RSA private key
         ...++++++
         .......++++++
         writing new private key to 'newreq.pem'
         Enter PEM pass phrase:

        Enter a pass phrase for the CA certificate. Then, answer the rest of the questions. At the end you should see this:

        Certificate (and private key) is in newreq.pem
        -[service0@yourserver certs]$

        newreq.pem contains our certificate and private key. The key is protected by a passphrase, which means that we'll have to enter the pass phrase each time the server starts. This is impractical and unnecessary, so we create an unprotected version of the key. Security implication: if anyone gets access to the file keyfile.pem, they effectively own the key as much as you do. Mitigation: don't use this key/cert combo for anything besides providing ssl for the web site.

        [root@yourserver misc]# openssl rsa -in newreq.pem -out keyfile.pem
        +[service0 certs]$

        newreq.pem contains our certificate and private key. The key is protected by a passphrase, which means that we'll have to enter the pass phrase each time the server starts. This is impractical and unnecessary, so we create an unprotected version of the key. Security implication: if anyone gets access to the file keyfile.pem, they effectively own the key as much as you do. Mitigation: don't use this key/cert combo for anything besides providing ssl for the web site.

        [root misc]# openssl rsa -in newreq.pem -out keyfile.pem
         read RSA key
         Enter PEM pass phrase:
         writing RSA key
        -[service0@yourserver certs]$ 

        To create the certificate file, we take the combined file, copy it, and strip out the key.

        [service0@yourserver certs]$ cp newreq.pem certfile.pem
        -[root@yourserver misc]# emacs certfile.pem

        Strip out the section that looks like

        -----BEGIN RSA PRIVATE KEY-----
        +[service0 certs]$ 

        To create the certificate file, we take the combined file, copy it, and strip out the key.

        [service0 certs]$ cp newreq.pem certfile.pem
        +[root misc]# emacs certfile.pem

        Strip out the section that looks like

        -----BEGIN RSA PRIVATE KEY-----
         Proc-Type: 4,ENCRYPTED
         DEK-Info: DES-EDE3-CBC,F3EDE7CA1B404997
         S/Sd2MYA0JVmQuIt5bYowXR1KYKDka1d3DUgtoVTiFepIRUrMkZlCli08mWVjE6T
        @@ -206,12 +206,12 @@
               performs DNS lookup, and outputs HTML reports.  Analog should
               already be
               installed.  A modified configuration file is included in
        -      the OpenACS tarball.

        1. [root@yourserver src]# su - service0
          -[service0@yourserver service0]$ cd /var/lib/aolserver/service0
          -[service0@yourserver service0]$ cp /var/lib/aolserver/service0/packages/acs-core-docs/www/files/analog.cfg.txt etc/analog.cfg
          -[service0@yourserver service0]$ mkdir www/log
          -[service0@yourserver service0]$ cp -r /usr/share/analog-5.31/images www/log/
          -[service0@yourserver service0]$ 
          +      the OpenACS tarball.

          1. [root src]# su - service0
            +[service0 service0]$ cd /var/lib/aolserver/service0
            +[service0 service0]$ cp /var/lib/aolserver/service0/packages/acs-core-docs/www/files/analog.cfg.txt etc/analog.cfg
            +[service0 service0]$ mkdir www/log
            +[service0 service0]$ cp -r /usr/share/analog-5.31/images www/log/
            +[service0 service0]$ 
             su - service0
             cd /var/lib/aolserver/service0
             cp /var/lib/aolserver/service0/packages/acs-core-docs/www/files/analog.cfg.txt etc/analog.cfg
            @@ -221,16 +221,16 @@
             organisation]" to reflect your website title.  If you
             don't want the traffic log to be publicly visible, change
             OUTFILE /var/lib/aolserver/service0/www/log/traffic.html to use a private
            -directory.

          2. Run it.

            [service0@yourserver service0]$ /usr/share/analog-5.31/analog -G -g/var/lib/aolserver/service0/etc/analog.cfg
            +directory.

          3. Run it.

            [service0 service0]$ /usr/share/analog-5.31/analog -G -g/var/lib/aolserver/service0/etc/analog.cfg
             /usr/share/analog-5.31/analog: analog version 5.31/Unix
             /usr/share/analog-5.31/analog: Warning F: Failed to open DNS input file
               /home/service0/dnscache: ignoring it
               (For help on all errors and warnings, see docs/errors.html)
             /usr/share/analog-5.31/analog: Warning R: Turning off empty Search Word Report
            -[service0@yourserver service0]$

            Verify that it works by browing to http://yourserver.test:8000/log/traffic.html

          4. Automate this by creating a file in - /etc/cron.daily.

            [service0@yourserver service0]$ exit
            +[service0 service0]$

            Verify that it works by browing to http://yourserver.test:8000/log/traffic.html

          5. Automate this by creating a file in + /etc/cron.daily.

            [service0 service0]$ exit
             logout
             
            -[root@yourserver root]# emacs /etc/cron.daily/analog

            Put this into the file:

            #!/bin/sh
            +[root root]# emacs /etc/cron.daily/analog

            Put this into the file:

            #!/bin/sh
             
            -/usr/share/analog-5.31/analog -G -g/var/lib/aolserver/service0/etc/analog.cfg
            [root@yourserver root]# chmod 755 /etc/cron.daily/analog

            Test it by running the script.

            [root@yourserver root]# sh /etc/cron.daily/analog

            Browse to http://yourserver.test/log/traffic.html

        External uptime validation

        The OpenACS uptime site can monitor your site and send you an email whenever your site fails to respond. If you test the url http://yourserver.test/SYSTEM/dbtest.tcl, you should get back the string success.

        ($Id$)
      View comments on this page at openacs.org
      +/usr/share/analog-5.31/analog -G -g/var/lib/aolserver/service0/etc/analog.cfg
      [root root]# chmod 755 /etc/cron.daily/analog

      Test it by running the script.

      [root root]# sh /etc/cron.daily/analog

      Browse to http://yourserver.test/log/traffic.html

    External uptime validation

    The OpenACS uptime site can monitor your site and send you an email whenever your site fails to respond. If you test the url http://yourserver.test/SYSTEM/dbtest.tcl, you should get back the string success.

    ($Id$)
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/maintenance.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/Attic/maintenance.html,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/acs-core-docs/www/maintenance.html 23 Jan 2004 15:09:52 -0000 1.11 +++ openacs-4/packages/acs-core-docs/www/maintenance.html 4 Feb 2004 16:47:33 -0000 1.12 @@ -1 +1 @@ -Chapter�6.�Maintenance
    View comments on this page at openacs.org
    +Chapter�6.�Maintenance
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/nxml-mode.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/nxml-mode.html,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-core-docs/www/nxml-mode.html 11 Dec 2003 21:39:47 -0000 1.2 +++ openacs-4/packages/acs-core-docs/www/nxml-mode.html 4 Feb 2004 16:47:33 -0000 1.3 @@ -1,4 +1,4 @@ -Using nXML mode in Emacs

    Using nXML mode in Emacs

    By Jeff Davis

    +Using nXML mode in Emacs

    Using nXML mode in Emacs

    By Jeff Davis

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    Index: openacs-4/packages/acs-core-docs/www/object-identity.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/object-identity.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/object-identity.html 11 Dec 2003 23:08:46 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/object-identity.html 4 Feb 2004 16:47:33 -0000 1.25 @@ -1,18 +1,18 @@ -Object Identity

    Object Identity

    By Rafael H. Schloming

    +Object Identity

    Object Identity

    By Rafael H. Schloming

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

    One of the major design features of OpenACS 5.0.0b4 is the explicit representation +

    One of the major design features of OpenACS is the explicit representation of object identity. The reason I say "explicit representation" is because the concept of object identity has been around forever. It is inherent to our problem domain. Consider the example of 3.x style scoping. The 3.x data models use the triple (user_id, group_id, -scope) to identify an object. In the 5.0.0b4 data model this +scope) to identify an object. In the data model this object is explicitly represented by a single party_id.

    Another good example of this is can be found in the user groups data model. The 3.x user groups data model contains another example of an implied identity. Every mapping between a user and a group could have an arbitrary number of attached values (user_group_member_fields, etc.). In this case it is the pair (group_id, user_id) that implicitly refers to an -object (the person's membership in a group). In the 5.0.0b4 data model this +object (the person's membership in a group). In the data model this object identity is made explicit by adding an integer primary key to the table that maps users to groups.

    Coming from a purely relational world, this might seem slightly weird at first. The pair (group_id, user_id) is sufficient to uniquely identify the Index: openacs-4/packages/acs-core-docs/www/object-system-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/object-system-design.html,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/acs-core-docs/www/object-system-design.html 11 Dec 2003 23:08:46 -0000 1.18 +++ openacs-4/packages/acs-core-docs/www/object-system-design.html 4 Feb 2004 16:47:33 -0000 1.19 @@ -1,4 +1,4 @@ -Object Model Design

    Object Model Design

    By Pete Su, Michael Yoon, Richard Li, Rafael Schloming

    +Object Model Design

    Object Model Design

    By Pete Su, Michael Yoon, Richard Li, Rafael Schloming

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    Essentials

    Data Model

    • Index: openacs-4/packages/acs-core-docs/www/object-system-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/object-system-requirements.html,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/acs-core-docs/www/object-system-requirements.html 11 Dec 2003 23:08:46 -0000 1.17 +++ openacs-4/packages/acs-core-docs/www/object-system-requirements.html 4 Feb 2004 16:47:33 -0000 1.18 @@ -1,4 +1,4 @@ -Object Model Requirements

      Object Model Requirements

      By Pete Su

      +Object Model Requirements

      Object Model Requirements

      By Pete Su

      OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

      I. Introduction

      A major goal in OpenACS 4 is to unify and normalize many of the core services Index: openacs-4/packages/acs-core-docs/www/objects.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/objects.html,v diff -u -N -r1.25 -r1.26 --- openacs-4/packages/acs-core-docs/www/objects.html 11 Dec 2003 23:08:46 -0000 1.25 +++ openacs-4/packages/acs-core-docs/www/objects.html 4 Feb 2004 16:47:33 -0000 1.26 @@ -1,8 +1,8 @@ -OpenACS Data Models and the Object System

      OpenACS Data Models and the Object System

      By Pete Su

      +OpenACS Data Models and the Object System

      OpenACS Data Models and the Object System

      By Pete Su

      OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

      Overview

      -Developing data models in OpenACS 5.0.0b4 is much like developing data models +Developing data models in OpenACS is much like developing data models for OpenACS 3, save for the implementation. As usual, you need to examine how to model the information that the application must store and manipulate, and define a suitable set of SQL tables. In our Notes @@ -78,7 +78,7 @@ Fire up your text editor and open the ROOT/packages/notes/sql/oracle/notes-create.sql (ROOT/packages/notes/sql/postgresql/notes-create.sql for the PG version) file created when we created the package. Then, do the following: -

      Describe the new type to the type system

      +

      Describe the new type to the type system

      First, add an entry to the acs_object_types table with the following PL/SQL call:

       begin  
      @@ -138,7 +138,7 @@
       because the new type note is a subtype of
       acs_object, it will inherit these attributes, so there is
       no need for us to define them.
      -

      Define a table in which to store your objects

      +

      Define a table in which to store your objects

      The next thing we do is make a small modification to the data model to reflect the fact that each row in the notes table represents something that is not only an object of type @@ -163,7 +163,7 @@ use the acs_objects table to find objects will transparently find any objects that are instances of any subtype of acs_objects. -

      Define a package for type specific procedures

      +

      Define a package for type specific procedures

      The next step is to define a PL/SQL package for your new type, and write some basic procedures to create and delete objects. Here is a package definition for our new type: @@ -211,7 +211,7 @@ object OBJ was "read only", then any other object that used OBJ as its context would also be "read only" by default. We'll talk about this more later. -

      Define a package body for type specific procedures

      +

      Define a package body for type specific procedures

      The PL/SQL package body contains the implementations of the procedures defined above. The only subtle thing going on here is that we must use acs_object.new to insert a row into @@ -314,7 +314,7 @@ models that are meant to be integrated with the OpenACS object system.

      -There are two basic rules you should follow when designing OpenACS 5.0.0b4 data +There are two basic rules you should follow when designing OpenACS data models: @@ -369,7 +369,7 @@ requires a good amount of thought at design time even for simple applications.

      Summary

      -Hooking into the OpenACS 5.0.0b4 object system brings the application developer +Hooking into the OpenACS object system brings the application developer numerous benefits, and doing it involves only four easy steps: Index: openacs-4/packages/acs-core-docs/www/openacs-overview.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/openacs-overview.html,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/acs-core-docs/www/openacs-overview.html 11 Dec 2003 23:08:46 -0000 1.15 +++ openacs-4/packages/acs-core-docs/www/openacs-overview.html 4 Feb 2004 16:47:33 -0000 1.16 @@ -1,4 +1,4 @@ -Overview

      Overview

      +Overview

      Overview

      OpenACS (Open Architecture Community System) is an advanced toolkit for building scalable, community-oriented web applications. If you're thinking of building an Index: openacs-4/packages/acs-core-docs/www/openacs-unpack.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/openacs-unpack.html,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/acs-core-docs/www/openacs-unpack.html 11 Dec 2003 23:08:46 -0000 1.11 +++ openacs-4/packages/acs-core-docs/www/openacs-unpack.html 4 Feb 2004 16:47:33 -0000 1.12 @@ -1,17 +1,17 @@ -Unpack the OpenACS tarball

      Unpack the OpenACS tarball

      The OpenACS tarball contains sample configuration files +Unpack the OpenACS tarball

      Unpack the OpenACS tarball

      The OpenACS tarball contains sample configuration files for some of the packages listed below. In order to access those - files, unpack the tarball now.

      [root@yourserver root]# cd /tmp
      -[root@yourserver tmp]# tar xzf openacs-5.0.0b4.tgz
      +      files, unpack the tarball now.

      [root root]# cd /tmp
      +[root tmp]# tar xzf .tgz
       cd /tmp
      -tar xzf openacs-5.0.0b4.tgz

      If you are installing from a different method and just need the configuration files, you can instead get them from CVS:

      [root@yourserver root]# cd /tmp
      -[root@yourserver tmp]# cvs -d :pserver:anonymous@openacs.org:/cvsroot co openacs-4/packages/acs-core-docs/www/files/
      +tar xzf .tgz

      If you are installing from a different method and just need the configuration files, you can instead get them from CVS:

      [root root]# cd /tmp
      +[root tmp]# cvs -d :pserver:anonymous@openacs.org:/cvsroot co openacs-4/packages/acs-core-docs/www/files/
       cvs checkout: warning: failed to open /root/.cvspass for reading: No such file or directory
       cvs server: Updating openacs-4/packages/acs-core-docs/www/files
       U openacs-4/packages/acs-core-docs/www/files/README.TXT
       (many lines omitted)
       U openacs-4/packages/acs-core-docs/www/files/template-ini.ini
       U openacs-4/packages/acs-core-docs/www/files/winnsd.txt
      -[root@yourserver tmp]# mv openacs-4 openacs-5.0.0b4
      +[root tmp]# mv openacs-4 
       cd /tmp
       cvs -d :pserver:anonymous@openacs.org:/cvsroot co openacs-4/packages/acs-core-docs/www/files/
       mv openacs-4 openacs-5.0.0a4
      View comments on this page at openacs.org
      Index: openacs-4/packages/acs-core-docs/www/openacs.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/openacs.css,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/acs-core-docs/www/openacs.css 26 Jan 2004 15:39:43 -0000 1.5 +++ openacs-4/packages/acs-core-docs/www/openacs.css 4 Feb 2004 16:47:33 -0000 1.6 @@ -1,28 +1,64 @@ /* These are aimed at DocBook output, specifically from the chunk.xsl style and derivatives /* -body, ol, td, th, hr, h1, h2, h3, strong, dl, a, blockquote, em, .force, dt, dd, ul, li, p{font-family:verdana,helvetica,arial,sans-serif} -a:link{color:0000ff} -a:visited{color:000099} -a.topnav{font-size:1.2em} -a.bottomnav{font-size:1.2em} +body,ol,td,th,hr,h1,h2,h3,strong,dl,a,blockquote,em,.force,dt,dd,ul,li,p { + font-family: verdana,helvetica,arial,sans-serif; +} -code{font-family:mono-space} -.CVS, .cvstag{font-family:mono-space; font-size:small; color:#999999; text-align:right} +a:link {color: #f00;} +a:visited {color: #000099;} -.codeblock{background-color:#ffffff;font-family:monospace} -.strong{font-weight:bold} -.authorblurb{font-size:small} +a.topnav {font-size: 1.2em;} +a.bottomnav {font-size: 1.2em;} +code { + font-family: courier,monospace; +} + +.codeblock { + background-color: #fff; + font-family: monospace; +} +.strong {font-weight: bold;} +.authorblurb {font-size: small;} + /* this is intended to catch docbook Screen stuff */ -pre {background-color:#eeeeee;} +pre {background-color: #eee;} /* DocBook stuff */ -.guibutton{background-color:white;border: solid#eeeeee; padding:1px;} -.replaceable{color:red; font-style:italic;} -.guilabel{background-color:silver; padding:2px;} -.programlisting{background-color:#eeeeee} -.strong{font-weight:bold} -.authorblurb{font-size:small} -.screen{padding:3px;} -.action{padding:0.5em; margin:0.5em;font-weight:bold;} +.guibutton { + background-color: #fff; + border: solid #eee 3px; + margin: 2px; +} +.replaceable { + color: red; + font-style: italic; +} +.guilabel { + background-color: #ccc; + margin: 2px; +} +.programlisting { + background-color: #eee; + margin-left: 1em; + padding-left: .5em; +} +.strong {font-weight:bold;} +.authorblurb {font-size:small;} +.screen { + padding:4px; + margin-left: 1em; +} +.action {font-weight:bold;} +.table,.informaltable,.informalfigure,.figure { margin-left: 1em; } + +body { margin: 1em 0 0 1em; max-width: 75em; } + +div.cvstag { + font-family: courier,monospace; + color: #999; + font-size: small; + text-align: right; +} + Index: openacs-4/packages/acs-core-docs/www/openacs.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/openacs.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/openacs.html 11 Dec 2003 23:08:46 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/openacs.html 4 Feb 2004 16:47:33 -0000 1.25 @@ -1,15 +1,15 @@ -Install OpenACS 5.0.0b4

      Install OpenACS 5.0.0b4

      by Vinod Kurup

      +Install OpenACS

      Install OpenACS

      by Vinod Kurup

      OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

      Set up the file system for one or more OpenACS Sites

      For Linux Standard Base compliance and ease of backup, all of the files in each OpenACS site are stored in a subdirectory of /var/lib/aolserver, one subdirectory per site. The first time you install an OpenACS - site on a server, you must create the parent directory and set its permissions:

      [root@yourserver root]# mkdir /var/lib/aolserver
      -[root@yourserver root]# chgrp web /var/lib/aolserver
      -[root@yourserver root]# chmod 770 /var/lib/aolserver
      -[root@yourserver root]#
      +      site on a server, you must create the parent directory and set its permissions:

      [root root]# mkdir /var/lib/aolserver
      +[root root]# chgrp web /var/lib/aolserver
      +[root root]# chmod 770 /var/lib/aolserver
      +[root root]#
       mkdir /var/lib/aolserver
       chgrp web /var/lib/aolserver
       chmod 770 /var/lib/aolserver

      Set up a user account for each site.

      @@ -33,60 +33,57 @@ developers for that specific instance. Add this user, and put it in the service0 group so that it can use database and server commands associated with that group. -

      [root@yourserver root]# groupadd web
      -[root@yourserver root]# useradd -g service0 -G web service0 -d /home/service0
      -[root@yourserver root]#

      Install with automated script (EXPERIMENTAL)

      Starting with OpenACS 5.0, an experimental script is - available to automate all of the steps for the rest of this - section. Requires tclwebtest. If you are not feeling lucky, skip to the section called “Install from tarball”.

      Get the install script from CVS. It is located within +

      +[root root]# useradd service0
      +[root root]#

      Install with automated script

      A bash script is available to automate all of the steps for the rest of this section. It requires tclwebtest. The automated script can greatly accelerate the install process, but is very sensitive to the install environment. We recommend that you run the automated install and, if it does not work the first time, consider switching to a manual installation.

      Get the install script from CVS. It is located within the main cvs tree, at /etc/install. Use anonymous CVS checkout to get that directory in the home directory of the service's dedicated user. We put it there so that it is not overwritten when we do the main CVS checkout to the target - location.

      [root@yourserver root]# su - service0
      -[service0@yourserver service0]$ cvs -d :pserver:anonymous@openacs.org:/cvsroot co -d install openacs-4/etc/install
      +        location.

      [root root]# su - service0
      +[service0 service0]$ cvs -d :pserver:anonymous@openacs.org:/cvsroot co -d install openacs-4/etc/install
       cvs server: Updating install
       U install/README
       U install/TODO
         ... many lines omitted ...
       U install/tcl/twt-procs.tcl
       U install/tcl/user-procs.tcl
      -[service0@yourserver service0]$ cd install
      -[service0@yourserver install]$ 
      -

      Edit - /home/service0/install/install.tcl - and change the values as documented in the file. It will work - unchanged at 127.0.0.1:8000.

      Run the file as root.

      [service0@yourserver service0]$ exit 
      -[root@yourserver root]# sh /home/service0/install/install.sh
      +[service0 service0]$ cd install
      +[service0 install]$ emacs install.tcl
      +

      Edit the installation configuration file, /home/service0/install/install.tcl and update the site-specific values, such as the new service's IP address and name, which will be written into the new service's config.tcl file. If your system is different from the one described in the previous sections, check the file paths as well. Set do_checkout=yes to create a new OpenACS site directly from a CVS checkout, or =no if you have a fully configured site and just want to rebuild it (drop and recreate the database and repeat the installation). If you have followed a stock installation, the default configuration will work without changes and will install an OpenACS site at 127.0.0.1:8000.

      Run the install script install.sh as root:

      [service0 service0]$ exit 
      +[root root]# sh /home/service0/install/install.sh
       /home/service0/install/install.sh: Starting installation with config_file 
       /home/service0/install/install.tcl. Using serverroot=/var/lib/aolserver/
       service0, server_url=http://0.0.0.0:8000, do_checkout=yes, do_install=yes, 
       dotlrn=no, and database=postgres., use_daemontools=true
      -  ... many lines omitted ...
      -./install.sh: Finished (re)installing /var/lib/aolserver/service0 at Wed Nov  
      -5 13:27:17 CET 2003.  Access the new site at http://127.0.0.1:8000 with admin 
      -username admin@yourserver.test and password 1
      -[root@yourserver root]#

      You can proceed to the section called “Next Steps”.

      Install from tarball

      You should already have downloaded the OpenACS tarball + ... many lines omitted ... +Tue Jan 27 11:50:59 CET 2004: Finished (re)installing /var/lib/aolserver/service0. +###################################################################### + New site URL: http://127.0.0.1:8000 +admin email : admin@yourserver.net +admin password: xxxx +###################################################################### +[root root]#

      You can proceed to the section called “Next Steps”.

      Install from tarball

      You should already have downloaded the OpenACS tarball to the /tmp directory. If not, download the OpenACS tarball and save it in - /tmp and proceed:

      1. Unpack the OpenACS tarball and rename it to service0. Secure the directory so that only the owner can access it. Check the permissions by listing the directory.

        [root@yourserver root]# su - service0
        -[service0@yourserver service0]$ cd /var/lib/aolserver
        -[service0@yourserver aolserver]$ tar xzf /tmp/openacs-5.0.0b4.tgz
        -[service0@yourserver aolserver]$ mv openacs-5.0.0b4 service0
        -[service0@yourserver aolserver]$ chmod -R 700 service0
        -[service0@yourserver aolserver]$ ls -al
        +      /tmp and proceed:

        1. Unpack the OpenACS tarball and rename it to service0. Secure the directory so that only the owner can access it. Check the permissions by listing the directory.

          [root root]# su - service0
          +[service0 service0]$ cd /var/lib/aolserver
          +[service0 aolserver]$ tar xzf /tmp/.tgz
          +[service0 aolserver]$ mv  service0
          +[service0 aolserver]$ chmod -R 700 service0
          +[service0 aolserver]$ ls -al
           total 3
           drwxrwx---    3 root     web          1024 Mar 29 16:41 .
           drwxr-xr-x   25 root     root         1024 Mar 29 16:24 ..
           drwx------    7 service0 web          1024 Jan  6 14:36 service0
          -[service0@yourserver aolserver]$ exit
          +[service0 aolserver]$ exit
           logout
          -
          -[root@yourserver root]#
          +[root root]#
           su - service0
           cd /var/lib/aolserver
          -tar xzf /tmp/openacs-5.0.0b4.tgz
          -mv openacs-5.0.0b4 service0
          +tar xzf /tmp/.tgz
          +mv  service0
           chmod -R 700 service0/
           exit
        2. Add the Service to CVS (OPTIONAL)

        3. Prepare the database

          • Prepare Oracle for OpenACS.�If you won't be using Oracle, skip to Prepare PostgreSQL for an OpenACS Service

            You should be sure that your user account @@ -96,23 +93,20 @@ Verify membership by typing groups when you login: -

            -service0:~$ groups
            +		  

            [service0 ~]$ groups
             dba web

            If you do not see these groups, take the following action: -

            -service0:~$ su -      
            +		  

            [service0 ~]$ su -
             Password: ************
            -root:~# adduser service0 dba

            +[root ~]# adduser service0 dba

            If you get an error about an undefined group, then add that group manually: -

            -root:~# groupadd dba
            -root:~# groupadd web

            +

            [root ~]# groupadd dba
            +[root ~]# groupadd web

            Make sure to logout as root when you are finished with this step and log back in as @@ -121,20 +115,15 @@ Connect to Oracle using svrmgrl and login: -

            -service0:~$ svrmgrl
            -
            -SVRMGR> connect internal
            +		  

            [service0 ~]$ svrmgrl
            +SVRMGR> connect internal
             Connected.

          • Determine where the system tablespaces are stored: -

            -SVRMGR>  select file_name from dba_data_files;

            +

            SVRMGR> select file_name from dba_data_files;

            Example results: - -

            -/ora8/m01/app/oracle/oradata/ora8/system01.dbf
            +		  

            /ora8/m01/app/oracle/oradata/ora8/system01.dbf
             /ora8/m01/app/oracle/oradata/ora8/tools01.dbf
             /ora8/m01/app/oracle/oradata/ora8/rbs01.dbf
             /ora8/m01/app/oracle/oradata/ora8/temp01.dbf
            @@ -159,14 +148,14 @@
             		  Create the directory for the datafile; to do this,
             		  exit from svrmgrl and login as
             		  root for this step: 

            -SVRMGR> exit
            -service0:~$ su -
            +SVRMGR> exit
            +[service0 ~]$ su -
             Password: ************
            -root:~# mkdir -p /ora8/m02/oradata/ora8/
            -root:~# chown service0.web /ora8/m02/oradata/ora8
            -root:~# chmod 775 /ora8/m02/oradata/ora8
            -root:~# exit
            -service0:~$
          • +[root ~]# mkdir -p /ora8/m02/oradata/ora8/ +[root ~]# chown service0:web /ora8/m02/oradata/ora8 +[root ~]# chmod 775 /ora8/m02/oradata/ora8 +[root ~]# exit +[service0 ~]$

      2. Create a tablespace for the service. It is important that the tablespace can autoextend. This @@ -177,77 +166,69 @@ Oracle's ability to automatically coalesce free space in the tablespace. -

        -service0:~$ svrmgrl
        -
        -SVRMGR> connect internal;
        -SVRMGR> create tablespace service0 
        -             datafile '/ora8/m02/oradata/ora8/service001.dbf' 
        -             size 50M 
        -             autoextend on 
        -             next 10M
        -             maxsize 300M
        -             extent management local
        -             uniform size 32K;
      3. +

        [service0 ~]$ svrmgrl
        +SVRMGR> connect internal;
        +SVRMGR> create tablespace service0
        +      datafile '/ora8/m02/oradata/ora8/service001.dbf' 
        +      size 50M 
        +      autoextend on 
        +      next 10M
        +      maxsize 300M
        +      extent management local
        +      uniform size 32K;
      4. Create a database user for this service. Give the user access to the tablespace and rights to connect. We'll use - service0password as our password.

        - Write down what you specify as service_name - (i.e. service0) and - database_password - (i.e. service0password). You - will need this information for configuring exports and - AOLserver. + service0password as our password.

        + Write down what you specify as + service_name + (i.e. service0) + and database_password + (i.e. service0password). You + will need this information for configuring exports + and AOLserver.

        -SVRMGR> create user service0 identified by service0password default tablespace service0
        -temporary tablespace temp quota unlimited on service0;
        -SVRMGR> grant connect, resource, ctxapp, javasyspriv, query rewrite to service0;
        -SVRMGR> revoke unlimited tablespace from service0;
        -SVRMGR> alter user service0 quota unlimited on service0;
        -SVRMGR> exit;

        +SVRMGR> create user service0 identified by service0password default tablespace service0 + temporary tablespace temp quota unlimited on service0; +SVRMGR> grant connect, resource, ctxapp, javasyspriv, query rewrite to service0; +SVRMGR> revoke unlimited tablespace from service0; +SVRMGR> alter user service0 quota unlimited on service0; +SVRMGR> exit;

        Your table space is now ready. In case you are trying to delete a previous OpenACS installation, consult these commands in the section called “Deleting a tablespace” below.

      5. Make sure that you can login to Oracle using your - service_name account:

        -service0:~$ sqlplus service0/service0password
        -SQL> select sysdate from dual;
        -
        +        service_name account: 

        [service0 ~]$ sqlplus service0/service0password
        +SQL> select sysdate from dual;
         SYSDATE
         ----------
         2001-12-20
        -
        -SQL> exit

        +SQL> exit;

        You should see today's date in a format 'YYYY-MM-DD.' If you can't login, try redoing step 1 again. If the date is in the wrong format, make sure you followed the steps outlined in the section called “Troubleshooting Oracle Dates”

    • Prepare PostgreSQL for an OpenACS Service.�

      • PostgreSQL:

        Create a user in the database matching the service - name. With default PostgreSQL authentication, a system user connecting locally automatically authenticates as the postgres user of the same name, if one exists. We currently use postgres "super-users" for everything, which means that anyone with access to any of the openacs system accounts on a machine has full access to all postgresql databases on that machine.

        [root@yourserver root]# su - postgres
        -[postgres@yourserver pgsql]$ createuser -a -d service0
        +            name.  With default PostgreSQL authentication, a system user connecting locally automatically authenticates as the postgres user of the same name, if one exists.  We currently use postgres "super-users" for everything, which means that anyone with access to any of the openacs system accounts on a machine has full access to all postgresql databases on that machine.

        [root root]# su - postgres
        +[postgres pgsql]$ createuser -a -d service0
         CREATE USER
        -[postgres@yourserver pgsql]$ exit
        +[postgres pgsql]$ exit
         logout
        -
        -[root@yourserver root]#
      • Create a database with the same name as our service name, service0.

        [root@yourserver root]# su - service0
        -[service0@yourserver service0]$ createdb -E UNICODE service0
        +[root root]#
      • Create a database with the same name as our service name, service0.

        [root root]# su - service0
        +[service0 service0]$ createdb -E UNICODE service0
         CREATE DATABASE
        -[service0@yourserver service0]$
        +[service0 service0]$
         su - service0
        -createdb -E UNICODE service0
      • Automate daily database Vacuuming. This is a process which cleans out discarded data from the database. A quick way to automate vacuuming is to edit the cron file for the database user. Recommended: VACUUM ANALYZE every hour and VACUUM FULL ANALYZE every day.

        [service0@yourserver service0]$ export EDITOR=emacs;crontab -e

        Add this line to the file. The numbers and stars at the beginning are cron columns that specify when the program should be run - in this case, whenever the minute is 0 and the hour is 1, i.e., 1:00 am every day.

        0 1-23 * * * /usr/local/pgsql/bin/vacuumdb --full --analyze service0
        -0 0 * * * /usr/local/pgsql/bin/vacuumdb --full --analyze service0
      • Add Full Text Search Support (OPTIONAL)

      • [service0@yourserver service0]$ exit
        -logout
        -
        -[root@yourserver root]# 
  • Configure an AOLserver Service for OpenACS.�

    1. +createdb -E UNICODE service0

    2. Automate daily database Vacuuming. This is a process which cleans out discarded data from the database. A quick way to automate vacuuming is to edit the cron file for the database user. Recommended: VACUUM ANALYZE every hour and VACUUM FULL ANALYZE every day.

      [service0 service0]$ export EDITOR=emacs;crontab -e

      Add this line to the file. The numbers and stars at the beginning are cron columns that specify when the program should be run - in this case, whenever the minute is 0 and the hour is 1, i.e., 1:00 am every day.

      0 1-23 * * * /usr/local/pgsql/bin/vacuumdb --full --analyze service0
      +0 0 * * * /usr/local/pgsql/bin/vacuumdb --full --analyze service0
    3. Add Full Text Search Support (OPTIONAL)

    4. At this point the database should be ready for installing OpenACS.

  • Configure an AOLserver Service for OpenACS.�

    1. The AOLserver architecture lets you run an arbitrary number of virtual servers. A virtual server is an HTTP service running on a specific port, e.g. port 80. In order for OpenACS to work, you need to configure a virtual server. The Reference Platform uses a configuration file included in the OpenACS tarball, /var/lib/aolserver/service0/etc/config.tcl. - Open it in an editor to adjust the parameters.

      [root@yourserver root]# su - service0
      -[service0@yourserver service0]$ cd /var/lib/aolserver/service0/etc
      -[service0@yourserver etc]# emacs config.tcl
      +	   Open it in an editor to adjust the parameters.

      [root root]# su - service0
      +[service0 service0]$ cd /var/lib/aolserver/service0/etc
      +[service0 etc]$ emacs config.tcl
       

      You can continue without changing any values in the file. However, if you don't change address to match the computer's ip address, you won't be able to browse to your server from other machines.

      • httpport - If you want your @@ -286,10 +267,10 @@ the command line via -u 501 -g 502. Second, if you are root then killall will affect all OpenACS services on the machine, so if there's more than one you'll have to do ps -auxw | grep - nsd and selectively kill by job number.

        [service0@yourserver etc]$ killall nsd
        +	  nsd and selectively kill by job number.

        [service0 etc]$ killall nsd
         nsd: no process killed
        -[service0@yourserver service0]$ /usr/local/aolserver/bin/nsd-postgres -t /var/lib/aolserver/service0/etc/config.tcl
        -[service0@yourserver service0]$ [08/Mar/2003:18:13:29][32131.8192][-main-] Notice: nsd.tcl: starting to read config file...
        +[service0 service0]$ /usr/local/aolserver/bin/nsd-postgres -t /var/lib/aolserver/service0/etc/config.tcl
        +[service0 service0]$ [08/Mar/2003:18:13:29][32131.8192][-main-] Notice: nsd.tcl: starting to read config file...
         [08/Mar/2003:18:13:29][32131.8192][-main-] Notice: nsd.tcl: finished reading config file.
      • Attempt to connect to the service from a web browser. You should specify a URL like: http://yourserver.test:8000

        You should see a page that looks like this. If you imported your files into @@ -306,11 +287,11 @@ permissions errors or missing files. If you need to make changes, don't forget to kill any running servers with killall nsd. -

      • Automate +

      • Automate AOLserver keepalive (OPTIONAL)

  • Configure a Service with the OpenACS Installer.� Now that you've got AOLserver up and running, let's install OpenACS - 5.0.0b4. + .

    • You should see a page from the webserver titled OpenACS Installation: @@ -360,26 +341,26 @@ You'll see the final Installer page, "OpenACS Installation: Complete." It will tell you that the server is being restarted; note that unless you already set up a way for - AOLserver to restart itself (ie. inittab or daemontools), + AOLserver to restart itself (ie. inittab or daemontools), you'll need to manually restart your service. -

      [service0@yourserver service0]$ /usr/local/aolserver/bin/nsd-postgres -t /var/lib/aolserver/service0/config.tcl
    • +

      [service0 service0]$ /usr/local/aolserver/bin/nsd-postgres -t /var/lib/aolserver/service0/config.tcl
    • Give the server a few minutes to start up. Then reload the final page above. You should see the front page, with an area to login near the upper right. Congratulations, OpenACS - 5.0.0b4 is now up and running! -

  • Next Steps

    • Install Full Text Search (OPTIONAL). If you have installed OpenFTS and enabled + is now up and running! +

    Next Steps

    • Use daemontools supervice and svc, or inittab, to automate server startup and shutdown.

    • Install Full Text Search (OPTIONAL). If you have installed OpenFTS and enabled OpenFTS, you can now install the OpenFTS Driver package and Full Text Search Engine package in the OpenACS service.

    • This is a good time to make a backup of your service. If this is a production site, you should set up automatic nightly backups.

    • If you want traffic reports, set up analog or another log processing program.

    • Follow the instruction on the home page to change the appearance of your service or add more - packages. (more information)

    • Proceed to the tutorial to learn how to develop your own packages.

    • Set up database environment variables for the site + packages. (more information)

    • Proceed to the tutorial to learn how to develop your own packages.

    • Set up database environment variables for the site user. These settings are necessary for working with the database while logged in as the service user. They do not directly affect the service's run-time connection with the database, because those environmental variables are set by the - wrapper scripts nsd-postgres and nsd-oracle.

      [root@yourserver root]# su - service0
      -[service0@yourserver service0]$ emacs .bashrc

      Put in the appropriate lines for the database you are running. If you will use both databases, put in both sets of lines.

      • PostgreSQL:

        export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib
        +	wrapper scripts nsd-postgres and nsd-oracle.

        [root root]# su - service0
        +[service0 service0]$ emacs .bashrc

        Put in the appropriate lines for the database you are running. If you will use both databases, put in both sets of lines.

        • PostgreSQL:

          export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib
           export PATH=$PATH:/usr/local/pgsql/bin
        • Oracle. These environment variables are specific for a local Oracle installation communicating via IPC. If you are connecting to a remote Oracle installation, you'll need to adjust these appropriately. Also, @@ -391,19 +372,18 @@ export ORACLE_SID=ora8 export ORACLE_TERM=vt100 export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

      Test this by logging out and back in as - service0 and checking the paths.

      [service0@yourserver service0]$ exit
      +	service0 and checking the paths.

      [service0 service0]$ exit
       logout
      -[root@yourserver src]# su - service0
      -[postgres@yourserver pgsql]$ env | grep PATH
      +[root src]# su - service0
      +[service0 ~]$ env
       
      • For PostgreSQL, you should see:

        -LD_LIBRARY_PATH=LD_LIBRARY_PATH=:/usr/local/pgsql/lib
        -PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:/root/bin:/usr/local/pgsql/bin:/usr/local/pgsql/bin
      • For Oracle:

        ORACLE_BASE=/ora8/m01/app/oracle
        +LD_LIBRARY_PATH=:/usr/local/pgsql/lib
        +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:\
        +  /root/bin:/usr/local/pgsql/bin:/usr/local/pgsql/bin
      • For Oracle:

        ORACLE_BASE=/ora8/m01/app/oracle
         ORACLE_HOME=/ora8/m01/app/oracle/product/8.1.7
        -PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:/root/bin:/ora8/m01/app/oracle/product/8.1.7/bin
        +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:\
        +  /root/bin:/ora8/m01/app/oracle/product/8.1.7/bin
         LD_LIBRARY_PATH=/ora8/m01/app/oracle/product/8.1.7/lib:/lib:/usr/lib
         ORACLE_SID=ora8
         ORACLE_TERM=vt100
        -ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
      [service0@yourserver service0]$ exit
      -logout
      -
      -[root@yourserver root]#
    • Test your backup and recovery procedure.

    • Set up the section called “External uptime validation”.

    ($Id$)
    View comments on this page at openacs.org
    +ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
  • Test your backup and recovery procedure.

  • Set up the section called “External uptime validation”.

  • ($Id$)
    View comments on this page at openacs.org
    Index: openacs-4/packages/acs-core-docs/www/oracle.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/oracle.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/oracle.html 11 Dec 2003 23:08:46 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/oracle.html 4 Feb 2004 16:47:33 -0000 1.25 @@ -1,10 +1,10 @@ -Install Oracle 8.1.7

    Install Oracle 8.1.7

    By Vinod Kurup

    +Install Oracle 8.1.7

    Install Oracle 8.1.7

    By Vinod Kurup

    OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

    Note

    Skip this section if you're not interested in Oracle.

    - OpenACS 5.0.0b4 does not yet work with Oracle 9i + OpenACS will install with Oracle 9i but has not been extensively tested so may still have bugs or tuning issues.

    This document assumes that you'll be installing Oracle on the same @@ -85,16 +85,16 @@ startx

    -joeuser:~$ startx

    +[joeuser ~]$ startx

  • Open a terminal window type and login as root

    -joeuser:~$ su -
    +[joeuser ~]$ su -
     Password: ***********
    -root:~#

    +[root ~]#

  • @@ -108,11 +108,11 @@ stopping the database.

    -root:~# groupadd dba
    -root:~# groupadd oinstall
    -root:~# groupadd oracle
    -root:~# useradd -g dba -G oinstall,oracle -m oracle
    -root:~# passwd oracle

    +[root ~]# groupadd dba +[root ~]# groupadd oinstall +[root ~]# groupadd oracle +[root ~]# useradd -g dba -G oinstall,oracle -m oracle +[root ~]# passwd oracle

    You will be prompted for the New Password and Confirmation of that password. @@ -131,7 +131,7 @@ install successfully.

    -root:~# mkdir /ora8
    +[root ~]# mkdir /ora8
     root:/ora8# cd /ora8
     root:/ora8# mkdir -p m01 m02 m03/oradata/ora8
     root:/ora8# chown -R oracle.dba /ora8
    @@ -147,7 +147,7 @@
                   following:
     
                 

    -joeuser:~$ su - oracle
    +[joeuser ~]$ su - oracle
     Password: ********
  • Use a text editor to edit the @@ -156,7 +156,7 @@ directory.

    -oracle:~$ emacs .bash_profile

    +[oracle ~]$ emacs .bash_profile

    You may get this error trying to start emacs: @@ -171,13 +171,13 @@ If so, open a new terminal window and do the following:

    -joeuser:~$ xhost +localhost

    +[joeuser ~]$ xhost +localhost

    Now, back in the oracle terminal:

    -oracle:~$ export DISPLAY=localhost:0.0
    -oracle:~$ emacs .bash_profile

    +[oracle ~]$ export DISPLAY=localhost:0.0 +[oracle ~]$ emacs .bash_profile

    Try this procedure anytime you get an Xlib connection refused error. @@ -222,7 +222,7 @@ Log out as oracle

    -oracle:~$ exit
  • +[oracle ~]$ exit

  • Log back in as oracle and double check that your environment variables are as intended. The @@ -232,8 +232,8 @@ you want (those with ORA in it).

    -joeuser:~$ su - oracle
    -oracle:~$ env | grep ORA

    +[joeuser ~]$ su - oracle +[oracle ~]$ env | grep ORA

    If it worked, you should see: @@ -263,7 +263,7 @@ by typing:

    -oracle:~$ echo $PATH
    +[oracle ~]$ echo $PATH
     /bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin:/home/oracle/bin:/ora8/m01/app/oracle/product/8.1.7/bin

    If they are not, then add them to the @@ -275,10 +275,10 @@ Log in as oracle and start X if not already running. Start a new terminal:

    -joeuser:~$ xhost +localhost
    -joeuser:~$ su - oracle
    +[joeuser ~]$ xhost +localhost
    +[joeuser ~]$ su - oracle
     Password: **********
    -oracle:~$ export DISPLAY=localhost:0.0
  • +[oracle ~]$ export DISPLAY=localhost:0.0

  • Find the runInstaller script @@ -289,17 +289,17 @@ the cd-rom mount point

    -oracle:~$ su - root
    -root:~# mount -t iso9660 /dev/cdrom /mnt/cdrom
    -root:~# exit
    -oracle:~$ cd /mnt/cdrom
  • +[oracle ~]$ su - root +[root ~]# mount -t iso9660 /dev/cdrom /mnt/cdrom +[root ~]# exit +[oracle ~]$ cd /mnt/cdrom

  • If you are installing from the tarball, the install script is located in the Oracle8iR2 directory that was created when you expanded the archive.

    -oracle:~$ cd /where/oracle/Disk1
  • +[oracle ~]$ cd /where/oracle/Disk1

    Check to make sure the file is there. @@ -388,18 +388,18 @@ /usr/bin/awk before running the script below

    -joueser:~$ su -
    -root:~# ln -s /usr/bin/awk /bin/awk
  • +[joueser ~]$ su - +[root ~]# ln -s /usr/bin/awk /bin/awk

  • Open a new terminal window, then type: -

    joeuser:~$ su -
    -root:~# cd /ora8/m01/app/oracle/product/8.1.7
    -root:~# ./orainstRoot.sh  
    +        

    [joeuser ~]$ su -
    +[root ~]# cd /ora8/m01/app/oracle/product/8.1.7
    +[root ~]# ./orainstRoot.sh  
     ; You should see:
     Creating Oracle Inventory pointer file (/etc/oraInst.loc)
     Changing groupname of /ora8/m01/app/oracle/oraInventory to oinstall.
    -root:~# mkdir -p /usr/local/java
    -root:~# exit
    -joeuser:~$ exit
  • +[root ~]# mkdir -p /usr/local/java +[root ~]# exit +[joeuser ~]$ exit

  • Click "Retry"

  • The "Available Products" screen in the OUI: @@ -515,11 +515,11 @@ su to get root privileges, while keeping the oracle user's enviroment.

    -joeuser:~$ su - oracle
    +[joeuser ~]$ su - oracle
     Password: *********
    -oracle:~$ su
    +[oracle ~]$ su
     Password: *********
    -root:~# /ora8/m01/app/oracle/product/8.1.7/root.sh
    +[root ~]# /ora8/m01/app/oracle/product/8.1.7/root.sh
     ; You should see the following.   
     
     Creating Oracle Inventory pointer file (/etc/oraInst.loc)
    @@ -549,8 +549,8 @@
                   Do not follow the instructions on deleting trace
                   and log files, it is not necessary.
                 

  • -root:~# exit
    -joeuser:~$ exit
  • +[root ~]# exit +[joeuser ~]$ exit

  • Go back to the pop-up window and click "OK"

  • The "Configuration Tools" screen in the OUI @@ -649,11 +649,11 @@ su to oracle and then run the dbassist program.

    -joeuser:~$ xhost +localhost
    -joeuser:~$ su - oracle
    +[joeuser ~]$ xhost +localhost
    +[joeuser ~]$ su - oracle
     Password: *********
    -oracle:~$ export DISPLAY=localhost:0.0
    -oracle:~$ dbassist
  • +[oracle ~]$ export DISPLAY=localhost:0.0 +[oracle ~]$ dbassist

  • The "Welcome" screen in the Oracle Database Configuration Agent (ODCA)

    • @@ -751,7 +751,7 @@ /ora8/m01/app/oracle/product/8.1.7, the following will open the file for editing.

      -oracle:~$ emacs /ora8/m01/app/oracle/product/8.1.7/dbs/initora8.ora
    • +[oracle ~]$ emacs /ora8/m01/app/oracle/product/8.1.7/dbs/initora8.ora

    • Add the following line to the end:

       nls_date_format = "YYYY-MM-DD"
    • @@ -782,7 +782,7 @@ Change to the directory where the database creation script is and run it:

      -oracle:~$ cd /ora8/m01/app/oracle/product/8.1.7/assistants/dbca/jlib
      +[oracle ~]$ cd /ora8/m01/app/oracle/product/8.1.7/assistants/dbca/jlib
       oracle:/ora8/m01/app/oracle/product/8.1.7/assistants/dbca/jlib$ ./sqlora8.sh

      In some instances, Oracle will save the file to /ora8/m01/app/oracle/product/8.1.7/assistants/dbca @@ -808,16 +808,16 @@

    • In the oracle shell, copy the file.

      -oracle:~$ cp /tmp/acceptance-sql.txt /tmp/acceptance.sql
    • +[oracle ~]$ cp /tmp/acceptance-sql.txt /tmp/acceptance.sql

    • Once you've got the acceptance test file all set, stay in your term and type the following:

      -oracle:~$ sqlplus system/manager

      +[oracle ~]$ sqlplus system/manager

      SQL*Plus should startup. If you get an ORA-01034: Oracle not Available error, it is because your Oracle instance is not running. You can manually start it as the oracle user.

      -oracle:~$ svrmgrl
      +[oracle ~]$ svrmgrl
       SVRMGR> connect internal
       SVRMGR> startup
    • Now that you're into SQL*Plus, change the default passwords @@ -878,8 +878,8 @@ /tmp. Then, as oracle, do the following:

      -oracle:~$ cp /tmp/dbstart.txt /ora8/m01/app/oracle/product/8.1.7/bin/dbstart 
      -oracle:~$ chmod 755 /ora8/m01/app/oracle/product/8.1.7/bin/dbstart
    • +[oracle ~]$ cp /tmp/dbstart.txt /ora8/m01/app/oracle/product/8.1.7/bin/dbstart +[oracle ~]$ chmod 755 /ora8/m01/app/oracle/product/8.1.7/bin/dbstart

    • While you're logged in as oracle, you should configure the @@ -909,15 +909,15 @@ /etc/rc.d/init.d throughout this section)

      -oracle:~$ su -
      -root:~# cp /tmp/oracle8i.txt /etc/rc.d/init.d/oracle8i
      -root:~# chown root.root /etc/rc.d/init.d/oracle8i
      -root:~# chmod 755 /etc/rc.d/init.d/oracle8i
    • +[oracle ~]$ su - +[root ~]# cp /tmp/oracle8i.txt /etc/rc.d/init.d/oracle8i +[root ~]# chown root.root /etc/rc.d/init.d/oracle8i +[root ~]# chmod 755 /etc/rc.d/init.d/oracle8i

    • Test the script by typing the following commands and checking the output. (Debian Users: as root, do mkdir /var/lock/subsys first)

      -root:~# /etc/rc.d/init.d/oracle8i stop
      +[root ~]# /etc/rc.d/init.d/oracle8i stop
       Oracle 8i auto start/stop
       Shutting Oracle8i:
       Oracle Server Manager Release 3.1.7.0.0 - Production
      @@ -938,7 +938,7 @@
       Server Manager complete.
       Database "ora8" shut down.
             
      -root:~# /etc/rc.d/init.d/oracle8i start
      +[root ~]# /etc/rc.d/init.d/oracle8i start
       Oracle 8i auto start/stop
       Starting Oracle8i: 
       SQL*Plus: Release 8.1.7.0.0 - Production on Wed Mar 6 17:56:02 2002
      @@ -963,12 +963,12 @@
                 If it worked, then run these commands to make the startup and
                 shutdown automatic. 
               

      • Red Hat users:

        -root:~# cd /etc/rc.d/init.d/                      
        -root:~# chkconfig --add oracle8i
        -root:~# chkconfig --list oracle8i
        +[root ~]# cd /etc/rc.d/init.d/                      
        +[root ~]# chkconfig --add oracle8i
        +[root ~]# chkconfig --list oracle8i
         ; You should see:
         oracle8i        0:off   1:off   2:off   3:on    4:on    5:on    6:off
      • Debian users:

        -root:~# update-rc.d oracle8i defaults
        +[root ~]# update-rc.d oracle8i defaults
          Adding system startup for /etc/init.d/oracle8i ...
            /etc/rc0.d/K20oracle8i -> ../init.d/oracle8i
            /etc/rc1.d/K20oracle8i -> ../init.d/oracle8i
        @@ -977,7 +977,7 @@
            /etc/rc3.d/S20oracle8i -> ../init.d/oracle8i
            /etc/rc4.d/S20oracle8i -> ../init.d/oracle8i
            /etc/rc5.d/S20oracle8i -> ../init.d/oracle8i
      • SuSE users:

        -root:~# cd /etc/rc.d/init.d
        +[root ~]# cd /etc/rc.d/init.d
         root:/etc/rc.d/init.d# ln -s /etc/rc.d/init.d/oracle8i K20oracle8i
         root:/etc/rc.d/init.d# ln -s /etc/rc.d/init.d/oracle8i S20oracle8i
         root:/etc/rc.d/init.d# cp K20oracle8i rc0.d
        @@ -997,7 +997,7 @@
         root:/etc/rc.d/init.d# rm K20oracle8i
         root:/etc/rc.d/init.d# rm S20oracle8i
         root:/etc/rc.d/init.d# cd
        -root:~# SuSEconfig
        +[root ~]# SuSEconfig
         Started the SuSE-Configuration Tool.
         Running in full featured mode.
         Reading /etc/rc.config and updating the system...
        @@ -1035,14 +1035,14 @@
                   Now issue the following commands (still as
                   root).
                 

        -root:~# su - oracle
        -oracle:~$ cp /tmp/startlsnr.txt /ora8/m01/app/oracle/product/8.1.7/bin/startlsnr
        -oracle:~$ cp /tmp/stoplsnr.txt /ora8/m01/app/oracle/product/8.1.7/bin/stoplsnr    
        -oracle:~$ chmod 755 /ora8/m01/app/oracle/product/8.1.7/bin/startlsnr
        -oracle:~$ chmod 755 /ora8/m01/app/oracle/product/8.1.7/bin/stoplsnr
        -oracle:~$ exit
        -root:~# cp /tmp/listener8i.txt /etc/rc.d/init.d/listener8i
        -root:~# cd /etc/rc.d/init.d
        +[root ~]# su - oracle
        +[oracle ~]$ cp /tmp/startlsnr.txt /ora8/m01/app/oracle/product/8.1.7/bin/startlsnr
        +[oracle ~]$ cp /tmp/stoplsnr.txt /ora8/m01/app/oracle/product/8.1.7/bin/stoplsnr    
        +[oracle ~]$ chmod 755 /ora8/m01/app/oracle/product/8.1.7/bin/startlsnr
        +[oracle ~]$ chmod 755 /ora8/m01/app/oracle/product/8.1.7/bin/stoplsnr
        +[oracle ~]$ exit
        +[root ~]# cp /tmp/listener8i.txt /etc/rc.d/init.d/listener8i
        +[root ~]# cd /etc/rc.d/init.d
         root:/etc/rc.d/init.d# chmod 755 listener8i

        Test the listener automation by running the following commands and checking the output. @@ -1096,8 +1096,8 @@ sqlplus username/password/@SID

        -root:~# su - oracle
        -oracle:~$ sqlplus system/alexisahunk@ora8
        +[root ~]# su - oracle
        +[oracle ~]$ sqlplus system/alexisahunk@ora8
         
         SQL> select sysdate from dual;
         
        @@ -1106,19 +1106,19 @@
         2002-02-22
         
         SQL> exit
        -oracle:~$ exit
        -root:~#
        • RedHat users:

          +[oracle ~]$ exit +[root ~]#

        • RedHat users:

          Now run chkconfig on the listener8i script.

          -root:~# cd /etc/rc.d/init.d/
          +[root ~]# cd /etc/rc.d/init.d/
           root:/etc/rc.d/init.d# chkconfig --add listener8i
           root:/etc/rc.d/init.d# chkconfig --list listener8i
           listener8i      0:off   1:off   2:off   3:on    4:on    5:on    6:off
        • Debian users:

          Now run update-rc.d on the listener8i script.

          -root:~# update-rc.d listener8i defaults 21 19
          +[root ~]# update-rc.d listener8i defaults 21 19
            Adding system startup for /etc/init.d/listener8i ...
              /etc/rc0.d/K19listener8i -> ../init.d/listener8i
              /etc/rc1.d/K19listener8i -> ../init.d/listener8i
          @@ -1132,11 +1132,11 @@
                     As a final test, reboot your computer and make sure Oracle comes
                     up. You can do this by typing
                   

          -root:~# /sbin/shutdown -r -t 0 now

          +[root ~]# /sbin/shutdown -r -t 0 now

          Log back in and ensure that Oracle started automatically.

          -joeuser:~$ su - oracle
          -oracle:~$ sqlplus system/alexisahunk@ora8
          +[joeuser ~]$ su - oracle
          +[oracle ~]$ sqlplus system/alexisahunk@ora8
           
           SQL> exit

        Congratulations, your installation of Oracle 8.1.7 is @@ -1174,7 +1174,7 @@ isn't working, make sure that you have restarted the database since adding the line:

        -joeuser:~$ svrmgrl
        +[joeuser ~]$ svrmgrl
         SVRMGR> connect internal
         Connected.
         SVRMGR> shutdown
        @@ -1202,7 +1202,7 @@
                 

        • Run sqlplus as the dba:

          -oracle:~$ sqlplus system/changeme
        • +[oracle ~]$ sqlplus system/changeme

      • To drop a user and all of the tables and data owned by that user:

        Index: openacs-4/packages/acs-core-docs/www/os-install.html
        ===================================================================
        RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/os-install.html,v
        diff -u -N -r1.3 -r1.4
        --- openacs-4/packages/acs-core-docs/www/os-install.html	19 Nov 2003 15:44:51 -0000	1.3
        +++ openacs-4/packages/acs-core-docs/www/os-install.html	4 Feb 2004 16:47:33 -0000	1.4
        @@ -1,4 +1,4 @@
        -Linux Install Guides

        Linux Install Guides

        +Linux Install Guides

        Linux Install Guides

        Here's a list of some helpful documentation for various OS's

        • Painless Debian Index: openacs-4/packages/acs-core-docs/www/os-security.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/os-security.html,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-core-docs/www/os-security.html 19 Nov 2003 15:44:51 -0000 1.3 +++ openacs-4/packages/acs-core-docs/www/os-security.html 4 Feb 2004 16:47:33 -0000 1.4 @@ -1,4 +1,4 @@ -Security Information

          Security Information

          +Security Information

          Security Information

          Once you get your OS installed, it's imperative that you secure your installation. As Jon Griffin repeatedly warns us, "No distribution is secure out of the box." The Reference Platform implements Index: openacs-4/packages/acs-core-docs/www/packages.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/packages.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/packages.html 11 Dec 2003 23:08:46 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/packages.html 4 Feb 2004 16:47:33 -0000 1.25 @@ -1,4 +1,4 @@ -OpenACS Packages

          OpenACS Packages

          By Pete Su and Bryan Quinn

          +OpenACS Packages

          OpenACS Packages

          By Pete Su and Bryan Quinn

          OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

          Overview

          @@ -56,7 +56,7 @@ the pieces of each module are strewn all over the tree in at least 3 or 4 different areas.

          - Here is how an OpenACS 5.0.0b4 server is laid out: + Here is how an OpenACS server is laid out:

           ROOT/
               bin/
          @@ -123,7 +123,7 @@
                 sends to our server to the right page in the appropriate
                 package. While we're at it, this tool should also automate
                 package installation, dependency checking, upgrades, and package
          -      removal. In OpenACS 5.0.0b4, this tool is called the APM.
          +      removal. In OpenACS , this tool is called the APM.
               

          The APM

          The APM is used to create, maintain, and install packages. It takes care of copying all of the files and registering the package in the @@ -145,7 +145,7 @@

          The following sections will show you how to make a package for the Notes application. In addition, they will discuss some new site - management features in OpenACS 5.0.0b4 that take advantage of the APM's package + management features in OpenACS that take advantage of the APM's package instance model. The two most important of these are subsites, and the site map tool, which can be used to map applications to one or more arbitrary URLs in a running site. @@ -433,7 +433,7 @@ map content that lived outside the page root into the site, and it was also hard to map mulitiple URLs to the same place in the file system.

          - In OpenACS 5.0.0b4, administrators can define an arbitrary mapping between the + In OpenACS , administrators can define an arbitrary mapping between the URLs the user types and the actual file in the file system that is served. This mapping is called the site map and entries in the site map are called site nodes. Each site node maps a URL to an Index: openacs-4/packages/acs-core-docs/www/parties.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/parties.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/parties.html 11 Dec 2003 23:08:46 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/parties.html 4 Feb 2004 16:47:33 -0000 1.25 @@ -1,4 +1,4 @@ -Parties in OpenACS

          Parties in OpenACS

          By Rafael H. Schloming

          +Parties in OpenACS

          Parties in OpenACS

          By Rafael H. Schloming

          OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

          Introduction

          While many applications must deal with individuals and many applications Index: openacs-4/packages/acs-core-docs/www/permissions-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/permissions-design.html,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/acs-core-docs/www/permissions-design.html 11 Dec 2003 23:08:46 -0000 1.17 +++ openacs-4/packages/acs-core-docs/www/permissions-design.html 4 Feb 2004 16:47:33 -0000 1.18 @@ -1,4 +1,4 @@ -Permissions Design

          Permissions Design

          By John Prevost and Rafael H. Schloming

          +Permissions Design

          Permissions Design

          By John Prevost and Rafael H. Schloming

          OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

          Essentials

          • Tcl in packages/acs-kernel

          • OpenACS 4 Permissions Requirements

          • Index: openacs-4/packages/acs-core-docs/www/permissions-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/permissions-requirements.html,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/acs-core-docs/www/permissions-requirements.html 11 Dec 2003 23:08:46 -0000 1.17 +++ openacs-4/packages/acs-core-docs/www/permissions-requirements.html 4 Feb 2004 16:47:33 -0000 1.18 @@ -1,4 +1,4 @@ -Permissions Requirements

            Permissions Requirements

            By John McClary Prevost

            +Permissions Requirements

            Permissions Requirements

            By John McClary Prevost

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

            Introduction

            This document records requirements for the OpenACS 4 Permissions system, a Index: openacs-4/packages/acs-core-docs/www/permissions-tediously-explained.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/permissions-tediously-explained.html,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/acs-core-docs/www/permissions-tediously-explained.html 11 Dec 2003 23:08:46 -0000 1.18 +++ openacs-4/packages/acs-core-docs/www/permissions-tediously-explained.html 4 Feb 2004 16:47:33 -0000 1.19 @@ -1,4 +1,4 @@ -OpenACS Permissions Tediously Explained

            OpenACS Permissions Tediously Explained

            +OpenACS Permissions Tediously Explained

            OpenACS Permissions Tediously Explained

            by Vadim Nasardinov. Modified and converted to Docbook XML by Roberto Mello

            The code has been modified since this document was written so it is now out of date. See this forum thread.

            Overview

            The general permissions system has a relatively complex data model in OpenACS. @@ -100,7 +100,7 @@

            Context Hierarchy

            Suppose objects A, B, ..., and F form the following hierarchy. -

            Table�8.1.�Context Hierarchy Example

            A

            +

            Table�8.1.�Context Hierarchy Example

            A

            object_id=10

            B

            object_id=20 @@ -116,7 +116,7 @@ This can be represented in the acs_objects table by the following entries: -

            Table�8.2.�acs_objects example data

            object_idcontext_id
            2010
            3010
            4020
            5020
            6030

            +

            Table�8.2.�acs_objects example data

            object_idcontext_id
            2010
            3010
            4020
            5020
            6030

            The first entry tells us that object 20 is the descendant of object 10, and the third entry shows that object 40 is the descendant of object 20. By running a CONNECT BY query, Index: openacs-4/packages/acs-core-docs/www/permissions.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/permissions.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/permissions.html 11 Dec 2003 23:08:46 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/permissions.html 4 Feb 2004 16:47:33 -0000 1.25 @@ -1,8 +1,8 @@ -Groups, Context, Permissions

            Groups, Context, Permissions

            By Pete Su

            +Groups, Context, Permissions

            Groups, Context, Permissions

            By Pete Su

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

            Overview

            -The OpenACS 5.0.0b4 Permissions system allows developers and administrators to +The OpenACS Permissions system allows developers and administrators to set access control policies at the object level, that is, any application or system object represented by a row in the acs_objects table can be access-controlled via a simple @@ -13,7 +13,7 @@ Although this may all sound easy and wonderful, no developer or administrator would want to explicitly set access control rights for every user and every object on a -site. Therefore, OpenACS 5.0.0b4 has two auxiliary mechanisms for making this +site. Therefore, OpenACS has two auxiliary mechanisms for making this easier: First, the Groups system allows users to be grouped together in flexible ways. Second, the object model defines a notion of object context, which allows applications to group objects @@ -25,7 +25,7 @@ define simple groupings of users. Each group had a human readable name and unique ID, and there was a single mapping table that mapped users to groups. (The actual data model was more complicated because it -contained a meta-data system much like the OpenACS 5.0.0b4 object type system, +contained a meta-data system much like the OpenACS object type system, but that's not relevant right now.)

            The 3.x groups system, while very useful, was limited in few ways. The @@ -47,7 +47,7 @@ member of Greenpeace, its members are not necessarily members of Greenpeace.

            -OpenACS 5.0.0b4 solves both of these modeling problems by introducing a new +OpenACS solves both of these modeling problems by introducing a new abstraction called a party. Parties have a recursive definition, and we can illustrate how it works with the following simplified data model. First, we define the parties @@ -113,18 +113,18 @@ already know what parties and objects are, but we don't know what privileges are.

            -In OpenACS 5.0.0b4, a privilege models the right to perform some operation on +In OpenACS , a privilege models the right to perform some operation on some object. They are the basic units out of which we build access control policies. For example, in the Unix filesystem we typically implement access control by granting users some combination of -read. write or execute privileges on files and directories. In OpenACS 5.0.0b4, +read. write or execute privileges on files and directories. In OpenACS , the table of privileges is organized hierarchically so that developers can define privileges that aggregate some set of privileges together. For example, if we have read, write, create and delete privileges, it might be convenient to combine them into a new privilege called "admin". Then if we grant a user this privilege she is automatically granted all the child privileges that the privilege -contains. The OpenACS 5.0.0b4 kernel data model actually defines these +contains. The OpenACS kernel data model actually defines these privileges as follows:

             
            @@ -164,7 +164,7 @@
             permissions to large groups of objects in the site, all at once. We
             use contexts to achieve this goal.
             

            Object Context

            -In OpenACS 5.0.0b4, an object context is a generalization of the scoping +In OpenACS , an object context is a generalization of the scoping mechanism introduced in OpenACS 3.x. "Scoping" and "scope" are terms best explained by example: consider some hypothetical rows in the address_book table: @@ -179,7 +179,7 @@ person or a group of people or the general public (itself a group of people).

            -In OpenACS 5.0.0b4, rather than breaking the world into a limited set of scopes, +In OpenACS , rather than breaking the world into a limited set of scopes, every object lives in a single context. A context is just an another object that represents the security domain to which the object belongs. By convention, if an object A doesn't have any permissions @@ -196,7 +196,7 @@ application. With only row-level permissions it is not obvious how to reasonably initialize the access control list when creating a message. At best, we have to explicitly grant various read and write -privileges whenever we create a message, which is tedious. In OpenACS 5.0.0b4, +privileges whenever we create a message, which is tedious. In OpenACS , a reasonable thing to do is to create an object representing a forum, and point the context_id field of a new message at the forum. Then, suppose we grant every user in the system read-access to @@ -328,7 +328,7 @@

            This displays the title of the note as either a link or plain text depending on whether or not we have write privileges on the object. -The if tag is something that the OpenACS 5.0.0b4 template system +The if tag is something that the OpenACS template system defines for you to support conditional presentation. The templates developer guide provides more information about this.

            If you study the rest of the system, you will also notice that the @@ -342,7 +342,7 @@ permissions to notes that she wanted to make public or whatever. But that's beyond the scope of this example.

            Summary

            -OpenACS 5.0.0b4 defines three separate mechanisms for specifying access control +OpenACS defines three separate mechanisms for specifying access control in applications. The Groups data model allows you to define hierarchical organizations of users and groups of users. The Permissions data model allows you to define a hierarchy of user rights. Finally, Index: openacs-4/packages/acs-core-docs/www/postgres.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/postgres.html,v diff -u -N -r1.23 -r1.24 --- openacs-4/packages/acs-core-docs/www/postgres.html 11 Dec 2003 23:08:46 -0000 1.23 +++ openacs-4/packages/acs-core-docs/www/postgres.html 4 Feb 2004 16:47:33 -0000 1.24 @@ -1,8 +1,7 @@ -Install PostgreSQL

            Install PostgreSQL

            by Vinod Kurup

            +Install PostgreSQL

            Install PostgreSQL

            by Vinod Kurup

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

            Skip this section if you will run only Oracle.

            OpenACS 5.0.0b4 will run with PostgreSQL 7.2.x, 7.3.2, - 7.3.3, and 7.3.4. 7.3.4 is the recommended version of PostgreSQL.

            • Debian.�

              Debian users can install the package and add some backwards-compatibility links:

              apt-get install postgresql postgresql-dev postgresql-doc
              +        

            Skip this section if you will run only Oracle.

            OpenACS will run with PostgreSQL 7.2.x, 7.3.2, 7.3.3, and 7.3.4. 7.3.4 is the recommended version of PostgreSQL. PostgreSQL 7.4 has been verified.

            • Mac OS X.�If you are running Mac OS X prior to 10.3, you should be able to install and use PostGreSQL 7.2.x or 7.3.x. Mac OS X 10.3 requires PostGreSQL 7.4.

            • Debian.�

              Debian users, especially Debian stable users, should install PostGreSQL from source as detailed below. Debian unstable users: the following process has been known to work:

              apt-get install postgresql postgresql-dev postgresql-doc
               ln -s /usr/include/postgresql/ /usr/include/pgsql
               ln -s /var/lib/postgres /usr/local/pgsql
               ln -s /usr/include/pgsql /usr/local/pgsql/include
              @@ -11,78 +10,85 @@
                 can skip a few steps.  These shell commands add some links for compatibility with the directories from a source-based install; start the service; create a new group for web service
                 users, and modify the postgres user's
                 environment (more
              -  information):

              [root@yourserver root]# ln -s /usr/lib/pgsql/ /var/lib/pgsql/lib
              -[root@yourserver root]# ln -s /var/lib/pgsql /usr/local/pgsql
              -[root@yourserver root]# ln -s /etc/init.d/postgresql /etc/init.d/postgres
              -[root@yourserver root]# service postgresql start
              +  information):

              [root root]# ln -s /usr/lib/pgsql/ /var/lib/pgsql/lib
              +[root root]# ln -s /var/lib/pgsql /usr/local/pgsql
              +[root root]# ln -s /etc/init.d/postgresql /etc/init.d/postgres
              +[root root]# ln -s /usr/bin /usr/local/pgsql/bin
              +[root root]# service postgresql start
               Initializing database:
                                                                          [  OK  ]
               Starting postgresql service:                               [  OK  ]
              -[root@yourserver root]# echo "export LD_LIBRARY_PATH=/usr/local/pgsql/lib" >> ~postgres/.bash_profile
              -[root@yourserver root]# echo "export PATH=$PATH:/usr/local/pgsql/bin" >> ~postgres/.bash_profile
              -[root@yourserver root]# groupadd web
              -[root@yourserver root]# su - postgres
              +[root root]# echo "export LD_LIBRARY_PATH=/usr/local/pgsql/lib" >> ~postgres/.bash_profile
              +[root root]# echo "export PATH=$PATH:/usr/local/pgsql/bin" >> ~postgres/.bash_profile
              +[root root]# groupadd web
              +[root root]# su - postgres
               -bash-2.05b$
               
               ln -s /usr/lib/pgsql/ /var/lib/pgsql/lib
               ln -s /var/lib/pgsql /usr/local/pgsql
              +ln -s /usr/bin /usr/local/pgsql/bin
               service postgresql start
               echo "export LD_LIBRARY_PATH=/usr/local/pgsql/lib" >> ~postgres/.bash_profile
               echo "export PATH=$PATH:/usr/local/pgsql/bin" >> ~postgres/.bash_profile
               groupadd web
               su - postgres

              ... and then skip to 6. Something similar may work for other binary packages as well.

            1. Unpack PostgreSQL.�If you have not downloaded the postgresql tarball to /tmp/postgresql-7.3.4.tar.gz, - get it.

              [root@yourserver root]# cd /usr/local/src
              -[root@yourserver src]# tar xzf /tmp/postgresql-7.3.4.tar.gz
              -[root@yourserver src]# 
              +        get it.

              [root root]# cd /usr/local/src
              +[root src]# tar xzf /tmp/postgresql-7.3.4.tar.gz
              +[root src]# 
               cd /usr/local/src
               tar xzf /tmp/postgresql-7.3.4.tar.gz
            2. Create the Postgres user.� Create a user and group (if you haven't done so before) for PostgreSQL. This is the account that PostgreSQL will run as since it will not run as root. Since nobody will log in directly as that user, we'll leave the password blank. -

              [root@yourserver src]# groupadd web
              -[root@yourserver src]# useradd -g web -d /usr/local/pgsql postgres
              -[root@yourserver src]# mkdir -p /usr/local/pgsql
              -[root@yourserver src]# chown -R postgres.web /usr/local/pgsql /usr/local/src/postgresql-7.3.4
              -[root@yourserver src]# chmod 750 /usr/local/pgsql
              -[root@yourserver src]#
              +	

              [root src]# groupadd web
              +[root src]# useradd -g web -d /usr/local/pgsql postgres
              +[root src]# mkdir -p /usr/local/pgsql
              +[root src]# chown -R postgres.web /usr/local/pgsql /usr/local/src/postgresql-7.3.4
              +[root src]# chmod 750 /usr/local/pgsql
              +[root src]#
               groupadd web
               useradd -g web -d /usr/local/pgsql postgres
               mkdir -p /usr/local/pgsql
               chown -R postgres.web /usr/local/pgsql /usr/local/src/postgresql-7.3.4
              -chmod 750 /usr/local/pgsql
            3. Set up postgres's environment variables.�They are necessary for the executable to find its supporting - libraries. For convenience, we'll simply append the necessary - lines to the postgres shell config file.

              [root@yourserver src]# echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib" >> ~postgres/.bashrc
              -[root@yourserver src]# echo "export PATH=$PATH:/usr/local/pgsql/bin" >> ~postgres/.bashrc
              -echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib" >> ~postgres/.bashrc
              -echo "export PATH=$PATH:/usr/local/pgsql/bin" >> ~postgres/.bashrc

              Test this by logging in as +chmod 750 /usr/local/pgsql

              • Mac OS X: Do instead:

                sudo niutil -create / /groups/web
                +sudo niutil - list / /groups

                The second command returns a list of groups. The last entry should include the gid of the group web, which you will need in the next sequence:

                sudo niutil -create / /users/postgres
                +sudo niutil -createprop / /users/postgres gid web's gid_number
                +sudo niutil -createprop / /users/postgres home /usr/local/pgsql
                +sudo niutil -createprop / /users/postgres shell /bin/bash
                +mkdir -p /usr/local/pgsql
                +chown -R postgres:web /usr/local/pgsql /usr/local/src/postgresql-7.4
                +chmod 750 /usr/local/pgsql
            4. Set up postgres's environment variables.�They are necessary for the executable to find its supporting + libraries. Put the following lines into the postgres user's environment.

              [root src]# su - postgres
              +[postgres ~] emacs ~postgres/.bashrc

              Paste these lines into .bashrc:

              export PATH=$PATH:/usr/local/pgsql/bin
              +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib

              Test this by logging in as postgres and checking the - paths; you should see /usr/local/pgsql/bin

              [root@yourserver src]# su - postgres
              -[postgres@yourserver pgsql]$ env | grep PATH
              +	paths; you should see /usr/local/pgsql/bin

              [root src]# su - postgres
              +[postgres pgsql]$ env | grep PATH
               LD_LIBRARY_PATH=:/usr/local/pgsql/lib
               PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:/root/bin:/usr/local/pgsql/bin:/usr/local/pgsql/bin
              -[postgres@yourserver pgsql]$ exit
              +[postgres pgsql]$ exit
               
            5. Compile and install PostgreSQL.� Change to the postgres user and run ./configure to set the compilation options automatically. This is the point at which you can configure PostgreSQL in various ways. For example, if you want to enable - Unicode support, add the flags --enable-locale and --enable-multibyte. If you want to see what the other possibilities are, run ./configure --help. -

              [root@yourserver src]# su - postgres
              -[postgres@yourserver pgsql]$ cd /usr/local/src/postgresql-7.3.4
              -[postgres@yourserver postgresql-7.3.4]$ ./configure
              +	  Unicode support, add the flags --enable-locale and --enable-multibyte. If you want to see what the other possibilities are, run ./configure --help.
              +	

              [root src]# su - postgres
              +[postgres pgsql]$ cd /usr/local/src/postgresql-7.3.4
              +[postgres postgresql-7.3.4]$ ./configure
               creating cache ./config.cache
               checking host system type... i686-pc-linux-gnu
               (many lines omitted>
               linking ./src/makefiles/Makefile.linux to src/Makefile.port
               linking ./src/backend/port/tas/dummy.s to src/backend/port/tas.s
              -[postgres@yourserver postgresql-7.3.4]$ make all
              +[postgres postgresql-7.3.4]$ make all
               make -C doc all
               make[1]: Entering directory `/usr/local/src/postgresql-7.3.4/doc'
               (many lines omitted)
               make[1]: Leaving directory `/usr/local/src/postgresql-7.3.4/src'
               All of PostgreSQL successfully made. Ready to install.
              -[postgres@yourserver postgresql-7.3.4]$ make install
              +[postgres postgresql-7.3.4]$ make install
               make -C doc install
               make[1]: Entering directory `/usr/local/src/postgresql-7.3.4/doc'
               (many lines omitted)
              @@ -96,15 +102,15 @@
               	  The initdb command initializes the
               	  database. pg_ctl is used to start up
               	  PostgreSQL.
              -	

              [postgres@yourserver tsearch]$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
              +	

              [postgres tsearch]$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
               The files belonging to this database system will be owned by user "postgres".
               This user must also own the server process.
               (17 lines omitted)
               or
                   /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
              -[postgres@yourserver tsearch]$ /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/data/server.log start
              +[postgres tsearch]$ /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/data/server.log start
               postmaster successfully started
              -[postgres@yourserver tsearch]$
              +[postgres tsearch]$
               /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
               /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/data/server.log start

              PostgreSQL errors will be logged in @@ -113,20 +119,20 @@ access. Plpgsql is a PL/SQL-like language. We add it to template1, which is the template from which all new databases are created. We can verify that it was created - with the createlang command in list mode.

              [postgres@yourserver pgsql]$ createlang plpgsql template1
              -[postgres@yourserver pgsql]$ createlang -l template1
              +	  with the createlang command in list mode.

              [postgres pgsql]$ createlang plpgsql template1
              +[postgres pgsql]$ createlang -l template1
               Procedural languages
                 Name   | Trusted?
               ---------+----------
                plpgsql | t
               (1 row)
               
              -[postgres@yourserver pgsql]$
              +[postgres pgsql]$
               createlang plpgsql template1
               createlang -l template1
            6. Test PostgreSQL (OPTIONAL).�Create a database and try some simple commands. The output should be as shown. -

              [postgres@yourserver pgsql]$ createdb mytestdb
              +	

              [postgres pgsql]$ createdb mytestdb
               CREATE DATABASE
              -[postgres@yourserver pgsql]$ psql mytestdb
              +[postgres pgsql]$ psql mytestdb
               Welcome to psql, the PostgreSQL interactive terminal.
               
               Type:  \copyright for distribution terms
              @@ -150,55 +156,55 @@
               (1 row)
               
               mytestdb=# \q
              -[postgres@yourserver pgsql]$ dropdb mytestdb
              +[postgres pgsql]$ dropdb mytestdb
               DROP DATABASE
              -[postgres@yourserver pgsql]$ exit
              +[postgres pgsql]$ exit
               logout
               
              -[root@yourserver src]#
            7. Set PostgreSQL to start on boot. First, we copy the +[root src]#

            8. Set PostgreSQL to start on boot. First, we copy the postgresql.txt init script, which automates startup and shutdown, to the distribution-specific init.d directory. Then we verify that it works. Then we automate it by setting up a bunch of symlinks that ensure that, when the operating system changes runlevels, postgresql goes to the appropriate state. Red Hat and Debian and SuSE each work a little differently. -

              • Red Hat RPM:

                The init script is already installed; just turn it on for the appropriate run levels.

                [root@yourserver root]# chkconfig --level 345 postgresql on
                -[root@yourserver root]# 
              • Red Hat from source:

                [root@yourserver src]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
                -[root@yourserver src]# chown root.root /etc/rc.d/init.d/postgresql
                -[root@yourserver src]# chmod 755 /etc/rc.d/init.d/postgresql
                -[root@yourserver src]# 
                -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
                +	

                • Red Hat RPM:

                  The init script is already installed; just turn it on for the appropriate run levels.

                  [root root]# chkconfig --level 345 postgresql on
                  +[root root]# 
                • Red Hat from source:

                  [root src]# cp /tmp//packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
                  +[root src]# chown root.root /etc/rc.d/init.d/postgresql
                  +[root src]# chmod 755 /etc/rc.d/init.d/postgresql
                  +[root src]# 
                  +cp /tmp//packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
                   chown root.root /etc/rc.d/init.d/postgresql
                  -chmod 755 /etc/rc.d/init.d/postgresql

                  Test the script.

                  [root@yourserver root]# service postgresql stop
                  +chmod 755 /etc/rc.d/init.d/postgresql

                  Test the script.

                  [root root]# service postgresql stop
                   Stopping PostgreSQL: ok
                  -[root@yourserver root]# 

                  If PostgreSQL successfully stopped, then use the following +[root root]#

                If PostgreSQL successfully stopped, then use the following command to make sure that the script is run appropriately at boot and shutdown. And turn it back on because we'll use it later. -

                [root@yourserver root]# chkconfig --add postgresql
                -[root@yourserver root]# chkconfig --level 345 postgresql on
                -[root@yourserver root]# chkconfig --list postgresql
                +		

                [root root]# chkconfig --add postgresql
                +[root root]# chkconfig --level 345 postgresql on
                +[root root]# chkconfig --list postgresql
                 postgresql      0:off   1:off   2:on    3:on    4:on    5:on    6:off
                -[root@yourserver root]# service postgresql start
                +[root root]# service postgresql start
                 Starting PostgreSQL: ok
                -[root@yourserver root]#
                +[root root]#
                 chkconfig --add postgresql
                 chkconfig --level 345 postgresql on
                 chkconfig --list postgresql
                -service postgresql start
              • Debian:

                root:~# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
                -root:~# chown root.root /etc/init.d/postgresql
                -root:~# chmod 755 /etc/init.d/postgresql
                -root:~# 
                -cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
                +service postgresql start
              • Debian:

                [root ~]# cp /tmp//packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
                +[root ~]# chown root.root /etc/init.d/postgresql
                +[root ~]# chmod 755 /etc/init.d/postgresql
                +[root ~]# 
                +cp /tmp//packages/acs-core-docs/www/files/postgresql.txt /etc/init.d/postgresql
                 chown root.root /etc/init.d/postgresql
                -chmod 755 /etc/init.d/postgresql

                Test the script

                root:~# /etc/init.d/postgresql stop
                +chmod 755 /etc/init.d/postgresql

                Test the script

                [root ~]# /etc/init.d/postgresql stop
                 Stopping PostgreSQL: ok
                -root:~# 

                If PostgreSQL successfully stopped, then use the following +[root ~]#

                If PostgreSQL successfully stopped, then use the following command to make sure that the script is run appropriately at boot and shutdown.

                -root:~# update-rc.d postgresql defaults
                +[root ~]# update-rc.d postgresql defaults
                  Adding system startup for /etc/init.d/postgresql ...
                    /etc/rc0.d/K20postgresql -> ../init.d/postgresql
                    /etc/rc1.d/K20postgresql -> ../init.d/postgresql
                @@ -207,9 +213,9 @@
                    /etc/rc3.d/S20postgresql -> ../init.d/postgresql
                    /etc/rc4.d/S20postgresql -> ../init.d/postgresql
                    /etc/rc5.d/S20postgresql -> ../init.d/postgresql
                -root:~# /etc/init.d/postgresql start
                +[root ~]# /etc/init.d/postgresql start
                 Starting PostgreSQL: ok
                -root:~#
              • SuSE:

                Note

                +[root ~]#

              • SuSE:

                Note

                I have received reports that SuSE 8.0 is different from previous versions. Instead of installing the boot scripts in @@ -219,20 +225,20 @@ rc.d/ part in each of the following commands. -

                root:~# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/postgresql.txt /etc/rc.d/init.d/postgresql
                -root:~# chown root.root /etc/rc.d/init.d/postgresql
                -root:~# chmod 755 /etc/rc.d/init.d/postgresql

                +

              [root ~]# cp /tmp//packages/acs-core-docs/www/files/postgresql.txt /etc/rc.d/init.d/postgresql
              +[root ~]# chown root.root /etc/rc.d/init.d/postgresql
              +[root ~]# chmod 755 /etc/rc.d/init.d/postgresql

              Test the script. -

              root:~# /etc/rc.d/init.d/postgresql stop
              +        

              [root ~]# /etc/rc.d/init.d/postgresql stop
               Stopping PostgreSQL: ok

              If PostgreSQL successfully stopped, then use the following command to make sure that the script is run appropriately at boot and shutdown. -

              root:~# cd /etc/rc.d/init.d
              +        

              [root ~]# cd /etc/rc.d/init.d
               root:/etc/rc.d/init.d# ln -s /etc/rc.d/init.d/postgresql K20postgresql
               root:/etc/rc.d/init.d# ln -s /etc/rc.d/init.d/postgresql S20postgresql  
               root:/etc/rc.d/init.d# cp K20postgresql rc2.d
              @@ -252,7 +258,9 @@
                       

              root:/etc/rc.d/init.d # cd
               root:~ # /etc/rc.d/init.d/rc2.d/S20postgresql start
               Starting PostgreSQL: ok
              -root:~ # 

            +root:~ #

          • Mac OS X:

            1. Install the startup script:

              cd /Library/StartupItems/
              +tar xfz /var/lib/aolserver/service0/packages/acs-core-docs/www/files/osx-postgres-startup-item.tgz
              +
          • From now on, PostgreSQL should start automatically each time you boot up and it should shutdown gracefully each time you shut down. (Note: @@ -262,8 +270,8 @@ little. This usually isn't a problem as Red Hat defaults to runlevel 3)

          • Tune postgres. (OPTIONAL).�The default values for PostgreSQL are very conservative; we can safely change some of them and improve performance.

            1. Change the kernel parameter for maximum shared memory - segment size to 128Mb:

              [root@yourserver root]# echo 134217728 >/proc/sys/kernel/shmmax
              -[root@yourserver root]#

              Make that change permanent by editing + segment size to 128Mb:

              [root root]# echo 134217728 >/proc/sys/kernel/shmmax
              +[root root]#

              Make that change permanent by editing /etc/sysctl.conf to add these lines at the end:

              # increase shared memory limit for postgres
               kernel.shmmax = 134217728
            2. Edit the PostgreSQL config file, /usr/local/pgsql/data/postgresql.conf, to use more memory. These values should improve performance in most cases. (more information)

              #       Shared Memory Size
              Index: openacs-4/packages/acs-core-docs/www/programming-with-aolserver.html
              ===================================================================
              RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/programming-with-aolserver.html,v
              diff -u -N -r1.24 -r1.25
              --- openacs-4/packages/acs-core-docs/www/programming-with-aolserver.html	11 Dec 2003 23:08:46 -0000	1.24
              +++ openacs-4/packages/acs-core-docs/www/programming-with-aolserver.html	4 Feb 2004 16:47:33 -0000	1.25
              @@ -1,4 +1,4 @@
              -Programming with AOLserver

              Programming with AOLserver

              By Michael Yoon, Jon Salz and Lars Pind.

              +Programming with AOLserver

              Programming with AOLserver

              By Michael Yoon, Jon Salz and Lars Pind.

              OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

              The global command

              Index: openacs-4/packages/acs-core-docs/www/psgml-for-emacs.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/psgml-for-emacs.html,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/acs-core-docs/www/psgml-for-emacs.html 11 Dec 2003 23:08:46 -0000 1.15 +++ openacs-4/packages/acs-core-docs/www/psgml-for-emacs.html 4 Feb 2004 16:47:33 -0000 1.16 @@ -1,8 +1,8 @@ -Add PSGML commands to emacs init file (OPTIONAL)

              Add PSGML commands to emacs init file (OPTIONAL)

              +Add PSGML commands to emacs init file (OPTIONAL)

              Add PSGML commands to emacs init file (OPTIONAL)

              If you plan to write or edit any documentation with emacs, install a customized emacs configuration file with DocBook commands in the skeleton directory, so it will be used for all new users. The file also fixes the backspace -> help mis-mapping that often occurs in - terminals.

              [root@yourserver tmp]# cp /tmp/openacs-5.0.0b4/packages/acs-core-docs/www/files/emacs.txt /etc/skel/.emacs
              +      terminals.

              [root tmp]# cp /tmp//packages/acs-core-docs/www/files/emacs.txt /etc/skel/.emacs
               cp: overwrite `/etc/skel/.emacs'? y
              -[root@yourserver tmp]# 

              Debian users:

              apt-get install psgml

              Note: The new nxml mode for emacs, when used in combination with psgml, provides a pretty good set of functionality that makes DocBook editing much less painless. In particular, nxml does syntax testing in real-time so that you can see syntax errors immediately instead of in the output of the xsltproc hours or days later. For debian, apt-get install nxml.

              View comments on this page at openacs.org
              +[root tmp]#

              Debian users:

              apt-get install psgml

              Note: The new nxml mode for emacs, when used in combination with psgml, provides a pretty good set of functionality that makes DocBook editing much less painless. In particular, nxml does syntax testing in real-time so that you can see syntax errors immediately instead of in the output of the xsltproc hours or days later. For debian, apt-get install nxml.

            View comments on this page at openacs.org
            Index: openacs-4/packages/acs-core-docs/www/psgml-mode.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/psgml-mode.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/psgml-mode.html 11 Dec 2003 23:08:46 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/psgml-mode.html 4 Feb 2004 16:47:33 -0000 1.25 @@ -1,7 +1,7 @@ -Using PSGML mode in Emacs

            Using PSGML mode in Emacs

            By David Lutterkort

            +Using PSGML mode in Emacs

            Using PSGML mode in Emacs

            By David Lutterkort

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

            What it is

            PSGML Mode is a mode for editing, umm, SGML and XML documents in emacs. It +

            Note: nxml mode replaces and/or complements psgml mode. More information.

            What it is

            PSGML Mode is a mode for editing, umm, SGML and XML documents in emacs. It can parse a DTD and help you insert the right tags in the right place, knows about tags' attributes and can tell you in which contexts a tag can be used. If you give it the right DTD, that is. But even without a DTD, @@ -28,7 +28,7 @@ in it. By maintaining your own CATALOG, it is easy to add more DTD's without changing your emacs settings. (How about that HTML 4.01 DTD you always wanted to get from W3C ? The -DTD is in the zip archives and tarballs available on the site.

          • That's it. Now you are ready to tell emacs all about PSGML mode and +DTD is in the zip archives and tarballs available on the site.)

            That's it. Now you are ready to tell emacs all about PSGML mode and that funky CATALOG

            What to tell emacs

            If you installed PSGML mode in a non-standard location, e.g., somewhere in your home directory, you need to add this to the load-path by adding this line to your .emacs file:

            @@ -60,7 +60,7 @@
                   ;; Some convenient key definitions:
                   (define-key sgml-mode-map "\C-c\C-x\C-e" 'sgml-describe-element-type)
                   (define-key sgml-mode-map "\C-c\C-x\C-i" 'sgml-general-dtd-info)
            -      (define-key sgml-mode-map "\C-c\C-x\C-t" 'sgml-describe-entity))))
            +      (define-key sgml-mode-map "\C-c\C-x\C-t" 'sgml-describe-entity)
                
             

            What is a DOCTYPE ?

            All SGML and XML documents that should conform to a DTD have to declare a doctype. For the docbook XML, all your .xml files whould start with Index: openacs-4/packages/acs-core-docs/www/release-notes.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/release-notes.html,v diff -u -N -r1.28 -r1.29 --- openacs-4/packages/acs-core-docs/www/release-notes.html 11 Dec 2003 23:08:46 -0000 1.28 +++ openacs-4/packages/acs-core-docs/www/release-notes.html 4 Feb 2004 16:47:33 -0000 1.29 @@ -1,23 +1,18 @@ -OpenACS Release Notes

            OpenACS Release Notes

            Version 5.0.0 beta

            - This is the second beta release of OpenACS 5.0.0 (tagged as oacs-5-0-0b4). This - release may still have a number of serious bugs, and is not suitable for - production systems. It has passed several release criteria, - including that it installs successfully, that all automated - tests succeed, and that there are no known severity 1 - (security hole, data loss, system crash) bugs. +OpenACS Release Notes

            OpenACS Release Notes

            Version 5.0.0

            + This is OpenACS 5.0.0. This version contains no known security, data loss, or crashing bugs, nor any bugs judged release blockers. This version has received manual testing. It has passed current automated testing, which is not comprehensive. This release contains work done on the translation server http://translate.openacs.org through 3 Nov 2003.

            Please report bugs using our Bug Tracker at the OpenACS website.

            You may want to begin by reading our installation documentation for the section called “a Unix-like system”. Note that the Windows documentation is - not current for OpenACS 5.0.0b4, but an alternative is to use John + not current for OpenACS , but an alternative is to use John Sequeira's Oasis VM project.

            After installation, the full documentation set can be found by visiting - http://[your-host]/doc. + http://yourserver/doc.

            New features in this release:

            • @@ -87,10 +82,17 @@

            Potential incompatibilities:

            • - The undocumented special handling of ~ and +variable+ in formtemplates has been removed in favor of - using <noparse> and \@variable\@ (the standard templating mechanisms). Locally - provided formtemplate styles still using these mechanisms will break. + With the release of OpenACS 5, PostgreSQL 7.2 is no longer supported. + Upgrades are supported from OpenACS 4.6.3 under Oracle or + PostgreSQL 7.3. +

            • + The undocumented special handling of ~ and +variable+ in + formtemplates, found in packages/acs-templating/resources/*, + has been removed in favor of using <noparse> and + \@variable\@ (the standard templating mechanisms). Locally + provided formtemplate styles still using these mechanisms + will break.

            • Serving backup files and files from the CVS directories is turned off by default via the acs-kernel parameter ExcludedFiles in section request-processor (The variable provides a string match glob list of files and is defaulted to "*/CVS/* *~") -

            ($Id$)
            View comments on this page at openacs.org
            +

            ($Id$)
            View comments on this page at openacs.org
            Index: openacs-4/packages/acs-core-docs/www/releasing-openacs.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/releasing-openacs.html,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/acs-core-docs/www/releasing-openacs.html 23 Jan 2004 10:16:33 -0000 1.9 +++ openacs-4/packages/acs-core-docs/www/releasing-openacs.html 4 Feb 2004 16:47:33 -0000 1.10 @@ -1,47 +1,129 @@ -Appendix�E.�How to package and release OpenACS

            Appendix�E.�How to package and release OpenACS

            1. update the version number in - packages/acs-core-docs/www/xml/variables.ent, readme.txt, - and all core .info files. Regenerate the html documentation - and commit all the changes. Update the information in the - packages/acs-core-docs/www/xml/for-everyone/release-notes.xml - file. -

            2. Check out the whole cvs tree. The files must be checked - out through a cvs account with write access and should be a - checkout from the release branch. In this example, the cvs - user on openacs.org is implied from the ssh login information - previously set up. It could be overridden via - foobar@openacs.org.

              cd /var/tmp
              -cvs -d /cvsroot checkout -r oacs-5-0 openacs-4
              -

              Repeat with the dotlrn cvs tree.

              cd /var/tmp
              +Appendix�E.�How to package and release OpenACS

              Appendix�E.�How to package and release OpenACS

              1. Update documentation version numbers:

                1. Update /packages/acs-core-docs/www/xml/variables.ent with the new version number and regenerate all HTML docs +

                2. Update /readme.txt with the new version number

                3. + Commit changes +

              2. Check out the whole cvs tree. The files must be checked + out through a cvs account with write access and should be a + checkout from the release branch. In this example, we are assuming + this is being done as a local user on openacs.org (which make the + checkout and tagging operations much faster).

                cd /var/tmp
                +cvs -d /cvsroot checkout -r oacs-5-0 openacs-4

                Repeat with the dotlrn cvs tree.

                cd /var/tmp
                 mkdir dotlrn-packages
                 cd dotlrn-packages
                 cvs -d /dotlrn-cvsroot checkout -r dotlrn-2-0 dotlrn-all
                -
            3. Tag the tree.

              cd /var/tmp/openacs-4
              +
            4. Tag the tree.

              cd /var/tmp/openacs-4
               cvs tag -F openacs-5-0-0a1
              -

              Branching

              When we feature-freeze on HEAD as part of the release process, we are blocking new development. To avoid this, we branch the code at this point, so that new work can continue on HEAD while the branch is stabilized for release. However, branching means that bug fixes have to be synchronized between HEAD and the branch, and bug fixes tend to be more frequent right at this time. Therefore, our actual branch point is as late as possible - essentially, we do not branch until and unless new feature work is actively blocked by the feature freeze. Branching is almost the same as tagging, except for the flag and slightly different tag nomenclature. To see the list of old branches, cvs status -v somefile.

              cvs tag -b oacs-5-0

              Tag dotLRN. Since the dotLRN packages aren't all in one module, we iterate through all of the modules. Log in first (cvs login) so that you don't have to log in for each module.

              cd /var/tmp/dotlrn-packages
              +

              Branching

              When we feature-freeze on HEAD as part of the release process, we are blocking new development. To avoid this, we branch the code at this point, so that new work can continue on HEAD while the branch is stabilized for release. However, branching means that bug fixes have to be synchronized between HEAD and the branch, and bug fixes tend to be more frequent right at this time. Therefore, our actual branch point is as late as possible - essentially, we do not branch until and unless new feature work is actively blocked by the feature freeze. Branching is almost the same as tagging, except for the flag and slightly different tag nomenclature. To see the list of old branches, cvs status -v somefile.

              cvs tag -b oacs-5-0

              Tag dotLRN. Since the dotLRN packages aren't all in one + module, we iterate through all of the modules. Log in first + (cvs login) so that you don't have to log in for each + module.

              cd /var/tmp/dotlrn-packages
               for dir in *; do ( cd $dir && cvs tag -F dotlrn-2-0-0a1 ); done
              -
            5. Make the tarball

              • openacs-core.�

                1. Go to a new working space and export the tagged files.

                  mkdir /var/tmp/tarball
                  +

                  Note that we use the -F flag which will force the tag to the new version (just in + case someone has created the tag already on another version). Excercise care when doing this since + you don't want to inadvertently move a prior release tag. Also if the tagging goes horribly wrong + for some reason you can delete the tag via "cvs tag -d <symbolic_tag>".

                2. Make the tarball

                  • openacs-core.�

                    1. Go to a new working space and export the tagged files.

                      mkdir /var/tmp/tarball
                       cd /var/tmp/tarball
                       cvs -d :pserver:anonymous@openacs.org:/cvsroot export -r openacs-5-0-0a1 acs-core
                      -mv openacs-4 openacs
                    2. Generate the tarball

                      cd /var/tmp/tarball
                      -mv openacs openacs-5.0.0a1
                      -tar cz -f openacs-5.0.0a1.tar.gz openacs-5.0.0a1
                  • dotlrn.�

                    1. Go to a new working space and export the tagged +mv openacs-4 openacs

                    2. Generate the tarball.

                      cd /var/tmp/tarball
                      +mv openacs-4 openacs-5.0.0a1
                      +tar cz -f openacs-5.0.0a1.tar.gz openacs-5.0.0a1
                      +
                  • dotlrn.�

                    1. Go to a new working space and export the tagged files. (was getting errors here trying to use -d, so gave up and just moved things from openacs-4 to - openacs at the end)

                      mkdir /var/tmp/dotlrn-tarball
                      +                openacs at the end)

                      mkdir /var/tmp/dotlrn-tarball
                       cd /var/tmp/dotlrn-tarball
                      -cvs -d :pserver:anonymous@openacs.org:/cvsroot export \
                      -  -r openacs-5-0-0a1 acs-core
                      +cvs -d /cvsroot export -r openacs-5-0-0a1 acs-core
                       cd /var/tmp/dotlrn-tarball/openacs-4/packages
                      -cvs -d :pserver:anonymous@openacs.org:/cvsroot export \
                      -  -r openacs-5-0-0a1 dotlrn-prereq
                      -cvs -d :pserver:anonymous@dotlrn.openacs.org:/dotlrn-cvsroot export \
                      -  -r dotlrn-2-0-0a1 dotlrn-core
                      -cd /var/tmp/dotlrn-tarball
                      -mv openacs-4 openacs
                      -
                    2. Copy the dotlrn install.xml file, which controls +cvs -d /cvsroot export -r openacs-5-0-0a1 dotlrn-prereq +cvs -d /dotlrn-cvsroot export -r dotlrn-2-0-0a1 dotlrn-core +

                    3. Copy the dotlrn install.xml file, which controls which packages are installed on setup, to the root - location:

                      cp /var/tmp/dotlrn-tarball/openacs/packages/dotlrn/install.xml /var/tmp/dotlrn-tarball/openacs
                      -
                    4. Generate the tarball

                      cd /var/tmp/tarball
                      -mv openacs dotlrn-2.0.0a1
                      +                location:

                      cp /var/tmp/dotlrn-tarball/openacs-4/packages/dotlrn/install.xml \
                      +   /var/tmp/dotlrn-tarball/openacs-4
                      +
                    5. Generate the tarball

                      cd /var/tmp/dotlrn-tarball
                      +mv openacs-4 dotlrn-2.0.0a1
                       tar cz -f dotlrn-2.0.0a1.tar.gz dotlrn-2.0.0a1
                      -
                3. Test the new tarball

                4. Update on the site

              View comments on this page at openacs.org
              +
          • Test the new tarball

          • Update openacs.org frontpage, bug-tracker versions, project page, etc.

          • Clean up after yourself.

            cd /var/tmp
            +rm -rf tarball dotlrn-tarball dotlrn-packages openacs-5.0.0a1
          • + Here is a shell script that automates packaging the tarball: +

            #!/bin/bash
            +
            +# if TAG=1 create the cvs tags otherwise assume they exist.
            +TAG=1
            +
            +# What release version are we building; version format should be
            +# dashes rather than dots eg. OACS_VERSION=5-0-0b4
            +
            +OACS_VERSION=5-0-0b4
            +DOTLRN_VERSION=2-0-0b4
            +
            +OACS_BRANCH=oacs-5-0
            +DOTLRN_BRANCH=dotlrn-2-0
            +
            +DOTLRN_CVSROOT=/dotlrn-cvsroot
            +OACS_CVSROOT=/cvsroot
            +
            +#
            +# Nothing below here should need to change...
            +#
            +BASE=/var/tmp/release-$OACS_VERSION
            +mkdir $BASE
            +if [ ! -d $BASE ]; then 
            +    echo "Failed creating base dir $BASE"
            +    exit 1
            +fi
            +
            +cd $BASE 
            +
            +if [ $TAG -eq 1 ]; then 
            +
            +    # Checkout and tag the release 
            +    cvs -d $OACS_CVSROOT checkout -r $OACS_BRANCH openacs-4
            +    cd openacs-4 
            +    cvs tag -F openacs-$OACS_VERSION 
            +    cd ../
            +
            +
            +    # Checkout and tag the dotlrn release
            +    mkdir dotlrn-packages
            +    cd dotlrn-packages
            +    cvs -d $DOTLRN_CVSROOT checkout -r $DOTLRN_BRANCH dotlrn-all
            +    for dir in *; do ( cd $dir && cvs tag -F dotlrn-$DOTLRN_VERSION ); done
            +    cd ../
            +
            +    #
            +    # Should check for .sql .xql .adp .tcl .html .xml executable files and squak if found.
            +    #
            +
            +fi
            +
            +
            +
            +# Generate tarballs...
            +#
            +
            +# openacs
            +#
            +mkdir tarball
            +cd tarball
            +cvs -d $OACS_CVSROOT export -r openacs-$OACS_VERSION acs-core
            +mv opeancs-4 openacs-${OACS_VERSION//-/.}
            +tar -czf ../openacs-${OACS_VERSION//-/.}.tar.gz openacs-${OACS_VERSION//-/.}
            +cd ..
            +
            +# dotlrn
            +#
            +mkdir dotlrn-tarball
            +cd dotlrn-tarball
            +cvs -d $OACS_CVSROOT export -r openacs-$OACS_VERSION acs-core
            +cd  openacs-4/packages
            +cvs -d $OACS_CVSROOT export -r openacs-$OACS_VERSION dotlrn-prereq
            +cvs -d $DOTLRN_CVSROOT export -r dotlrn-$DOTLRN_VERSION dotlrn-core
            +cd ../..
            +cp -f openacs-4/packages/dotlrn/install.xml openacs-4
            +mv openacs-4 dotlrn-${DOTLRN_VERSION//-/.}
            +tar -czf ../dotlrn-${DOTLRN_VERSION//-/.}.tar.gz dotlrn-${DOTLRN_VERSION//-/.}
            +
            +
            +# Clean up after ourselves...
            +cd $BASE && rm -rf dotlrn-tarball tarball openacs-4 dotlrn-packages
            +
            ($Id$)
            View comments on this page at openacs.org
            Index: openacs-4/packages/acs-core-docs/www/request-processor.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/request-processor.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/request-processor.html 11 Dec 2003 23:08:47 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/request-processor.html 4 Feb 2004 16:47:33 -0000 1.25 @@ -1,17 +1,17 @@ -The Request Processor

            The Request Processor

            By Pete Su

            +The Request Processor

            The Request Processor

            By Pete Su

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

            Overview

            -This document is a brief introduction to the OpenACS 5.0.0b4 Request Processor; +This document is a brief introduction to the OpenACS Request Processor; more details can be found in the OpenACS 4 Request Processor Design. Here we cover the high level concepts behind the system, and implications and usage for the application developer.

            Request Processor

            -The 5.0.0b4 Request Processor is a global filter and set of Tcl procs that +The Request Processor is a global filter and set of Tcl procs that respond to every incoming URL reaching the server. The following diagram summarizes the stages of the request processor assuming a URL request like http://someserver.com/notes/somepage.adp. -

            +

            Stage 1: Search Site Map

            The first thing the RP does is to map the given URL to the appropriate @@ -35,7 +35,7 @@ extracts or sets up new session tokens for the user.

            Stage 3: Authorization

            Next, the Request Processor checks if the user has appropriate access -privileges to the requested part of the site. In OpenACS 5.0.0b4, access control +privileges to the requested part of the site. In OpenACS , access control is dictated by the permissions system. In this case, the RP checks if the user has "read" priviledges on the object in the site map specified by the URL. This object is typically Index: openacs-4/packages/acs-core-docs/www/requirements-template.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/requirements-template.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/requirements-template.html 11 Dec 2003 23:08:47 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/requirements-template.html 4 Feb 2004 16:47:33 -0000 1.25 @@ -1,4 +1,4 @@ -System/Application Requirements Template

            System/Application Requirements Template

            By You

            +System/Application Requirements Template

            System/Application Requirements Template

            By You

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

            Introduction

            Index: openacs-4/packages/acs-core-docs/www/rp-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/rp-design.html,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/acs-core-docs/www/rp-design.html 11 Dec 2003 23:08:47 -0000 1.18 +++ openacs-4/packages/acs-core-docs/www/rp-design.html 4 Feb 2004 16:47:33 -0000 1.19 @@ -1,11 +1,11 @@ -Request Processor Design

            Request Processor Design

            By Rafael H. Schloming

            +Request Processor Design

            Request Processor Design

            By Rafael H. Schloming

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

            Essentials

            Introduction

            The request processor is the set of procs that responds to every HTTP request made to the OpenACS. The request processor must authenticate the connecting user, and make sure that he is authorized to perform the given Index: openacs-4/packages/acs-core-docs/www/rp-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/rp-requirements.html,v diff -u -N -r1.16 -r1.17 --- openacs-4/packages/acs-core-docs/www/rp-requirements.html 11 Dec 2003 23:08:47 -0000 1.16 +++ openacs-4/packages/acs-core-docs/www/rp-requirements.html 4 Feb 2004 16:47:33 -0000 1.17 @@ -1,4 +1,4 @@ -Request Processor Requirements

            Request Processor Requirements

            By Rafael H. Schloming

            +Request Processor Requirements

            Request Processor Requirements

            By Rafael H. Schloming

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

            Introduction

            The following is a requirements document for the OpenACS 4.0 request Index: openacs-4/packages/acs-core-docs/www/security-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/security-design.html,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/acs-core-docs/www/security-design.html 11 Dec 2003 23:08:47 -0000 1.18 +++ openacs-4/packages/acs-core-docs/www/security-design.html 4 Feb 2004 16:47:33 -0000 1.19 @@ -1,4 +1,4 @@ -Security Design

            Security Design

            By Richard Li and Archit Shah

            +Security Design

            Security Design

            By Richard Li and Archit Shah

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

            Introduction

            Index: openacs-4/packages/acs-core-docs/www/security-notes.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/security-notes.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/security-notes.html 11 Dec 2003 23:08:47 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/security-notes.html 4 Feb 2004 16:47:33 -0000 1.25 @@ -1,4 +1,4 @@ -Security Notes

            Security Notes

            By Richard Li

            +Security Notes

            Security Notes

            By Richard Li

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

            Index: openacs-4/packages/acs-core-docs/www/security-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/security-requirements.html,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/acs-core-docs/www/security-requirements.html 11 Dec 2003 23:08:47 -0000 1.17 +++ openacs-4/packages/acs-core-docs/www/security-requirements.html 4 Feb 2004 16:47:33 -0000 1.18 @@ -1,4 +1,4 @@ -Security Requirements

            Security Requirements

            By Richard Li

            +Security Requirements

            Security Requirements

            By Richard Li

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

            Introduction

            Index: openacs-4/packages/acs-core-docs/www/style-guide.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/style-guide.html,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-core-docs/www/style-guide.html 11 Dec 2003 23:08:47 -0000 1.3 +++ openacs-4/packages/acs-core-docs/www/style-guide.html 4 Feb 2004 16:47:33 -0000 1.4 @@ -1,4 +1,4 @@ -OpenACS Style Guide

            OpenACS Style Guide

            +OpenACS Style Guide

            OpenACS Style Guide

            By Jeff Davis

            Motivation

            Why have coding standards for OpenACS? And if the code works why change it to Index: openacs-4/packages/acs-core-docs/www/subsites-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/subsites-design.html,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/acs-core-docs/www/subsites-design.html 11 Dec 2003 23:08:47 -0000 1.18 +++ openacs-4/packages/acs-core-docs/www/subsites-design.html 4 Feb 2004 16:47:33 -0000 1.19 @@ -1,4 +1,4 @@ -Subsites Design Document

            Subsites Design Document

            By Rafael H. Schloming

            +Subsites Design Document

            Subsites Design Document

            By Rafael H. Schloming

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

            *Note* This document has not gone through the any of the Index: openacs-4/packages/acs-core-docs/www/subsites-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/subsites-requirements.html,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/acs-core-docs/www/subsites-requirements.html 11 Dec 2003 23:08:47 -0000 1.17 +++ openacs-4/packages/acs-core-docs/www/subsites-requirements.html 4 Feb 2004 16:47:33 -0000 1.18 @@ -1,4 +1,4 @@ -Subsites Requirements

            Subsites Requirements

            By Rafael H. Schloming and Dennis Gregorovic

            +Subsites Requirements

            Subsites Requirements

            By Rafael H. Schloming and Dennis Gregorovic

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

            Introduction

            The following is a requirements document for OpenACS 4 Subsites, part of the Index: openacs-4/packages/acs-core-docs/www/subsites.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/subsites.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/subsites.html 11 Dec 2003 23:08:47 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/subsites.html 4 Feb 2004 16:47:33 -0000 1.25 @@ -1,4 +1,4 @@ -Writing OpenACS Application Pages

            Writing OpenACS Application Pages

            By Rafael H. Schloming and Pete Su

            +Writing OpenACS Application Pages

            Writing OpenACS Application Pages

            By Rafael H. Schloming and Pete Su

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

            Overview

            @@ -253,15 +253,15 @@ visible to that user. The end result is a site where users can come and write notes to themselves.

            -This is a good example of the leverage available in the OpenACS 5.0.0b4 +This is a good example of the leverage available in the OpenACS system. The code that we have written for Notes is not at all more complex than a similar application without access control or site map awareness. By adding a small amount of code, we have taken a small, simple, and special purpose application to something that has the potential to be a very useful, general-purpose tool, complete with multi-user features, access control, and centralized administration.

            Summary

            -In OpenACS 5.0.0b4, application pages and scripts can be aware of the package +In OpenACS , application pages and scripts can be aware of the package instance, or subsite in which they are executing. This is a powerful general purpose mechanism that can be used to structure web services in very flexible ways. Index: openacs-4/packages/acs-core-docs/www/tcl-doc.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tcl-doc.html,v diff -u -N -r1.25 -r1.26 --- openacs-4/packages/acs-core-docs/www/tcl-doc.html 11 Dec 2003 23:08:47 -0000 1.25 +++ openacs-4/packages/acs-core-docs/www/tcl-doc.html 4 Feb 2004 16:47:33 -0000 1.26 @@ -1,4 +1,4 @@ -Documenting Tcl Files: Page Contracts and Libraries

            Documenting Tcl Files: Page Contracts and Libraries

            By Jon Salz on 3 July 2000

            +Documenting Tcl Files: Page Contracts and Libraries

            Documenting Tcl Files: Page Contracts and Libraries

            By Jon Salz on 3 July 2000

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.
            • Tcl procedures: /packages/acs-kernel/tcl-documentation-procs.tcl

            The Big Picture

            In versions of the OpenACS prior to 3.4, the standard Index: openacs-4/packages/acs-core-docs/www/templates.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/templates.html,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-core-docs/www/templates.html 11 Dec 2003 23:08:47 -0000 1.24 +++ openacs-4/packages/acs-core-docs/www/templates.html 4 Feb 2004 16:47:33 -0000 1.25 @@ -1,4 +1,4 @@ -Using Templates in OpenACS

            Using Templates in OpenACS

            By Pete Su

            +Using Templates in OpenACS

            Using Templates in OpenACS

            By Pete Su

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

            Overview

            Index: openacs-4/packages/acs-core-docs/www/tutorial-advanced.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-advanced.html,v diff -u -N -r1.16 -r1.17 --- openacs-4/packages/acs-core-docs/www/tutorial-advanced.html 11 Dec 2003 23:08:47 -0000 1.16 +++ openacs-4/packages/acs-core-docs/www/tutorial-advanced.html 4 Feb 2004 16:47:33 -0000 1.17 @@ -1,32 +1,27 @@ -Advanced Topics

            Advanced Topics

            Important

            This section is a work in progress.

            by Joel Aufrecht

            +Advanced Topics

            Advanced Topics

            by Joel Aufrecht

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

            Overview

            This tutorial covers topics which are not essential to +

            This tutorial covers topics which are not essential to creating a minimal working package. Each section can be used independently of all of the others; all sections assume that - you've completed the basic tutorial.

            • How to enforce security so that users can't - change other users records

            • How to use the content management tables so that - ... what?

            • How to change the default stylesheets for Form - Builder HTML forms.

            • How to make your package searchable with OpenFTS/Oracle

            • How to make your package send email notifications

            • How to prepare pagelets for inclusion in other pages

            • How and when to put procedures in a tcl procedure library

            • How to add general_comments to your pages

            • More on ad_form - data validation, other stuff. - (plan to draw from Jon Griffin's doc)

            • How and when to implement caching

            • partialquery in xql

            • How to use the html/text entry widget to get the - "does this look right" confirm page

            • APM package dependencies

            Write the Requirements and Design Specs

            It's time to document. For the tutorial we'll use + you've completed the basic tutorial.

            Write the Requirements and Design Specs

            It's time to document. For the tutorial we'll use pre-written documentation. When creating a package from scratch, start by copying the documentation template from /var/lib/aolserver/openacs-dev/packages/acs-core-docs/xml/docs/xml/package-documentation-template.xml to - yourpackage/www/docs/xml/index.xml.

            You then edit that file with emacs to write the + myfirstpackage/www/docs/xml/index.xml.

            You then edit that file with emacs to write the requirements and design sections, generate the html, and start coding. Store any supporting files, like page maps or schema diagrams, in the www/doc/xml directory, and store png or jpg versions of supporting files in the www/doc directory.

            For this tutorial, you should instead install the pre-written documentation files for the tutorial app. Log in as service0, create the standard - directories, and copy the prepared documentation:

            [service0@yourserver service0]$ cd /var/lib/aolserver/service0/packages/samplenote/
            -[service0@yourserver samplenote]$ mkdir -p www/doc/xml
            -[service0@yourserver samplenote]$ cd www/doc/xml
            -[service0@yourserver xml]$ cp /var/lib/aolserver/service0/packages/acs-core-docs/www/files/samplenote/* .
            -[service0@yourserver xml]$

            OpenACS uses DocBook for documentation. DocBook is + directories, and copy the prepared documentation:

            [service0 service0]$ cd /var/lib/aolserver/service0/packages/myfirstpackage/
            +[service0 myfirstpackage]$ mkdir -p www/doc/xml
            +[service0 myfirstpackage]$ cd www/doc/xml
            +[service0 xml]$ cp /var/lib/aolserver/service0/packages/acs-core-docs/www/files/myfirstpackage/* .
            +[service0 xml]$

            OpenACS uses DocBook for documentation. DocBook is an XML standard for semantic markup of documentation. That means that the tags you use indicate meaning, not intended appearance. The style sheet will determine appearance. You @@ -42,7 +37,7 @@ is stored in the www/docs/ directory. A Makefile is provided to generate html from the xml, and copy all of the supporting files. If Docbook is set up correctly, all you need - to do is:

            [service0@yourserver xml]$ make
            +      to do is:

            [service0 xml]$ make
             cd .. ; /usr/bin/xsltproc ../../../acs-core-docs/www/xml/openacs.xsl xml/index.xml
             Writing requirements-introduction.html for sect1(requirements-introduction)
             Writing requirements-overview.html for sect1(requirements-overview)
            @@ -58,25 +53,25 @@
             Writing admin-guide.html for chapter(admin-guide)
             Writing bi01.html for bibliography
             Writing index.html for book
            -[service0@yourserver xml]$

            Verify that the documentation was generated and reflects - your changes by browsing to http://yoursite:8000/samplenote/doc

            Add the new package to CVS

            Before you do any more work, make sure that your work is +[service0 xml]$

            Verify that the documentation was generated and reflects + your changes by browsing to http://yoursite:8000/myfirstpackage/doc

            Add the new package to CVS

            Before you do any more work, make sure that your work is protected by putting it all into cvs. The cvs add command is not recursive, so you'll have to traverse the directory tree manually and add as you go. (More on - CVS)

            [service0@yourserver xml]$ cd ..
            -[service0@yourserver doc]$ cd ..
            -[service0@yourserver www]$ cd ..
            -[service0@yourserver samplenote]$ cd ..
            -[service0@yourserver packages]$ cvs add samplenote/
            -Directory /cvsroot/service0/packages/samplenote added to the repository
            -[service0@yourserver packages]$ cd samplenote/
            -[service0@yourserver samplenote]$ cvs add www
            -Directory /cvsroot/service0/packages/samplenote/www added to the repository
            -[service0@yourserver samplenote]$ cd www
            -[service0@yourserver www]$ cvs add doc
            -Directory /cvsroot/service0/packages/samplenote/www/doc added to the repository
            -[service0@yourserver www]$ cd doc
            -[service0@yourserver doc]$ cvs add *
            +      CVS)

            [service0 xml]$ cd ..
            +[service0 doc]$ cd ..
            +[service0 www]$ cd ..
            +[service0 myfirstpackage]$ cd ..
            +[service0 packages]$ cvs add myfirstpackage/
            +Directory /cvsroot/service0/packages/myfirstpackage added to the repository
            +[service0 packages]$ cd myfirstpackage/
            +[service0 myfirstpackage]$ cvs add www
            +Directory /cvsroot/service0/packages/myfirstpackage/www added to the repository
            +[service0 myfirstpackage]$ cd www
            +[service0 www]$ cvs add doc
            +Directory /cvsroot/service0/packages/myfirstpackage/www/doc added to the repository
            +[service0 www]$ cd doc
            +[service0 doc]$ cvs add *
             cvs add: cannot add special file `CVS'; skipping
             cvs add: scheduling file `admin-guide.html' for addition
             cvs add: scheduling file `bi01.html' for addition
            @@ -99,54 +94,227 @@
             cvs add: scheduling file `user-guide.html' for addition
             cvs add: scheduling file `user-interface.dia' for addition
             cvs add: scheduling file `user-interface.png' for addition
            -Directory /cvsroot/service0/packages/samplenote/www/doc/xml added to the repository
            +Directory /cvsroot/service0/packages/myfirstpackage/www/doc/xml added to the repository
             cvs add: use 'cvs commit' to add these files permanently
            -[service0@yourserver doc]$ cd xml
            -[service0@yourserver xml]$ cvs add Makefile index.xml
            +[service0 doc]$ cd xml
            +[service0 xml]$ cvs add Makefile index.xml
             cvs add: scheduling file `Makefile' for addition
             cvs add: scheduling file `index.xml' for addition
             cvs add: use 'cvs commit' to add these files permanently
            -[service0@yourserver xml]$ cd ../../..
            -[service0@yourserver samplenote]$ cvs commit -m "new package"
            +[service0 xml]$ cd ../../..
            +[service0 myfirstpackage]$ cvs commit -m "new package"
             cvs commit: Examining .
             cvs commit: Examining www
             cvs commit: Examining www/doc
             cvs commit: Examining www/doc/xml
            -RCS file: /cvsroot/service0/packages/samplenote/www/doc/admin-guide.html,v
            +RCS file: /cvsroot/service0/packages/myfirstpackage/www/doc/admin-guide.html,v
             done
             Checking in www/doc/admin-guide.html;
            -/cvsroot/service0/packages/samplenote/www/doc/admin-guide.html,v  <--  admin-guide.html
            +/cvsroot/service0/packages/myfirstpackage/www/doc/admin-guide.html,v  <--  admin-guide.html
             initial revision: 1.1
             done
             (many lines omitted)
            -[service0@yourserver samplenote]$

            Delete with confirmation

            We need a way to delete records. We'll create a - recursive confirmation page.

            Add this column to the table_def in index.tcl

            {delete "" {} {<td><a href="note-delete?note_id=$note_id">Delete</a></td>}}

            Create the delete confirmation/execution page.

            [service0@yourserver www]$ emacs note-delete.tcl
            ad_page_contract {
            -    A page that gets confirmation and then delete notes.
            +[service0 myfirstpackage]$

            Adding Comments

            You can track comments for any ACS Object. Here we'll track + comments for notes. On the note-edit.tcl/adp pair, which is used to + display individual notes, we want to put a link to add comments at + the bottom of the screen. If there are any comments, we want to + show them.

            First, we need to generate a url for adding comments. In note-edit.tcl:

            + set comment_add_url "[general_comments_package_url]comment-add?[export_vars {
            +  { object_id $note_id } 
            +  { object_name $title } 
            +  { return_url "[ad_conn url]?[ad_conn query]"} 
            + }]"
            + 

            This calls a global, public tcl function that the + general_comments package registered, to get its url. You then + embed in that url the id of the note and its title, and set the + return_url to the current url so that the user can return after + adding a comment.

            We need to create html that shows any existing comments. + We do this with another general_comments function:

            set comments_html [general_comments_get_comments
            +     -print_content_p 1 $note_id]

            First, we pass in an optional parameter that that says to actually + show the contents of the comments, instead of just the fact that + there are comments. Then you pass the note id, which is also the + acs_object id.

            We put our two new variables in the note-edit.adp + page.

            <a href="@comment_add_url@">Add a comment</a>
            + @comments_html@

            Admin Pages

            + There are at least two flavors of admin user interface: +

            • Admins use same pages as all other users, except + that they are offered admin links and buttons where appropriate. + For example, if admins have privilege to bulk-delete items you + could provide checkboxes next to every item seen on a list and the + Delete Selected button on the bottom of the list. +

            • Dedicated admin pages. If you want admins to have + access to data that users aren't interested in or aren't allowed + to see you will need dedicated admin pages. The conventional + place to put those dedicated admin pages is in the + /var/lib/aolserver/service0/packages/myfirstpackage/www/admin + directory. +

              [service0 www]$ mkdir admin
              [service0 www]$ cd admin

              + Even if your application doesn't need any admin pages of its own you will + usually need at least one simple page with a bunch of links to existing + administration UI such as Category Management or standard Parameters UI. + Adding the link to Category Management is described in the section on + categories. The listing below adds a link to the Parameters UI of our + package. +

              [service0 admin]$ vi index.adp
              +<master>
              +<property name="title">@title;noquote@</property>
              +<property name="context">@context;noquote@</property>
               
              -    @author joel@aufrecht.org
              -    @creation-date 2003-02-12
              -    @cvs-id $Id$
              -} {
              -    note_id:integer
              -    confirm_p:optional
              +<ul class="action-links">
              +  <li><a href="@parameters_url@" title="Set parameters" class="action_link">Set parameters</a></li>
              +</ul>
              +
              [service0 admin]$ vi index.tcl
              +ad_page_contract {} {
              +} -properties {
              +    context_bar
               }
               
              -set title "Delete Note"
              +set package_id [ad_conn package_id]
               
              -if {![exists_and_not_null confirm_p]} {
              -    # first pass, not confirmed.  Display a form for confirmation
              -    set note_name [db_string get_name { *SQL }]
              -    set title "Delete $note_name"
              -    template::form::create note-del-confirm
              -    template::element::create note-del-confirm note_id -value $note_id -widget hidden
              -    template::element::create note-del-confirm confirm_p -value 1 -widget hidden
              -    template::element::create note-del-confirm submit \
              -      -label "Confirm deletion of $note_name" \
              -      -widget submit
              -} else {
              -    # second pass, confirmed.  Call the database to delete the record
              -    db_1row do_delete { *SQL* }
              -    ad_returnredirect "index"
              +set admin_p [ad_require_permission $package_id admin]
              +
              +set context [list]
              +
              +set title "Administration"
              +
              +set parameters_url [export_vars -base "/shared/parameters" {
              +  package_id { return_url [ad_return_url] }
              +}]
              +
              +

              +Now that you have the first admin page it would be nice to have a link to it +somewhere in the system so that admins don't have to type in the +/admin every time they need to reach it. You +could put a static link to the toplevel +index.adp but that might be distracting for +people who are not admins. Besides, some people consider it impolite to first +offer a link and then display a nasty "You don't have permission to access this +page" message. +

              +In order to display the link to the admin page only to users that have admin +privileges add the following code near the top of +/var/lib/aolserver/service0/packages/myfirstpackage/www/admin/index.tcl: +

              +
              +set package_id [ad_conn package_id]
              +
              +set admin_p [permission::permission_p -object_id $package_id \
              +  -privilege admin -party_id [ad_conn untrusted_user_id]]
              +
              +if { $admin_p } {
              +    set admin_url "admin"
              +    set admin_title Administration
              +}
              +

              +In +/var/lib/aolserver/service0/packages/myfirstpackage/www/admin/index.adp put: +

              +<if @admin_p@ ne nil>
              +  <a href="@admin_url@">@admin_title@</a>
              +</if>
              +

            Categories

            You can associate any ACS Object with one or more categories. + In this tutorial we'll show how to equip your application with user + interface to take advantage of the Categories service. +

            + We'll start by installing the Categories service. Go to + /acs/admin and install it. This step + won't be necessary for the users of your applications because you'll create + a dependency with the Package Manager which will take care that the + Categories service always gets installed when your application gets + installed. +

            + Now that we have installed the Categories service we can proceed to + modifying our application so that it can take advantage of it. We'll do it + in three steps: +

            1. + The Categories service provides a mechanism to associate one or + more category trees that are relevant to + your application. One example of such tree is a tree of + geographical locations. Continents are on the top of such tree, + each continent containing countries etc. Another tree might + contain market segments etc. Before users of your application + can take advantage of the Categories service there needs to be a + way for administrators of your application to choose which + category trees are applicable for the application. +

              + The way to achieve this is is to provide a link + to the Category Management pages. Add the following snippet to your + /var/lib/aolserver/service0/packages/myfirstpackage/www/admin/index.tcl + file: +

              +set category_map_url [export_vars -base \
              +    "[site_node::get_package_url -package_key categories]cadmin/one-object" \
              +        { { object_id $package_id } }]
              +          

              + and the following snippet to your + /var/lib/aolserver/service0/packages/myfirstpackage/www/admin/index.adp + file: +

              +<li><a href="@category_map_url@"
              +      class="action_link">Site-Wide Categories</a>
              +          

              The link created by the above code will take the admin to the generic + admin UI where he can pick category trees that make sense for this + application. The same UI also includes facilities to build and edit + category trees. Notice that the only parameter in this example is + package_id so that category trees + will be associated with the object identified by this + package_id. The categorization + service is actually more general than that: instead of + package_id you could use an ID of + some other object that serves as a "container" in your application. + For example, if your discussion forums application supports multiple + forums you would use forum_id to + associate category trees with just that one forum rather than the + entire application instance. +

            2. + Once the category trees have been selected users need a way + to categorize items. The easiest way to do this is by adding the + category widget type of the + form builder to note-edit.tcl. + To achieve this we'll need to use the -extend + switch to the ad_form command. Here's the "meat" of the + note-edit.tcl page:

              +ad_form -name note -form {
              +    {item_id:key}
              +    {title:text {label Title}}
              +}
              +
              +set package_id [ad_conn package_id]
              +
              +set category_trees [category_tree::get_mapped_trees $package_id]
              +
              +foreach tree $category_trees {
              +    foreach { tree_id name subtree_id } $tree {}
              +    ad_form -extend -name note -form \
              +        [list [list category_id_${tree_id}:integer(category),optional \
              +                   {label $name} \
              +                   {html {single single}} \
              +                   {category_tree_id $tree_id} \
              +                   {category_subtree_id $subtree_id} \
              +                   {category_object_id {[value_if_exists entry_id]}}]]
              +}
              +
              +ad_form -extend \
              +  -name note \
              +  -new_request {
              +    permission::require_permission -object_id [ad_conn package_id] -privilege create
              +    set page_title "Add a Note"
              +    set context [list $page_title]
              +} -edit_request {
              +    permission::require_write_permission -object_id $item_id
              +    mfp::note::get \
              +    -item_id $item_id \
              +    -array note_array
              +
              +    set title $note_array(title)
              +
              +    set page_title "Edit a Note"
              +    set context [list $page_title]
              +} -new_data {
              +    mfp::note::add \
              +    -title $title
              +} -after_submit {
              +    ad_returnredirect "."
                   ad_script_abort
               }

              This page requires a note_id to determine which record @@ -179,7 +347,9 @@ <formtemplate id="note-del-confirm"></formtemplate> </form>

              The ADP is very simple. The formtemplate tag outputs the HTML -form generated by the ad_form command with the matching name. Test it by adding the new files in the APM and then deleting a few samplenotes.

            General_comments

            You can track comments for any ACS Object. Here we'll track +form generated by the ad_form command with the matching name. Test it + by adding the new files in the APM and then deleting a few + samplenotes.

            General comments

            You can track comments for any ACS Object. Here we'll track comments for notes. On the notes.tcl/adp pair, which is used to display individual notes, we want to put a link to add comments at the bottom of the screen. If there are any comments, we want to @@ -200,13 +370,308 @@ there are comments. Then you pass the note id, which is also the acs_object id.

            We put our two new variables in the notes.adp page.

            <a href="@comment_add_url@">Add a comment</a>
            -@comments_html@

            Prepare the package for distribution.

            Browse to the package manager. Click on +@comments_html@

            Admin Pages

            + There are at least two flavors of admin user interface: +

            • Admins use same pages as all other users, except + that they are offered admin links and buttons where appropriate. + For example, if admins have privilege to bulk-delete items you + could provide checkboxes next to every item seen on a list and the + Delete Selected button on the bottom of the list. +

            • Dedicated admin pages. If you want admins to have + access to data that users aren't interested in or aren't allowed + to see you will need dedicated admin pages. The conventional + place to put those dedicated admin pages is in the +/var/lib/aolserver/service0/packages/myfirstpackage/www/admin +directory. +

              [service0@yourserver www]$ mkdir admin
              [service0@yourserver www]$ cd admin

              + Even if your application doesn't need any admin pages of its own you will + usually need at least one simple page with a bunch of links to existing + administration UI such as Category Management or standard Parameters UI. + Adding the link to Category Management is described in the section on + categories. The listing below adds a link to the Parameters UI of our + package. +

              [service0@yourserver admin]$ vi index.adp
              +<master>
              +<property name="title">@title;noquote@</property>
              +<property name="context">@context;noquote@</property>
              +
              +<ul class="action-links">
              +  <li><a href="@parameters_url@" title="Set parameters" class="action_link">Set parameters</a></li>
              +</ul>
              +
              [service0@yourserver admin]$ vi index.tcl
              +ad_page_contract {} {
              +} -properties {
              +    context_bar
              +}
              +
              +set package_id [ad_conn package_id]
              +
              +set admin_p [ad_require_permission $package_id admin]
              +
              +set context [list]
              +
              +set title "Administration"
              +
              +set parameters_url [export_vars -base "/shared/parameters" {
              +  package_id { return_url [ad_return_url] }
              +}]
              +
              +

              +Now that you have the first admin page it would be nice to have a link to it +somewhere in the system so that admins don't have to type in the +/admin every time they need to reach it. You +could put a static link to the toplevel +index.adp but that might be distracting for +people who are not admins. Besides, some people consider it impolite to first +offer a link and then display a nasty "You don't have permission to access this +page" message. +

              +In order to display the link to the admin page only to users that have admin +privileges add the following code near the top of +/var/lib/aolserver/service0/packages/myfirstpackage/www/admin/index.tcl: +

              +
              +set package_id [ad_conn package_id]
              +
              +set admin_p [permission::permission_p -object_id $package_id \
              +  -privilege admin -party_id [ad_conn untrusted_user_id]]
              +
              +if { $admin_p } {
              +    set admin_url "admin"
              +    set admin_title Administration
              +}
              +

              +In +/var/lib/aolserver/service0/packages/myfirstpackage/www/admin/index.adp put: +

              +<if @admin_p@ ne nil>
              +  <a href="@admin_url@">@admin_title@</a>
              +</if>
              +

            Categories

            You can associate any ACS Object with one or more categories. + In this tutorial we'll show how to equip your application with user + interface to take advantage of the Categories service. +

            + We'll start by installing the Categories service. Go to + /acs/admin and install it. This step + won't be necessary for the users of your applications because you'll create + a dependency with the Package Manager which will take care that the + Categories service always gets installed when your application gets + installed. +

            + Now that we have installed the Categories service we can proceed to + modifying our application so that it can take advantage of it. We'll do it + in three steps: +

            1. + The Categories service provides a mechanism to associate one or + more category trees that are relevant to + your application. One example of such tree is a tree of + geographical locations. Continents are on the top of such tree, + each continent containing countries etc. Another tree might + contain market segments etc. Before users of your application + can take advantage of the Categories service there needs to be a + way for administrators of your application to choose which + category trees are applicable for the application.

              + The way to achieve this is is to provide a link + to the Category Management pages. Add the following snippet to your + /var/lib/aolserver/service0/packages/myfirstpackage/www/admin/index.tcl + file: +

              +set category_map_url [export_vars -base \
              +    "[site_node::get_package_url -package_key categories]cadmin/one-object" \
              +        { { object_id $package_id } }]
              +          

              + and the following snippet to your + /var/lib/aolserver/service0/packages/myfirstpackage/www/admin/index.adp + file: +

              +<li><a href="@category_map_url@"
              +      class="action_link">Site-Wide Categories</a>
              +          

              The link created by the above code will take the admin to the generic + admin UI where he can pick category trees that make sense for this + application. The same UI also includes facilities to build and edit + category trees. Notice that the only parameter in this example is + package_id so that category trees + will be associated with the object identified by this + package_id. The categorization + service is actually more general than that: instead of + package_id you could use an ID of + some other object that serves as a "container" in your application. + For example, if your discussion forums application supports multiple + forums you would use forum_id to + associate category trees with just that one forum rather than the + entire application instance. +

            2. + Once the category trees have been selected users need a way + to categorize items. The easiest way to do this is by adding the + category widget type of the + form builder to note-edit.tcl. + To achieve this we'll need to use the -extend + switch to the ad_form command. Here's the "meat" of the + note-edit.tcl page: +

              +ad_form -name note -form {
              +    {item_id:key}
              +    {title:text {label Title}}
              +}
              +
              +set package_id [ad_conn package_id]
              +
              +set category_trees [category_tree::get_mapped_trees $package_id]
              +
              +foreach tree $category_trees {
              +    foreach { tree_id name subtree_id } $tree {}
              +    ad_form -extend -name note -form \
              +        [list [list category_id_${tree_id}:integer(category),optional \
              +                   {label $name} \
              +                   {html {single single}} \
              +                   {category_tree_id $tree_id} \
              +                   {category_subtree_id $subtree_id} \
              +                   {category_object_id {[value_if_exists entry_id]}}]]
              +}
              +
              +ad_form -extend \
              +  -name note \
              +  -new_request {
              +    permission::require_permission -object_id [ad_conn package_id] -privilege create
              +    set page_title "Add a Note"
              +    set context [list $page_title]
              +} -edit_request {
              +    permission::require_write_permission -object_id $item_id
              +    mfp::note::get \
              +    -item_id $item_id \
              +    -array note_array
              +
              +    set title $note_array(title)
              +
              +    set page_title "Edit a Note"
              +    set context [list $page_title]
              +} -new_data {
              +    mfp::note::add \
              +    -title $title
              +} -after_submit {
              +    ad_returnredirect "."
              +    ad_script_abort
              +}
              +          

              +

            Prepare the package for distribution.

            Browse to the package manager. Click on tutorialapp.

            Click on Generate a distribution file for this package from the filesystem.

            Click on the file size (37.1KB) after the label Distribution File: and save the file to - /tmp.

            -

            View comments on this page at openacs.org
            + /tmp.

            +

            Notifications

            by David Bell and Simon Carstensen

            + OpenACS docs are written by the named authors, and may be edited + by OpenACS documentation staff. +

            The notifications package allows you to send notifications through any + defined communications medium (e.g. email, sms) upon some event occuring within + the system.

            This tutorial steps through the process of integrating the notifications + package with your package.

            First step is to create the notification types. To do this a script similar + to the one below needs to be loaded into Postgresql. I create this script in a + package-name/sql/postgresql/package-name-notifications-init.sql file. I then load + this file from my create sql file. The following code snippet is taken from + Weblogger. It creates a lars_blogger_notif notification type (which was created + above).

            +    create function inline_0() returns integer as '
            +    declare
            +            impl_id integer;
            +            v_foo   integer;
            +    begin
            +        -- the notification type impl
            +        impl_id := acs_sc_impl__new (
            +                      ''NotificationType'',
            +                      ''lars_blogger_notif_type'',
            +                      ''lars-blogger''
            +        );
            +
            +        v_foo := acs_sc_impl_alias__new (
            +                    ''NotificationType'',
            +                    ''lars_blogger_notif_type'',
            +                    ''GetURL'',
            +                    ''lars_blogger::notification::get_url'',
            +                    ''TCL''
            +        );
            +
            +        v_foo := acs_sc_impl_alias__new (
            +                    ''NotificationType'',
            +                    ''lars_blogger_notif_type'',
            +                    ''ProcessReply'',
            +                    ''lars_blogger::notification::process_reply'',
            +                    ''TCL''
            +        );
            +
            +        PERFORM acs_sc_binding__new (
            +                    ''NotificationType'',
            +                    ''lars_blogger_notif_type''
            +        );
            +
            +        v_foo:= notification_type__new (
            +	        NULL,
            +                impl_id,
            +                ''lars_blogger_notif'',
            +                ''Blog Notification'',
            +                ''Notifications for Blog'',
            +		now(),
            +                NULL,
            +                NULL,
            +		NULL
            +        );
            +
            +        -- enable the various intervals and delivery methods
            +        insert into notification_types_intervals
            +        (type_id, interval_id)
            +        select v_foo, interval_id
            +        from notification_intervals where name in (''instant'',''hourly'',''daily'');
            +
            +        insert into notification_types_del_methods
            +        (type_id, delivery_method_id)
            +        select v_foo, delivery_method_id
            +        from notification_delivery_methods where short_name in (''email'');
            +
            +        return (0);
            +    end;
            +    ' language 'plpgsql';
            +
            +    select inline_0();
            +    drop function inline_0();
            +    

            The next step is to setup our notification creation. A new notification must + be added to the notification table for each blog entry added. We do this using the + notification::new procedure

            +        notification::new \
            +            -type_id [notification::type::get_type_id \
            +            -short_name lars_blogger_notif] \
            +            -object_id $blog(package_id) \
            +            -response_id $blog(entry_id) \
            +            -notif_subject $blog(title) \
            +            -notif_text $new_content
            +    

            This code is placed in the tcl procedure that creates blog entries, right after + the entry gets created in the code. The $blog(package_id) + is the OpenACS object_id of the Weblogger instance to which the entry has been posted to + and the $new_content is the content of the entry.

            The final step is to setup the notification subscription process. In this + example we want to let a user find out when a new entry has been posted to the blog. To + do this we put a link on the blog that allows them to subscribe to notifications of new + entries. The notifications/requests-new page is very handy in this situation.

            Such a link can be created using the notification::display::request_widget + proc:

            +    set notification_chunk [notification::display::request_widget \
            +        -type lars_blogger_notif \
            +        -object_id $package_id \
            +        -pretty_name [lars_blog_name] \
            +        -url [lars_blog_public_package_url] \
            +    ]
            +    

            which will return something like + +

            +    You may <a href="/notifications/request-new?...">request notification</a> for Weblogger.

            + + which can be readily put on the blog index page. The pretty_name + parameter is what appears at the end of the text returned (i.e. "... request notification</a> for pretty_name"), + The url parameter should be set to the address we want the user + to be redirected to after they have finished the subscription process.

            This should be all you need to implement a notification system. For more examples + look at the forums package.

            Future Topics:

            • How to enforce security so that users can't + change other users records

            • How to use the content management tables so that + ... what?

            • How to change the default stylesheets for Form + Builder HTML forms.

            • How to make your package searchable with OpenFTS/Oracle

            • How to prepare pagelets for inclusion in other pages

            • How and when to put procedures in a tcl procedure library

            • More on ad_form - data validation, other stuff. + (plan to draw from Jon Griffin's doc)

            • How and when to implement caching

            • partialquery in xql

            • How to use the html/text entry widget to get the + "does this look right" confirm page

            • APM package dependencies

            See also the OpenACS Programming FAQ

            View comments on this page at openacs.org
            Index: openacs-4/packages/acs-core-docs/www/tutorial-database.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-database.html,v diff -u -N -r1.16 -r1.17 --- openacs-4/packages/acs-core-docs/www/tutorial-database.html 11 Dec 2003 23:08:47 -0000 1.16 +++ openacs-4/packages/acs-core-docs/www/tutorial-database.html 4 Feb 2004 16:47:33 -0000 1.17 @@ -1,7 +1,7 @@ -Setting Up Database Objects

            Setting Up Database Objects

            by Joel Aufrecht

            +Setting Up Database Objects

            Setting Up Database Objects

            by Joel Aufrecht

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

            Code the data model

            We create all database objects with scripts in the +

            Code the data model

            We create all database objects with scripts in the myfirstpackage/sql/ directory. All database scripts are database-specific and are thus in either the myfirstpackage/sql/oracle or @@ -31,15 +31,17 @@ repository functions to simplify our database creation. (More information about ACS Objects. More information about the Content Repository.) -

            The top of each sql file has some +

            Figure�7.2.�Tutorial Data Model

            Tutorial Data Model

            The top of each sql file has some standard comments, including doc tags such as @author which will be picked up by the API browser. The string $Id$ will automatically be - expanded when the file is checked in to cvs.

            [service0@yourserver postgresql]$ emacs myfirstpackage-create.sql

            Paste this into the file and save and close.

            Figure�7.2.�Database Creation Script - master create file

            --
            --- @author rhs@mit.edu
            --- @cvs-id $Id$
            +      expanded when the file is checked in to cvs.

            [service0 ~]$ cd /var/lib/aolserver/service0/packages/myfirstpackage/sql/postgresql
            +[service0 postgresql]$ emacs myfirstpackage-create.sql

            Paste this into the file and save and close.

            Figure�7.3.�Database Creation Script - master create file

            -- creation script
             --
            +-- @author joel@aufrecht.org
            +-- @cvs-id &Id:$
            +--
             
             select content_type__create_type(
                 'mfp_note',                    -- content_type
            @@ -53,18 +55,17 @@
             
             -- necessary to work around limitation of content repository:
             select content_folder__register_content_type(-100,'mfp_note','t');
            -
             

            The creation script calls a function, - content_type__create_type, which + content_type__create_type, which in turn creates the necessary database changes to support our data object. Notice the use of "mfp." This token, derived from "My First Package," ensures that our object is unlikely to conflict with objects from other packages.

            Create a database file to drop everything if the package - is uninstalled.

            [service0@yourserver postgresql]$ emacs myfirstpackage-drop.sql

            Figure�7.3.�Database deletion script

            -- packages/myfirstpackage/sql/myfirstpackage-drop.sql
            --- drop script
            +        is uninstalled.

            +[service0 postgresql]$ emacs myfirstpackage-drop.sql

            Figure�7.4.�Database deletion script

            -- drop script
             --
             -- @author joel@aufrecht.org
            --- @cvs-id $Id$
            +-- @cvs-id &Id:$
             --
             select content_folder__unregister_content_type(-100,'mfp_note','t');
             
            @@ -73,18 +74,28 @@
             	   't',
             	   't'
                 );
            -

            Run the create script manually to add your tables and functions.

            [service0@yourserver postgresql]$ psql -f myfirstpackage-create.sql
            -psql:myfirstpackage-create.sql:14: NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 'mfp_notes_pkey' for table 'mfp_notes'
            -psql:myfirstpackage-create.sql:14: NOTICE:  CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
            +

            Run the create script manually to add your tables and functions.

            [service0 postgresql]$ psql -f myfirstpackage-create.sql
            +psql:myfirstpackage-create.sql:15: NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 'mfp_notes_pkey' for table 'mfp_notes'
            +psql:myfirstpackage-create.sql:15: NOTICE:  CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
              content_type__create_type
             ---------------------------
                                      0
             (1 row)
             
            -[service0@yourserver postgresql]$

            If there are errors, use them to debug the sql file and try again. If there are errors in the database table creation, you may need to run the drop script to drop the table so that you can recreate it. The drop script will probably have errors since some of the things it's trying to drop may be missing. They can be ignored.

            Once you get the same output as shown above, test the drop script:

            [service0@yourserver postgresql]$ psql -f myfirstpackage-drop.sql
            + content_folder__register_content_type
            +---------------------------------------
            +                                     0
            +(1 row)
            +
            +[service0 postgresql]$

            If there are errors, use them to debug the sql file and try again. If there are errors in the database table creation, you may need to run the drop script to drop the table so that you can recreate it. The drop script will probably have errors since some of the things it's trying to drop may be missing. They can be ignored.

            Once you get the same output as shown above, test the drop script:

            [service0 postgresql]$ psql -f myfirstpackage-drop.sql
            + content_folder__unregister_content_type
            +-----------------------------------------
            +                                       0
            +(1 row)
            +
              content_type__drop_type
             -------------------------
                                    0
             (1 row)
             
            -[service0@yourserver postgresql]$

            Once both scripts are working without errors, run the create script one last time and proceed.

            View comments on this page at openacs.org
            +[service0 postgresql]$

            Once both scripts are working without errors, run the create script one last time and proceed.

            [service0 postgresql]$ psql -f myfirstpackage-create.sql
            View comments on this page at openacs.org
            Index: openacs-4/packages/acs-core-docs/www/tutorial-debug.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-debug.html,v diff -u -N -r1.16 -r1.17 --- openacs-4/packages/acs-core-docs/www/tutorial-debug.html 11 Dec 2003 23:08:47 -0000 1.16 +++ openacs-4/packages/acs-core-docs/www/tutorial-debug.html 4 Feb 2004 16:47:33 -0000 1.17 @@ -1,64 +1,48 @@ -Debugging and Automated Testing

            Debugging and Automated Testing

            Important

            This section is a work in progress.

            by Joel Aufrecht

            +Debugging and Automated Testing

            Debugging and Automated Testing

            by Joel Aufrecht

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

            Debugging

            Developer Support.�The Developer Support package adds several goodies: debug +

            Debugging

            Developer Support.�The Developer Support package adds several goodies: debug information for every page; the ability to log comments to the page instead of the error log, and fast user switching so that you can test pages as anonymous and as dummy users without logging in and out.

            PostgreSQL.�You can work directly with the database to do debugging steps like looking directly at tables and testing stored - procedures. Start emacs. Type + procedures. Start emacs. Type M-x sql-postgres. Press enter for - server name and use openacs-dev for + server name and use service0 for database name. You can use C-(up arrow) and C-(down arrow) - for command history. + for command history.

            Hint: "Parse error near *" usually means that an xql file wasn't recognized, because the tcl file is choking on the *SQL* - placeholder that it falls back on.

            Watching the server log.�NOTE: explain how to add tcl to directly write your own - log output

            To set up real-time monitoring of the AOLserver error - log, type

            less /usr/local/aolserver/log/openacs-dev-error.log

            + placeholder that it falls back on.

            Watching the server log.�

            To set up real-time monitoring of the AOLserver error + log, type

            less /var/lib/aolserver/service0/log/openacs-dev-error.log

            F�to�show�new�log�entries�in�real�time�(like�tail�-f)
            C-c�to�stop�and�F�to�start�it�up�again.�
            G�goes�to�the�end.
            ?�searches�backward�
            /�searches�forward.�
            ����������

            -

            Manual testing

            Make a list of basic tests to make sure it works

            Test NumActionExpected Result
            001Browse to the index page while not logged in and +

            Manual testing

            Make a list of basic tests to make sure it works

            Test NumActionExpected Result
            001Browse to the index page while not logged in and while one or more notes exist.No edit or delete or add links should appear.
            002Browse to the index page while logged in. An Edit link should appear. Click on it. Fill out the form and click Submit.The text added in the form should be visible on the - index page.

            Other things to test: try to delete someone else's + index page.

            API-001Invoke mfp::note::create with a specific word as the title.Proc should return an object id.
            API-002Given an object id from API-001, invoke mfp::note::get.Proc should return the specific word in the title.
            API-003Given the object id from API-001, invoke mfp::note::delete.Proc should return 0 for success.

            Other things to test: try to delete someone else's note. Try to delete your own note. Edit your own note. - Search for a note.

            Write automated tests

            by Simon Carstensen

            + Search for a note.

            Write automated tests

            by Simon Carstensen and Joel Aufrecht

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

            - -It seems to me that a lot of -people have been asking for some guidelines on how to write automated -tests. I've done several tests by now and have found the process to be -extremely easy and useful. It's a joy to work with automated testing -once you get the hang of it.

            I just wrote a test script for the acs-service-contract package and -thought I'd might as well post a step-by-step run-through, since some -people have been asking for this. Here goes. -

            1. Create the directory that will contain the test - script(s):

              -$ cd /web/simon/packages/acs-service-contract/tcl
              -$ mkdir test
              -
            2. Create the .tcl library that holds the test - procs:

              -$ cd test
              -$ emacs acs-service-contract-procs.tcl
              -
            3. Write the tests. This is obviously the big step - :)

              -The script should first call ad_library like any normal -procs.tcl file: -

              ad_library {
              +        

            + It seems to me that a lot of people have been asking for some guidelines on how to write automated tests. I've done several tests by now and have found the process to be extremely easy and useful. It's a joy to work with automated testing once you get the hang of it.

            Create the directory that will contain the test + script and edit the script file. The directory location and file name are standards which are recognized by the automated testing package:

            [service0 www]$ mkdir /var/lib/aolserver/service0/packages/myfirstpackage/tcl/test
            +[service0 www]$ cd /var/lib/aolserver/service0/packages/myfirstpackage/tcl/test
            +[service0 test]$ emacs myfirstpackages-procs.tcl

            Write the tests. This is obviously the big step :) The script should first call ad_library like any normal -procs.tcl file:

            ad_library {
                 ...
             }
             

            To create a test case you call aa_register_case test_case_name.. Once you've created the test case you start writing the needed logic. -Let's say you just wrote an API for adding and deleting notes in the +We'll use the tutorial package, "myfirstpackage," as an example. +Let's say you just wrote an API for adding and deleting notes in the notes packages and wanted to test that. You'd probably want to write a test that first creates a note, then verifies that it was inserted, then perhaps deletes it again, and finally verifies that it is @@ -69,61 +53,42 @@ call to aa_run_with_teardown which basically means that all the inserts, deletes, and updates will be rolled back once the test has been executed. A very useful feature. Instead of inserting bogus data -like: set name "Simon", I tend to generate a random script in order avoid inserting a value that's already in the database: -

            set name [ad_generate_random_string]
            -

            -Here's how the test case looks so far: - -

            aa_register_case acs_sc_impl_new_from_spec {
            -
            -   aa_run_with_teardown \
            +like:        set name "Simon", I tend to generate a random script in order avoid inserting a value that's already in the database:

            set name [ad_generate_random_string]
            +
            Here's how the test case looks so far:
            aa_register_case mfp_basic_test {
            +    My test
            +} {
            +    aa_run_with_teardown \
                    -rollback \
            -       -testcode  {
            -          ... logic ...
            +       -test_code  {
            +
                    }
             }
             

            Now let's look at the actual test code. That's the code that -goes inside -testcode {}. -In my case I had added a new column to acs_sc_impls (pretty_name), -which meant that I had to change the datamodel and the Tcl API to -support this new change. To make sure I didn't screw up, I wrote a test -that created a new service contract, then a new implementation of that -contract, and called acs_sc::impl::get to check that the data in the -new column had been added correctly and then finally verified that the -pretty_name was actually what I had tried to insert. It looked -something like this: -

            set spec {
            -     name "foo_contract"
            -     description "Blah blah"
            -     ...
            +goes inside -test_code {}.  We want to implement test case API-001, "Given an object id from API-001, invoke mfp::note::get.  Proc should return the specific word in the title."

            +      set name [ad_generate_random_string]
            +      set new_id [mfp::note::add -title $name]
            +      aa_true "Note add succeeded" [exists_and_not_null new_id]

            To test our simple case, we must load the test file into the system (just as with the /tcl file in the basic tutorial, since the file didn't exist when the system started, the system doesn't know about it.) To make this file take effect, go to the APM and choose "Reload changed" for "MyFirstPackage". Since we'll be changing it frequently, select "watch this file" on the next page. This will cause the system to check this file every time any page is requested, which is bad for production systems but convenient for developing.

            Once the file is loaded, go to ACS Automated Testing and click on myfirstpackage. You should see your test case. Run it and examine the results.

            Now we can add the rest of the API tests. The complete test looks like:

            ad_library {
            +    Test cases for my first package.
             }
             
            -# Create service contract
            -acs_sc::contract::new_from_spec -spec $spec
            +aa_register_case mfp_basic_test {
            +    Test One
            +} {
            +   aa_run_with_teardown \
            +       -rollback \
            +       -test_code  {
            +           set name [ad_generate_random_string]
            +           set new_id [mfp::note::add -title $name]
            +           aa_true "Note add succeeded" [exists_and_not_null new_id]
             
            -set spec {
            -     name "foo_impl"
            -     description "Blah blah blah"
            -     pretty_name "Foo Implementation"
            -     ...
            -}
            +           mfp::note::get -item_id $new_id -array note_array
            +           aa_true "Note contains correct title" [string equal $note_array(title) $name]
             
            -# Create implementation
            -set impl_id [acs_sc::impl::new_from_spec -spec $spec]
            +           mfp::note::delete -item_id $new_id
             
            -# Get the values of the implementation we just created
            -acs_sc::impl::get -impl_id $impl_id -array impl
            +           set get_again [catch {mfp::note::get -item_id $new_id -array note_array}]
            +           aa_false "After deleting a note, retrieving it fails" [expr $get_again == 0]
            +       }
            +}
             
            -#Verify that the pretty_name column has the correct value
            -aa_equals "did column pretty_name get set correctly?" $impl(pretty_name) "Foo Implementation"
            -

            Now you might not know how acs-service-contract works, but that -doesn't matter. I'm basically inserting data into the database, then -querying for the database to check that it got inserted and then -finally, using aa_equals, I compare the result with what I inserted to -verify that everything is correct.

            -There are number of other useful procs for determening whether a test case was successful or not, namely: -

            aa_true "is this true?" [expr ![empty_string $foo]]
            -aa_false "is this true?" [empty_string $foo]
            -

            There a number of other useful procs and I will encourage you to -look at the few packages for which tests have already been implemented. -That is perhaps the best documentation we have so far. See also the section called “Automated Testing”.

            View comments on this page at openacs.org
            +

            See also the section called “Automated Testing”.

            View comments on this page at openacs.org
            Index: openacs-4/packages/acs-core-docs/www/tutorial-newpackage.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-newpackage.html,v diff -u -N -r1.16 -r1.17 --- openacs-4/packages/acs-core-docs/www/tutorial-newpackage.html 11 Dec 2003 23:08:47 -0000 1.16 +++ openacs-4/packages/acs-core-docs/www/tutorial-newpackage.html 4 Feb 2004 16:47:33 -0000 1.17 @@ -1,7 +1,7 @@ -Creating a Package

            Creating a Package

            by Joel Aufrecht

            +Creating a Package

            Creating a Package

            by Joel Aufrecht

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

            The intended page map

            Overview

            To start developing new code in OpenACS, we build a new +

            The intended page map

            Overview

            To start developing new code in OpenACS, we build a new package. A package is a a discrete collection of web pages, tcl code, and database tables and procedures. A package with user interface is called an application; a package which provides @@ -21,11 +21,11 @@

            In this tutorial, we will make an application package for displaying a list of text notes. -

            Before you begin

            You will need:

            • A computer with a working installation of +

            Before you begin

            You will need:

            • A computer with a working installation of OpenACS. If you don't have this, see Chapter�2, Installation Overview.

            • Example files, which are included in the -standard OpenACS 5.0.0b4 distribution. -

            Figure�7.1.�Assumptions in this section

            Fully qualified domain name of your serveryourserver.test
            URL of your serverhttp://yourserver.test:8000
            Name of development accountservice0
            New Package keymyfirstpackage

            Use the APM to initialize a new package

            We use the ACS Package Manager (APM) to add, remove, and +standard OpenACS distribution. +

            Figure�7.1.�Assumptions in this section

            Fully qualified domain name of your serveryourserver.test
            URL of your serverhttp://yourserver.test:8000
            Name of development accountservice0
            New Package keymyfirstpackage

            Use the APM to initialize a new package

            We use the ACS Package Manager (APM) to add, remove, and upgrade packages. It handles package meta-data, such as lists of files that belong in the package. Each package is uniquely identified by a package key. To start developing a new @@ -54,7 +54,7 @@

            This creates a package rooted at /var/lib/aolserver/service0/packages/myfirstpackage. This is the "home directory" of our new package, and all - files in the package will be within this directory.

            Mount the package in the site map

            In order to see your work in progress, you must create a + files in the package will be within this directory.

            Mount the package in the site map

            In order to see your work in progress, you must create a map between the URL space of incoming requests and the package. You do this by mounting the package in the Site Map. This creates a link between the incoming URL and an Index: openacs-4/packages/acs-core-docs/www/tutorial-pages.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-pages.html,v diff -u -N -r1.16 -r1.17 --- openacs-4/packages/acs-core-docs/www/tutorial-pages.html 11 Dec 2003 23:08:47 -0000 1.16 +++ openacs-4/packages/acs-core-docs/www/tutorial-pages.html 4 Feb 2004 16:47:33 -0000 1.17 @@ -1,8 +1,8 @@ -Creating Web Pages

            Creating Web Pages

            by Joel Aufrecht

            +Creating Web Pages

            Creating Web Pages

            by Joel Aufrecht

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff. -

            Install some API

            As a workaround for missing content-repository functionality, copy a provided file into the directory for tcl files:

            -    cp /var/lib/aolserver/service1/packages/acs-core-docs/www/files/note-procs.tcl /var/lib/aolserver/service1/packages/myfirstpackage/tcl/

            To make this file take effect, go to the APM and choose "Reload all files" for "MyFirstPackage".

            Build the "Index" page

            Each user-visible page in your package has, typically, +

            Install some API

            As a workaround for missing content-repository functionality, copy a provided file into the directory for tcl files:

            +    cp /var/lib/aolserver/service0/packages/acs-core-docs/www/files/note-procs.tcl /var/lib/aolserver/service0/packages/myfirstpackage/tcl/

            To make this file take effect, go to the APM and choose "Reload changed" for "MyFirstPackage".

            Page Map

            Our package will have two visible pages. The first shows a list of all objects; the second shows a single object in view or edit mode, and can also be used to add an object. The index page will display the list, but since we might reuse the list later, we'll put it in a seperate file and include it on the index page.

            Figure�7.5.�Page Map

            Page Map

            Build the "Index" page

            Each user-visible page in your package has, typically, three parts. The tcl file holds the procedural logic for the page, including TCL and database-independent SQL code, and does things like @@ -12,18 +12,21 @@ and -oracle.xql files contains database-specific SQL. The default page in any directory is index, so we'll build that - first, starting with the tcl file:

            [service0@yourserver postgresql]$ cd /var/lib/aolserver/service0/myfirstpackages/www
            -[service0@yourserver www emacs index.tcl

            Paste this into the file.

            ad_page_contract {
            +      first, starting with the tcl file:

            [service0 postgresql]$ cd /var/lib/aolserver/service0/packages/myfirstpackages/www
            +[service0 www]$ emacs index.tcl

            Paste this into the file.

            ad_page_contract {
                 This is the main page for the package.  It displays all of the Notes and provides links to edit them and to create new Notes.
             
            -    @author Your Name (you@yourserver.test)
            +    @author Your Name (you@example.com)
                 @cvs-id $Id$
             }
             
             set page_title [ad_conn instance_name]
            -set context [list]
            -
            -template::list::create \
            +set context [list]

            Now index.adp:

            <master>
            +  <property name="title">@page_title;noquote@</property>
            +  <property name="context">@context;noquote@</property>
            +<include src="/packages/myfirstpackage/lib/note-list">

            You can test your work by viewing the page.

            The index page includes the list page, which we put in /lib instead of /www to designate that it's available for reuse by other packages.

            [service0 www]$ mkdir /var/lib/aolserver/service0/packages/myfirstpackage/lib
            +[service0 www]$ cd /var/lib/aolserver/service0/packages/myfirstpackage/lib
            +[service0 lib]$ emacs note-list.tcl
            template::list::create \
                 -name notes \
                 -multirow notes \
                 -actions { "Add a Note" note-edit} \
            @@ -60,19 +63,12 @@
                 } {
             	set edit_url [export_vars -base "note-edit" {item_id}]
             	set delete_url [export_vars -base "note-delete" {item_id}]
            -    }
            -

            Now index.adp:

            -<master>
            -  <property name="title">@page_title;noquote@</property>
            -  <property name="context">@context;noquote@</property>
            -<listtemplate name="notes"></listtemplate>
            -    

            Now we create the add/edit page. If note_id is passed in, - it edits that note. Otherwise, it presents a form for adding - notes. Edit - note-edit.tcl:

            ad_page_contract {
            -    This is the main page for the package.  It displays all of the Notes and provides links to edit them and to create new Notes.
            +    }
            [service0 lib]$ emacs note-list.adp
            <listtemplate name="notes"></listtemplate>

            Create the add/edit page. If note_id is passed in, + it display that note, and can change to edit mode if appropriate. Otherwise, it presents a form for adding notes.

            [service0 lib]$ cd /var/lib/aolserver/service0/packages/myfirstpackage/www
            +[service0 www]$ emacs note-edit.tcl
            ad_page_contract {
            +    This is the view-edit page for notes.
             
            -    @author Your Name (you@yourserver.test)
            +    @author Your Name (you@example.com)
                 @cvs-id $Id$
              
                 @param item_id If present, assume we are editing that note.  Otherwise, we are creating a new note.
            @@ -84,10 +80,12 @@
                 {item_id:key}
                 {title:text {label Title}}
             } -new_request {
            +    auth::require_login
                 permission::require_permission -object_id [ad_conn package_id] -privilege create
                 set page_title "Add a Note"
                 set context [list $page_title]
             } -edit_request {
            +    auth::require_login
                 permission::require_write_permission -object_id $item_id
                 mfp::note::get \
             	-item_id $item_id \
            @@ -107,17 +105,16 @@
             } -after_submit {
                 ad_returnredirect "."
                 ad_script_abort
            -}

            And note-edit.adp:

            <master>
            +}
            [service0 www]$ emacs note-edit.adp
            <master>
               <property name="title">@page_title;noquote@</property>
               <property name="context">@context;noquote@</property>
               <property name="focus">note.title</property>
               
             <formtemplate id="note"></formtemplate>

            And the delete page. Since it has no UI, there is only a - tcl page, and no adp page. Edit -note-delete.tcl:

            ad_page_contract {
            +     tcl page, and no adp page.

            [service0 www]$ emacs note-delete.tcl
            ad_page_contract {
                 This deletes a note
             
            -    @author Your Name (you@yourserver.test)
            +    @author Your Name (you@example.com)
                 @cvs-id $Id$
              
                 @param item_id The item_id of the note to delete
            @@ -126,7 +123,10 @@
             }
             
             permission::require_write_permission -object_id $item_id
            -
            +set title [item::get_title $item_id]
             mfp::note::delete -item_id $item_id
             
            -ad_returnredirect "."
            View comments on this page at openacs.org
            +ad_returnredirect "." +# stop running this code, since we're redirecting +abort +
            View comments on this page at openacs.org
            Index: openacs-4/packages/acs-core-docs/www/tutorial.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial.html,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/acs-core-docs/www/tutorial.html 19 Nov 2003 15:44:51 -0000 1.8 +++ openacs-4/packages/acs-core-docs/www/tutorial.html 4 Feb 2004 16:47:33 -0000 1.9 @@ -1 +1 @@ -Chapter�7.�Development Tutorial
            View comments on this page at openacs.org
            +Chapter�7.�Development Tutorial
            View comments on this page at openacs.org
            Index: openacs-4/packages/acs-core-docs/www/unix-installation.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/unix-installation.html,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/acs-core-docs/www/unix-installation.html 11 Dec 2003 23:08:47 -0000 1.9 +++ openacs-4/packages/acs-core-docs/www/unix-installation.html 4 Feb 2004 16:47:33 -0000 1.10 @@ -1,4 +1,4 @@ -Install a Unix-like system and supporting software

            Install a Unix-like system and supporting software

            by Joel Aufrecht

            +Install a Unix-like system and supporting software

            Install a Unix-like system and supporting software

            by Joel Aufrecht

            OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

            a Unix-like system

            You will need a computer running a unix-like system with the following software installed:

            • tdom

            • tcl

            • gmake and the compile and build Index: openacs-4/packages/acs-core-docs/www/update-repository.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/update-repository.html,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-core-docs/www/update-repository.html 23 Jan 2004 10:16:33 -0000 1.1 +++ openacs-4/packages/acs-core-docs/www/update-repository.html 4 Feb 2004 16:47:33 -0000 1.2 @@ -1,4 +1,4 @@ -How to Update the OpenACS.org repository

              How to Update the OpenACS.org repository

              1. +How to Update the OpenACS.org repository

                How to Update the OpenACS.org repository

                1. Setup a local OpenACS server running 5.0 or better.

                2. Edit packages/acs-admin/www/apm/build-repository.tcl and adjust the Configuration Settings.

                3. Index: openacs-4/packages/acs-core-docs/www/upgrade-openacs-files.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/upgrade-openacs-files.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/upgrade-openacs-files.html 4 Feb 2004 16:47:33 -0000 1.2 @@ -0,0 +1,44 @@ +Upgrading the OpenACS files

                  Upgrading the OpenACS files

                  OpenACS is distributed as a collection of files, available as one big tarball, via CVS, and via automatic download from within the APM. Upgrades work by first changing the file system (via any of the previous methods), and then using the APM to scan the file system, find upgrade scripts, and execute them. This section describes how to upgrade the file system. Starting with OpenACS 5.0, this section can generally be skipped because the OpenACS APM can directly download new files from the openacs.org repository.

                  Many OpenACS site developers operate their own CVS repository to keep track of changes from the release OpenACS code. This part describes how to import the latest OpenACS version into your own repository. If you are using CVS, you will unpack the OpenACS 4.6 tarball into a working directory and then import that directory into cvs. If you have changed files in the core packages, cvs will attempt to merge your changes. You may have to manually merge some conflicts. When that's finished, you can update your normal development checkout directory and the new files will appear. If you aren't using CVS, you can unpack the tarball on top of your existing tree, but any customizations you've made to the kernel or core packages will be erased.

                  • Upgrading files for a site which is not in a CVS repository.�Unpack the tarball into a new directory and copy its contents on top of your working directory.

                    [root root]# su - service0
                    +        [service0 aolserver]$ cd /var/lib/aolserver
                    +        [service0 web]$ tar xzf /tmp/openacs-4-6.tgz
                    +        [service0 web]$ cp -r openacs-4-6/* openacs-4
                    +        [service0 openacs-upgrade]$ exit
                    +        [root root]#
                    +        su - service0
                    +        cd /var/lib/aolserver
                    +        tar xzf /tmp/openacs-4-6.tgz
                    +        cp -r openacs-4-6/* openacs-4
                    +        exit
                  • + Upgrading files for a site in a private CVS repository +

                    1. Unpack the new files into a working directory.

                      [root root]# su - service0
                      +            [service0 aolserver]$ cd /tmp
                      +            [service0 tmp]$ tar xzf openacs-4-6.tgz
                      +            [service0 tmp]$ cd openacs-4.6

                      Import the new files into your cvs repository; where they match existing files, they will become the new version of the file.

                      [service0 openacs-4.6]$  cvs import -m "upgrade to OpenACS 4.6" openacs 
                      +            OpenACS openacs-4-6

                      Create a new directory as temporary working space to reconcile conflicts between the new files and your current work. The example uses the cvs keyword yesterday, making the assumption that you haven't checked in new code to your local tree in the last day.

                      [service0 openacs-4.6]$  cd /var/lib/aolserver
                      +            [service0 tmp]$ mkdir openacs-upgrade
                      +            [service0 tmp]$ cvs checkout -d openacs-upgrade -jOpenACS:yesterday -jOpenACS openacs > cvs.txt 2>&1
                      +            (CVS feedback here)
                      +            su - service0
                      +            cd /tmp
                      +            tar xzv openacs-4-6.tgz
                      +            cd openacs-4.6
                      +            cvs import -m "upgrade to OpenACS 4.6" openacs OpenACS openacs-4-6
                      +            cd /tmp
                      +            mkdir openacs-upgrade
                      +            cvs checkout -d openacs-upgrade -jOpenACS:yesterday -jOpenACS openacs > cvs.txt 2>&1
                    2. The file /tmp/openacs-upgrade/cvs.txt contains the results of the upgrade. If you changed files that are part of the OpenACS tarball and those changes conflict with the 4.5-4.6 upgrade, you'll have to manually reconcile them. Use the emacs command M-x sort-lines and then, for each line that starts with a C, open that file and manually resolve the conflict by deleting the excess lines. When you're finished, or if there aren't any conflicts, save and exit.

                    3. Once you've fixed any conflicts, commit the new code + to your local tree.

                      [service0 tmp]$ cd openacs-upgrade
                      +            [service0 openacs-upgrade]$ cvs commit -m "Upgraded to 4.6"
                      +            cd openacs-upgrade
                      +            cvs commit -m "Upgraded to 4.6"
                    4. Update your working tree with the new files. The CVS flags ensure that new directories are created and pruned directories destroyed.

                      [service0 openacs-upgrade]$ cd /var/lib/aolserver/service0
                      +            [service0 service0]$ cvs up -Pd
                      +            (CVS feedback)
                      +            [service0 service0]$ exit
                      +            [root root]#
                      +            cd /var/lib/aolserver/service0
                      +            cvs up -Pd
                      +            exit
                  • + Upgrading files for a site using the OpenACS.org CVS repository +

                    1. [service0 ~]$ cd /var/lib/aolserver/service0
                      +            [service0 service0]$ cvs up -Pd
                      +            (CVS feedback)
                      +            [service0 service0]$
                  View comments on this page at openacs.org
                  Index: openacs-4/packages/acs-core-docs/www/upgrade-openacs.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/Attic/upgrade-openacs.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/upgrade-openacs.html 4 Feb 2004 16:47:33 -0000 1.2 @@ -0,0 +1,47 @@ +Upgrading OpenACS

                  Upgrading OpenACS

                  Upgrading 4.5 or higher to 4.6.3

                  The required platform for OpenACS 4.6 is the same as + 4.5, with the exception of OpenFTS. OpenACS 4.6 and later require OpenFTS 0.3.2 for full text search on PostGreSQL. If you have OpenFTS 0.2, you'll need to upgrade.

                  1. Make a Backup.�Back up the database and file system (see the section called “Manual backup and recovery”).

                  2. OPTIONAL: Upgrade OpenFTS.�the section called “Upgrading OpenFTS from 0.2 to 0.3.2”

                  3. + Stop the server +

                    [root root]# svc -d /service/service0
                  4. Upgrade the file system.�the section called “Upgrading the OpenACS files”

                  5. + Start the server +

                    [root root]# svc -u /service/service0
                  6. Use APM to upgrade the database.�

                    1. Browse to the package manager, http://yourserver/acs-admin/apm.

                    2. Click Install packages.

                    3. Select the packages you want to install. This should + be everything that says + upgrade, plus any new + packages you want. It's safest to upgrade the kernel by + itself, and then come back and upgrade the rest of the + desired packages in a second pass.

                    4. On the next screen, click Install Packages

                    5. When prompted, restart the server:

                      [root root]# restart-aolserver service0
                    6. Wait a minute, then browse to the package manager, http://yourserver/acs-admin/apm.

                    7. Check that the kernel upgrade worked by clicking All and making sure that acs-kernel version is .

                  7. Rollback.�If anything goes wrong, roll back to the backup snapshot.

                  Upgrading OpenACS 4.6.3 to 5.0

                  • Oracle.�Not yet documented. It should be possible to upgrade via the APM just as when upgrading to 4.6.3.

                  • PostGreSQL.�You must use PostGreSQL 7.3.x or newer to upgrade OpenACS beyond 4.6.3. See Upgrade PostGreSQL to 7.3; Table�2.2, “Version Compatibility Matrix” +

                    1. Back up the database and file system.

                    2. Upgrade the file system for packages/acs-kernel.�the section called “Upgrading the OpenACS files”

                    3. Upgrade the kernel manually. (There is a script to do most of the rest: /contrib/misc/upgrade_4.6_to_5.0.sh on HEAD). You'll still have to do a lot of stuff manually, but automated trial and error is much more fun.)

                      [root root]# su - service0
                      +[service0 aolserver]$ cd /var/lib/aolserver/ service0/packages/acs-kernel/sql/postgresql/upgrade

                      + Manually execute each of the upgrade scripts in sequence, either from within psql or from the command line with commands such as psql -f upgrade-4.6.3-4.6.4.sql service0. Run the scripts in this order (order is tentative, not verified): +

                      psql -f upgrade-4.6.3-4.6.4.sql service0
                      +psql -f upgrade-4.6.4-4.6.5.sql service0
                      +psql -f upgrade-4.6.5-4.6.6.sql service0
                      +psql -f upgrade-4.7d-4.7.2d.sql service0
                      +psql -f upgrade-4.7.2d-5.0d.sql service0
                      +psql -f upgrade-5.0d-5.0d2.sql service0
                      +psql -f upgrade-5.0d2-5.0d3.sql service0
                      +psql -f upgrade-5.0d6-5.0d7.sql service0
                      +psql -f upgrade-5.0d7-5.0d9.sql service0
                      +psql -f upgrade-5.0d11-5.0d12.sql service0
                      +psql -f upgrade-5.0.0a4-5.0.0a5.sql service0
                      +psql -f upgrade-5.0.0b1-5.0.0b2.sql service0
                      +psql -f upgrade-5.0.0b2-5.0.0b3.sql service0
                      +psql -f upgrade-5.0.0b3-5.0.0b4.sql service0
                    4. Upgrade ACS Service Contracts manually:

                      [service0 aolserver]$ cd /var/lib/aolserver/ service0/packages/acs-service-contracts/sql/postgresql/upgrade
                      +psql -f upgrade-4.7d2-4.7d3.sql service0
                      +
                    5. Load acs-authentication data model.

                      psql -f /var/lib/aolserver/service0/openacs-5/packages/acs-authentication/sql/postgresql/acs-authentication-create.sql service0
                    6. Load acs-lang data model.

                      psql -f /var/lib/aolserver/service0/packages/acs-lang/sql/postgresql/acs-lang-create.sql service0
                    7. (This step may overlap with the two previous steps, but I think it's harmless?) Create a file which will be executed on startup which takes care of a few issues with authentication and internationalization: create service0/tcl/zzz-postload.tcl containing:

                      if {![apm_package_installed_p acs-lang]} {
                      +apm_package_install -enable -mount_path acs-lang [acs_root_dir]/packages/acs-lang/acs-lang.info
                      +lang::catalog::import -locales [list "en_US"]
                      +}
                      +
                      +if {![apm_package_installed_p acs-authentication]} {
                      +apm_package_install -enable [acs_root_dir]/packages/acs-authentication/acs-authentication.info
                      +apm_parameter_register "UsePasswordWidgetForUsername" \
                      +"Should we hide what the user types in the username
                      +field, the way we do with the password field? Set
                      +this to 1 if you are using sensitive information
                      +such as social security number for username." \
                      +acs-kernel 0 number \
                      +security 1 1
                      +parameter::set_value -package_id [ad_acs_kernel_id] -parameter UsePasswordWidgetForUsername -value 0
                      +}
                    8. If you can login, visit /acs-admin/apm and upgrade acs-kernel and acs-service-contract and uncheck the data model scripts. Restart. If everything is still working, make another backup of the database. +

                    9. Upgrade other packages via the APM

                    + See also these forum posts: Forum OpenACS Development: 4.6.3 upgrade to 5-HEAD: final results, OpenACS 5.0 Upgrade Experiences.

                  View comments on this page at openacs.org
                  Index: openacs-4/packages/acs-core-docs/www/upgrade-overview.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/upgrade-overview.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/upgrade-overview.html 4 Feb 2004 16:47:33 -0000 1.2 @@ -0,0 +1,9 @@ +Overview

                  Overview

                  Starting with Version 4.5, all OpenACS core packages support + automatic upgrade. That means that, if you have OpenACS 4.5 + or better, you should always be able to upgrade all of your core + packages automatically. If you haven't changed anything, no + manual intervention should be required. If you are running + OpenACS prior to 4.5, upgrading will require manual effort.

                  It's always a good idea to precede an upgrade attempt with a snapshot backup.

                  OpenACS consists of files and a database schema. The files + in a new tarball include database upgrade scripts. To start the + upgrade, replace your existing files with the new files and then browse to the APM, which will detect the new packages and offer to run the appropriate database upgrade scripts. After restarting the server again, the upgrade is + complete.

                  Table�5.1.�Assumptions in this section

                  name of OpenACS userservice0
                  OpenACS server nameservice0
                  Root of OpenACS file tree/var/lib/aolserver/service0
                  Database backup directory/var/lib/aolserver/service0/database-backup
                  View comments on this page at openacs.org
                  Index: openacs-4/packages/acs-core-docs/www/upgrade-supporting.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/upgrade-supporting.html,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/upgrade-supporting.html 4 Feb 2004 16:47:33 -0000 1.2 @@ -0,0 +1,51 @@ +Upgrading Platform components

                  Upgrading Platform components

                  Upgrading OpenFTS from 0.2 to 0.3.2

                  OpenACS Full Text Search requires several pieces: the OpenFTS code, some database functions, and the OpenFTS Engine. This section describes how to upgrade OpenFTS from 0.2 to 0.3.2 and upgrade the search engine on an OpenACS site at the same time.

                  1. Uninstall the old OpenFTS Engine from the service0 database.

                    1. Browse to http://yourserver/openfts. +

                    2. Click Administration.

                    3. Click Drop OpenFTS Engine

                  2. Build and install the new OpenFTS driver and supporting tcl procedures. (This section of shell code is not fully documented; please exercise care.)

                    cd /usr/local/src/
                    +          tar xzf /tmp/Search-OpenFTS-tcl-0.3.2.tar.gz
                    +          chown -R root.root Search-OpenFTS-tcl-0.3.2/
                    +          cd Search-OpenFTS-tcl-0.3.2/
                    +          ./configure --with-aolserver-src=/usr/local/src/aolserver/aolserver --with-tcl=/usr/lib/
                    +          cd aolserver/
                    +          make
                    +          

                    + Back up the old fts driver as a precaution and install the newly + compiled one

                    mv /usr/local/aolserver/bin/nsfts.so /usr/local/aolserver/bin/nsfts-0.2.so 
                    +          cp nsfts.so /usr/local/aolserver/bin
                    +          

                    Build and install the OpenFTS code for PostGresSQL

                    cd /usr/local/src/Search-OpenFTS-tcl-0.3.2/
                    +          cp -r pgsql_contrib_openfts /usr/local/src/postgresql-7.2.3/contrib /usr/local/src/postgresql-7.2.3/contrib/pgsql_contrib_openfts
                    +          make
                    +          su - postgres
                    +          cd tsearch/
                    +          make
                    +          make install
                    +          exit

                    In order for the OpenACS 4.6 OpenFTS Engine to use the OpenFTS 0.3.2 driver, we need some commands added to the database.

                    [root root]# su - service0
                    +          [service0 dev]$ psql service0 -f /usr/local/pgsql/share/contrib/openfts.sql
                    +          CREATE
                    +          CREATE
                    +          [service0 dev]$ psql service0 -f /usr/local/src/postgresql-7.2.3/contrib/tsearch/tsearch.sql
                    +          BEGIN
                    +          CREATE
                    +          (~30 more lines)
                    +          [service0 dev]$ exit
                    +          [root root]# 
                    +          su - service0
                    +          psql service0 -f /usr/local/pgsql/share/contrib/openfts.sql
                    +          psql service0 -f /usr/local/src/postgresql-7.2.3/contrib/tsearch/tsearch.sql
                    +          exit
                  3. OPTIONAL: Install the new OpenFTS Engine.�If you want to upgrade the OpenFTS Engine, do these + steps. (You must have already upgraded the OpenFTS driver to + 0.3.2.)

                    1. Browse to http://yourserver/admin/site-map

                    2. On the openfts line, click on set parameters.

                    3. Change the value of openfts_tcl_src_path from /usr/local/src/Search-OpenFTS-tcl-0.2/ to /usr/local/src/Search-OpenFTS-tcl-0.3.2/

                    4. Click Set Parameters

                    5. [root root]# restart-aolserver service0
                    6. Browse to http://yourserver/openfts

                    7. Click Administration.

                    8. Click Initialize OpenFTS Engine

                  Upgrading from PostGreSQL 7.2 to 7.3

                  An OpenACS database created in PostGreSQL 7.2 will not work correctly in PostGreSQL 7.3. This is because 7.2 truncates function names to 31 characters, but 7.3 does not. This does not cause problems in 7.2, because truncation occurs both at function creation and at function calling, so they still match. But if you use a database created in 7.2 in 7.3, the function names in the database remain truncated but the function calls are not, and so they don't match. Also some functions use casting commands that no longer work in 7.3 and these functions must be recreated.

                  + To upgrade an OpenACS site from PostGreSQL 7.2 to 7.3, first upgrade the kernel to 4.6.3. Then, dump the database, run the upgrade script /var/lib/aolserver/service0/bin/pg_7.2to7.3_upgrade_helper.pl on the dump file, and reply the dump. See Forum OpenACS Q&A: PG 7.2->7.3 upgrade gotcha?. Example:

                  1. Back up the database as per PostgreSQL.

                  2. Run the upgrade script on the backup file.

                    [root root]# su - service0
                    +          [service0 service0]# cd /var/lib/aolserver/service0/bin
                    +          [service0 bin]$ ./pg_7.2to7.3_upgrade_helper.pl \
                    +          ../database-backup/nightly.dmp \
                    +          ../database-backup/upgrade-7.3.dmp \
                    +          /var/lib/aolserver/service0
                    +          ==================================================================
                    +          looking for function acs_object__check_object_ancest in oacs
                    +          grep result: /var/lib/aolserver/aufrecht-dev/packages/acs-kernel/sql/postgresql/acs-objects-create.sql:create function acs_object__check_object_ancestors (integer,integer,integer)
                    +
                    +          replacing acs_object__check_object_ancest with acs_object__check_object_ancestors
                    +
                    +          (many lines omitted)
                    +          [service0 bin]$
                    +          
                  3. Use perl to replace timestamp with timestamptz in the dump file.

                    find . -type f -name "*sql" | xargs perl -p -i.tmp -e "s/timestamp with time zone/timestamptz/g"
                    +          find . -type f -name "*sql" | xargs perl -p -i.tmp -e "s/\\wtimestamp[^t]/ timestamptz/g"
                  4. Restore the database from dump as per the recovery instructions.

                  View comments on this page at openacs.org
                  Index: openacs-4/packages/acs-core-docs/www/upgrade.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/upgrade.html,v diff -u -N -r1.12 -r1.13 --- openacs-4/packages/acs-core-docs/www/upgrade.html 11 Dec 2003 23:08:47 -0000 1.12 +++ openacs-4/packages/acs-core-docs/www/upgrade.html 4 Feb 2004 16:47:33 -0000 1.13 @@ -1 +1,4 @@ -Chapter�5.�Upgrading

                  Chapter�5.�Upgrading

                  Table of Contents

                  Upgrading
                  View comments on this page at openacs.org
                  +Chapter�5.�Upgrading

                  Chapter�5.�Upgrading

                  by Joel Aufrecht

                  + OpenACS docs are written by the named authors, and may be edited + by OpenACS documentation staff. +
                  View comments on this page at openacs.org
                  Index: openacs-4/packages/acs-core-docs/www/variables.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/variables.html,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-core-docs/www/variables.html 11 Dec 2003 23:08:47 -0000 1.3 +++ openacs-4/packages/acs-core-docs/www/variables.html 4 Feb 2004 16:47:33 -0000 1.4 @@ -1,9 +1,9 @@ -Variables

                  Variables

                  By joel@aufrecht.org

                  +Variables

                  Variables

                  By joel@aufrecht.org

                  OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

                  Date and Time Variables

                  Starting with OpenACS 5.0 and the introduction of acs-lang, we recommend retrieving date/time information from the database in - ANSI format and then using lc_time_fmt to format it for display.

                  Example�9.1.�Getting datetime from the database ANSI-style

                  db_multirow -extend { mydate_pretty } {
                  +    ANSI format and then using lc_time_fmt to format it for display.

                  Example�9.1.�Getting datetime from the database ANSI-style

                  db_multirow -extend { mydate_pretty } {
                       select to_char(mydate, 'YYYY-MM-DD HH24:MI:SS') as mydate_ansi,
                             ...
                       ...
                  Index: openacs-4/packages/acs-core-docs/www/win2k-installation.html
                  ===================================================================
                  RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/win2k-installation.html,v
                  diff -u -N -r1.24 -r1.25
                  --- openacs-4/packages/acs-core-docs/www/win2k-installation.html	11 Dec 2003 23:08:47 -0000	1.24
                  +++ openacs-4/packages/acs-core-docs/www/win2k-installation.html	4 Feb 2004 16:47:33 -0000	1.25
                  @@ -1,11 +1,11 @@
                  -OpenACS Installation Guide for Windows2000

                  OpenACS Installation Guide for Windows2000

                  by Matthew Burke and Curtis Galloway

                  +OpenACS Installation Guide for Windows2000

                  OpenACS Installation Guide for Windows2000

                  by Matthew Burke and Curtis Galloway

                  OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

                  NOTE: These instructions were valid for ACS v4, but have not been tested with OpenACS and the ArsDigita binary distributions are no longer available. Currently - (10/2003), the best option to get OpenACS 5.0.0b4 running on Windows + (10/2003), the best option to get OpenACS running on Windows is to use VMware and John Sequeira's Oasis VM distribution @@ -249,4 +249,4 @@

                  In the services control panel you should see two services: AOLserver-lintcollectors and AOLserver-iguanasdirect. -

                  ($Id$)
                  View comments on this page at openacs.org
                  +

                  ($Id$)
                  View comments on this page at openacs.org
                  Index: openacs-4/packages/acs-core-docs/www/files/tutorial-outline.dia =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/files/tutorial-outline.dia,v diff -u -N -r1.2 -r1.3 Binary files differ Index: openacs-4/packages/acs-core-docs/www/files/tutorial/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/files/tutorial/index.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/files/tutorial/index.adp 4 Feb 2004 16:47:34 -0000 1.2 @@ -0,0 +1,4 @@ + + @page_title;noquote@ + @context;noquote@ + \ No newline at end of file Index: openacs-4/packages/acs-core-docs/www/files/tutorial/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/files/tutorial/index.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/files/tutorial/index.tcl 4 Feb 2004 16:47:34 -0000 1.2 @@ -0,0 +1,9 @@ +ad_page_contract { + This is the main page for the package. It displays all of the Notes and provides links to edit them and to create new Notes. + + @author Your Name (you@example.com) + @cvs-id $Id: index.tcl,v 1.2 2004/02/04 16:47:34 joela Exp $ +} + +set page_title [ad_conn instance_name] +set context [list] \ No newline at end of file Index: openacs-4/packages/acs-core-docs/www/files/tutorial/myfirstpackage-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/files/tutorial/myfirstpackage-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/files/tutorial/myfirstpackage-procs.tcl 4 Feb 2004 16:47:34 -0000 1.2 @@ -0,0 +1,24 @@ +ad_library { + Test cases for my first package. +} + +aa_register_case mfp_basic_test { + Test One +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + set name [ad_generate_random_string] + set new_id [mfp::note::add -title $name] + aa_true "Note add succeeded" [exists_and_not_null new_id] + + mfp::note::get -item_id $new_id -array note_array + aa_true "Note contains correct title" [string equal $note_array(title) $name] + + mfp::note::delete -item_id $new_id + + set get_again [catch {mfp::note::get -item_id $new_id -array note_array}] + aa_false "After deleting a note, retrieving it fails" [expr $get_again == 0] + } +} + Index: openacs-4/packages/acs-core-docs/www/files/tutorial/note-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/files/tutorial/note-delete.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/files/tutorial/note-delete.tcl 4 Feb 2004 16:47:34 -0000 1.2 @@ -0,0 +1,18 @@ +ad_page_contract { + This deletes a note + + @author Your Name (you@example.com) + @cvs-id $Id: note-delete.tcl,v 1.2 2004/02/04 16:47:34 joela Exp $ + + @param item_id The item_id of the note to delete +} { + item_id:integer +} + +permission::require_write_permission -object_id $item_id +set title [item::get_title $item_id] +mfp::note::delete -item_id $item_id + +ad_returnredirect "." +# stop running this code, since we're redirecting +abort Index: openacs-4/packages/acs-core-docs/www/files/tutorial/note-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/files/tutorial/note-edit.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/files/tutorial/note-edit.adp 4 Feb 2004 16:47:34 -0000 1.2 @@ -0,0 +1,6 @@ + + @page_title;noquote@ + @context;noquote@ + note.title + + \ No newline at end of file Index: openacs-4/packages/acs-core-docs/www/files/tutorial/note-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/files/tutorial/note-edit.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/files/tutorial/note-edit.tcl 4 Feb 2004 16:47:34 -0000 1.2 @@ -0,0 +1,41 @@ +ad_page_contract { + This is the view-edit page for notes. + + @author Your Name (you@example.com) + @cvs-id $Id: note-edit.tcl,v 1.2 2004/02/04 16:47:34 joela Exp $ + + @param item_id If present, assume we are editing that note. Otherwise, we are creating a new note. +} { + item_id:integer,optional +} + +ad_form -name note -form { + {item_id:key} + {title:text {label Title}} +} -new_request { + auth::require_login + permission::require_permission -object_id [ad_conn package_id] -privilege create + set page_title "Add a Note" + set context [list $page_title] +} -edit_request { + auth::require_login + permission::require_write_permission -object_id $item_id + mfp::note::get \ + -item_id $item_id \ + -array note_array + + set title $note_array(title) + + set page_title "Edit a Note" + set context [list $page_title] +} -new_data { + mfp::note::add \ + -title $title +} -edit_data { + mfp::note::edit \ + -item_id $item_id \ + -title $title +} -after_submit { + ad_returnredirect "." + ad_script_abort +} \ No newline at end of file Index: openacs-4/packages/acs-core-docs/www/files/tutorial/note-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/files/tutorial/note-list.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/files/tutorial/note-list.adp 4 Feb 2004 16:47:34 -0000 1.2 @@ -0,0 +1 @@ + \ No newline at end of file Index: openacs-4/packages/acs-core-docs/www/files/tutorial/note-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/files/tutorial/note-list.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/files/tutorial/note-list.tcl 4 Feb 2004 16:47:34 -0000 1.2 @@ -0,0 +1,38 @@ +template::list::create \ + -name notes \ + -multirow notes \ + -actions { "Add a Note" note-edit} \ + -elements { + edit { + link_url_col edit_url + display_template { + + } + sub_class narrow + } + title { + label "Title" + } + delete { + link_url_col delete_url + display_template { + + } + sub_class narrow + } + } + +db_multirow \ + -extend { + edit_url + delete_url + } notes notes_select { + select ci.item_id, + n.title + from cr_items ci, + mfp_notesx n + where n.revision_id = ci.live_revision + } { + set edit_url [export_vars -base "note-edit" {item_id}] + set delete_url [export_vars -base "note-delete" {item_id}] + } \ No newline at end of file Index: openacs-4/packages/acs-core-docs/www/files/tutorial/note-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/files/tutorial/note-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/files/tutorial/note-procs.tcl 4 Feb 2004 16:47:34 -0000 1.2 @@ -0,0 +1,86 @@ +ad_library { + + Procs to add, edit, and remove notes for My First Package. + + @author oumi@arsdigita.com + @cvs-id $Id: note-procs.tcl,v 1.2 2004/02/04 16:47:34 joela Exp $ + +} + +namespace eval mfp {} +namespace eval mfp::note {} + +ad_proc -public mfp::note::get { + -item_id:required + -array:required +} { + This proc retrieves a note. This is annoying code that is only + here because we wanted to give you a working tutorial in 5.0 that + uses content repository, but the tcl api for content repository + won't be complete until 5.1. At least we can use the pregenerated views for select and edit. +} { + upvar 1 $array row + db_1row note_select { + select ci.item_id, + n.title + from cr_items ci, + mfp_notesx n + where ci.item_id = :item_id + and n.note_id = ci.live_revision + } -column_array row +} + +ad_proc -public mfp::note::add { + -title:required +} { + This proc adds a note. + @return item_id of the new note. +} { + db_transaction { + set item_id [db_exec_plsql note_insert { + select content_item__new(:title,-100,null,null,null,null,null,null,'content_item','mfp_note',:title,null,null,null,null) + }] + + set revision_id [db_nextval acs_object_id_seq] + + db_dml revision_add { + insert into mfp_notesi (item_id, revision_id, title) + values (:item_id, :revision_id, :title) + } + + db_exec_plsql make_live { + select content_item__set_live_revision(:revision_id) + } + } + return $item_id +} + +ad_proc -public mfp::note::edit { + -item_id:required + -title:required +} { + This proc edits a note. Note that to edit a cr_item, you insert a new revision instead of changing the current revision. +} { + db_transaction { + set revision_id [db_nextval acs_object_id_seq] + + db_dml revision_add { + insert into mfp_notesi (item_id, revision_id, title) + values (:item_id, :revision_id, :title) + } + + db_exec_plsql make_live { + select content_item__set_live_revision(:revision_id) + } + } +} + +ad_proc -public mfp::note::delete { + -item_id:required +} { + This proc deletes a note. +} { + db_exec_plsql note_delete { + select content_item__delete(:item_id) + } +} Index: openacs-4/packages/acs-core-docs/www/images/tutorial-page-map.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/images/tutorial-page-map.png,v diff -u -N -r1.2 -r1.3 Binary files differ Index: openacs-4/packages/acs-core-docs/www/xml/Makefile =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/Makefile,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/acs-core-docs/www/xml/Makefile 4 Feb 2004 12:12:16 -0000 1.11 +++ openacs-4/packages/acs-core-docs/www/xml/Makefile 4 Feb 2004 16:47:34 -0000 1.12 @@ -63,7 +63,7 @@ html: prelim XSL # adding --nonet --novalid is much faster but generates a bunch of bogus error messages - cd .. ; $(XSLTPROC) --xinclude xml/openacs.xsl xml/index.xml + cd .. ; $(XSLTPROC) --nonet --novalid --xinclude xml/openacs.xsl xml/index.xml # I got this to work with FOP 0.20.5 and docbook-xsl 1.62, and Jimi 1.0 # see README.fop for some notes. Index: openacs-4/packages/acs-core-docs/www/xml/index.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/index.xml,v diff -u -N -r1.22 -r1.23 --- openacs-4/packages/acs-core-docs/www/xml/index.xml 26 Jan 2004 15:39:44 -0000 1.22 +++ openacs-4/packages/acs-core-docs/www/xml/index.xml 4 Feb 2004 16:47:34 -0000 1.23 @@ -150,10 +150,9 @@ - - Configuring a New Service - Placeholder - + + Section missing + Section missing @@ -184,7 +183,7 @@ - Section Missing + Credits Section Missing Index: openacs-4/packages/acs-core-docs/www/xml/releasing-openacs.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/releasing-openacs.xml,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/acs-core-docs/www/xml/releasing-openacs.xml 26 Jan 2004 15:39:44 -0000 1.8 +++ openacs-4/packages/acs-core-docs/www/xml/releasing-openacs.xml 4 Feb 2004 16:47:34 -0000 1.9 @@ -1,5 +1,5 @@ - @@ -46,19 +46,22 @@ cd /var/tmp/openacs-4 cvs tag -F openacs-5-0-0a1 - Note that we use the -F flag which will force the tag to the new version (just in - case someone has created the tag already on another version). Excercise care when doing this since - you don't want to inadvertently move a prior release tag. Also if the tagging goes horribly wrong - for some reason you can delete the tag via "cvs tag -d <symbolic_tag>". - + + Branching + When we feature-freeze on HEAD as part of the release process, we are blocking new development. To avoid this, we branch the code at this point, so that new work can continue on HEAD while the branch is stabilized for release. However, branching means that bug fixes have to be synchronized between HEAD and the branch, and bug fixes tend to be more frequent right at this time. Therefore, our actual branch point is as late as possible - essentially, we do not branch until and unless new feature work is actively blocked by the feature freeze. Branching is almost the same as tagging, except for the flag and slightly different tag nomenclature. To see the list of old branches, cvs status -v somefile. + cvs tag -b oacs-5-0 + Tag dotLRN. Since the dotLRN packages aren't all in one module, we iterate through all of the modules. Log in first (cvs login) so that you don't have to log in for each module. - cd /var/tmp/dotlrn-packages for dir in *; do ( cd $dir && cvs tag -F dotlrn-2-0-0a1 ); done + Note that we use the -F flag which will force the tag to the new version (just in + case someone has created the tag already on another version). Excercise care when doing this since + you don't want to inadvertently move a prior release tag. Also if the tagging goes horribly wrong + for some reason you can delete the tag via "cvs tag -d <symbolic_tag>". Make the tarball @@ -73,8 +76,8 @@ Go to a new working space and export the tagged files. mkdir /var/tmp/tarball cd /var/tmp/tarball -cvs -d /cvsroot export -r openacs-5-0-0a1 acs-core - +cvs -d :pserver:anonymous@openacs.org:/cvsroot export -r openacs-5-0-0a1 acs-core +mv openacs-4 openacs Generate the tarball. @@ -138,37 +141,42 @@ + + Here is a shell script that automates packaging the tarball: + + release script missing + + ($Id$) + +
                  + How to Update the OpenACS.org repository - Setup a local OpenACS server. + Setup a local OpenACS server running 5.0 or better. - Edit the file packages/acs-admin/www/build-repository.tcl; - Change the line with 'set head_channel' to '5-1' if the version on HEAD in the openacs.org cvs repository is 5.1. Etcetera. - You may also want to change the line setting the variable 'repository_dir'. - + Edit packages/acs-admin/www/apm/build-repository.tcl and adjust the Configuration Settings. Request /acs-admin/apm/build-repository on your new server. + + + + The page will find all branches in the cvs repository labeled oacs-x-y, and build a repository channel for each of + those branches where x>=5 (so not for 4.6 and earlier). It will also build a channel for HEAD, + which will be named after what you set in 'head_channel' above. + + + - The page will find all branches in the cvs repository - labeled oacs-x-y, and build a repository channel for each of - those branches where x>=5 (so not for 4.6 and - earlier). Finally, it'll build another channel for HEAD, - which will be named after what you set in 'head_channel' - above. - - - - For each channel, it'll do an anonymous checkout of packges and contrib/packages, then build .apm files for each package in the checkout. @@ -177,20 +185,14 @@ The files will be stored on the server's hard drive in the directory specified by the 'repository_dir' variable in the page script, by default "[acs_root_dir]/www/repository/". + + If you're on openacs.org, everything should now be fine. Otherwise, you need to move the entire directory tree to openacs.org:/web/openacs/www/repository, replacing what was already there. +
                  - - - Here is a shell script that automates packaging the tarball: - - - release script missing - - ($Id$) - Index: openacs-4/packages/acs-core-docs/www/xml/variables.ent =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/variables.ent,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/acs-core-docs/www/xml/variables.ent 26 Jan 2004 15:39:44 -0000 1.6 +++ openacs-4/packages/acs-core-docs/www/xml/variables.ent 4 Feb 2004 16:47:34 -0000 1.7 @@ -1,5 +1,5 @@ - - - + + + Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/form-builder.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/form-builder.xml,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-core-docs/www/xml/developers-guide/form-builder.xml 26 Jan 2004 15:39:44 -0000 1.3 +++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/form-builder.xml 4 Feb 2004 16:47:34 -0000 1.4 @@ -44,5 +44,17 @@ + + + Common Errors + Here are some common errors and what to do when you + encounter them: + + Error when selecting values + This generally happens when there is an error in your + query. + + + ($Id$) Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/i18n.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/i18n.xml,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/acs-core-docs/www/xml/developers-guide/i18n.xml 2 Feb 2004 08:32:36 -0000 1.9 +++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/i18n.xml 4 Feb 2004 16:47:34 -0000 1.10 @@ -333,7 +333,7 @@ - + APM Parameters Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml 2 Feb 2004 08:32:36 -0000 1.7 +++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml 4 Feb 2004 16:47:34 -0000 1.8 @@ -1,48 +1,18 @@ - %myvars; ]> Advanced Topics - - This section is a work in progress. - by Joel Aufrecht - - - Overview This tutorial covers topics which are not essential to creating a minimal working package. Each section can be used independently of all of the others; all sections assume that you've completed the basic tutorial. - - - How to enforce security so that users can't - change other users records - - How to use the content management tables so that - ... what? - How to change the default stylesheets for Form - Builder HTML forms. - How to make your package searchable with OpenFTS/Oracle - How to make your package send email notifications - How to prepare pagelets for inclusion in other pages - How and when to put procedures in a tcl procedure library - How to add general_comments to your pages - More on ad_form - data validation, other stuff. - (plan to draw from Jon Griffin's doc) - How and when to implement caching - partialquery in xql - How to use the html/text entry widget to get the - "does this look right" confirm page - APM package dependencies - - - Write the Requirements and Design Specs It's time to document. For the tutorial we'll use @@ -61,11 +31,11 @@ pre-written documentation files for the tutorial app. Log in as service0, create the standard directories, and copy the prepared documentation: - [service0@yourserver service0]$ cd /var/lib/aolserver/service0/packages/samplenote/ -[service0@yourserver samplenote]$ mkdir -p www/doc/xml -[service0@yourserver samplenote]$ cd www/doc/xml -[service0@yourserver xml]$ cp /var/lib/aolserver/service0/packages/acs-core-docs/www/files/samplenote/* . -[service0@yourserver xml]$ + [service0 service0]$ cd /var/lib/aolserver/service0/packages/myfirstpackage/ +[service0 myfirstpackage]$ mkdir -p www/doc/xml +[service0 myfirstpackage]$ cd www/doc/xml +[service0 xml]$ cp /var/lib/aolserver/service0/packages/acs-core-docs/www/files/myfirstpackage/* . +[service0 xml]$ OpenACS uses DocBook for documentation. DocBook is an XML standard for semantic markup of documentation. That means that the tags you use indicate meaning, not intended @@ -86,7 +56,7 @@ directory. A Makefile is provided to generate html from the xml, and copy all of the supporting files. If Docbook is set up correctly, all you need to do is: - [service0@yourserver xml]$ make + [service0 xml]$ make cd .. ; /usr/bin/xsltproc ../../../acs-core-docs/www/xml/openacs.xsl xml/index.xml Writing requirements-introduction.html for sect1(requirements-introduction) Writing requirements-overview.html for sect1(requirements-overview) @@ -102,9 +72,9 @@ Writing admin-guide.html for chapter(admin-guide) Writing bi01.html for bibliography Writing index.html for book -[service0@yourserver xml]$ +[service0 xml]$ Verify that the documentation was generated and reflects - your changes by browsing to http://yoursite:8000/samplenote/doc + your changes by browsing to http://yoursite:8000/myfirstpackage/doc Add the new package to CVS @@ -114,20 +84,20 @@ traverse the directory tree manually and add as you go. (More on CVS) - [service0@yourserver xml]$ cd .. -[service0@yourserver doc]$ cd .. -[service0@yourserver www]$ cd .. -[service0@yourserver samplenote]$ cd .. -[service0@yourserver packages]$ cvs add samplenote/ -Directory /cvsroot/service0/packages/samplenote added to the repository -[service0@yourserver packages]$ cd samplenote/ -[service0@yourserver samplenote]$ cvs add www -Directory /cvsroot/service0/packages/samplenote/www added to the repository -[service0@yourserver samplenote]$ cd www -[service0@yourserver www]$ cvs add doc -Directory /cvsroot/service0/packages/samplenote/www/doc added to the repository -[service0@yourserver www]$ cd doc -[service0@yourserver doc]$ cvs add * + [service0 xml]$ cd .. +[service0 doc]$ cd .. +[service0 www]$ cd .. +[service0 myfirstpackage]$ cd .. +[service0 packages]$ cvs add myfirstpackage/ +Directory /cvsroot/service0/packages/myfirstpackage added to the repository +[service0 packages]$ cd myfirstpackage/ +[service0 myfirstpackage]$ cvs add www +Directory /cvsroot/service0/packages/myfirstpackage/www added to the repository +[service0 myfirstpackage]$ cd www +[service0 www]$ cvs add doc +Directory /cvsroot/service0/packages/myfirstpackage/www/doc added to the repository +[service0 www]$ cd doc +[service0 doc]$ cvs add * cvs add: cannot add special file `CVS'; skipping cvs add: scheduling file `admin-guide.html' for addition cvs add: scheduling file `bi01.html' for addition @@ -150,63 +120,280 @@ cvs add: scheduling file `user-guide.html' for addition cvs add: scheduling file `user-interface.dia' for addition cvs add: scheduling file `user-interface.png' for addition -Directory /cvsroot/service0/packages/samplenote/www/doc/xml added to the repository +Directory /cvsroot/service0/packages/myfirstpackage/www/doc/xml added to the repository cvs add: use 'cvs commit' to add these files permanently -[service0@yourserver doc]$ cd xml -[service0@yourserver xml]$ cvs add Makefile index.xml +[service0 doc]$ cd xml +[service0 xml]$ cvs add Makefile index.xml cvs add: scheduling file `Makefile' for addition cvs add: scheduling file `index.xml' for addition cvs add: use 'cvs commit' to add these files permanently -[service0@yourserver xml]$ cd ../../.. -[service0@yourserver samplenote]$ cvs commit -m "new package" +[service0 xml]$ cd ../../.. +[service0 myfirstpackage]$ cvs commit -m "new package" cvs commit: Examining . cvs commit: Examining www cvs commit: Examining www/doc cvs commit: Examining www/doc/xml -RCS file: /cvsroot/service0/packages/samplenote/www/doc/admin-guide.html,v +RCS file: /cvsroot/service0/packages/myfirstpackage/www/doc/admin-guide.html,v done Checking in www/doc/admin-guide.html; -/cvsroot/service0/packages/samplenote/www/doc/admin-guide.html,v <-- admin-guide.html +/cvsroot/service0/packages/myfirstpackage/www/doc/admin-guide.html,v <-- admin-guide.html initial revision: 1.1 done (many lines omitted) -[service0@yourserver samplenote]$ +[service0 myfirstpackage]$ + + Adding Comments + You can track comments for any ACS Object. Here we'll track + comments for notes. On the note-edit.tcl/adp pair, which is used to + display individual notes, we want to put a link to add comments at + the bottom of the screen. If there are any comments, we want to + show them. + First, we need to generate a url for adding comments. In note-edit.tcl: + + set comment_add_url "[general_comments_package_url]comment-add?[export_vars { + { object_id $note_id } + { object_name $title } + { return_url "[ad_conn url]?[ad_conn query]"} + }]" + + This calls a global, public tcl function that the + general_comments package registered, to get its url. You then + embed in that url the id of the note and its title, and set the + return_url to the current url so that the user can return after + adding a comment. + We need to create html that shows any existing comments. + We do this with another general_comments function: + set comments_html [general_comments_get_comments + -print_content_p 1 $note_id] + First, we pass in an optional parameter that that says to actually + show the contents of the comments, instead of just the fact that + there are comments. Then you pass the note id, which is also the + acs_object id. + We put our two new variables in the note-edit.adp + page. + <a href="@comment_add_url@">Add a comment</a> + @comments_html@ + + + Admin Pages + + There are at least two flavors of admin user interface: + + + Admins use same pages as all other users, except + that they are offered admin links and buttons where appropriate. + For example, if admins have privilege to bulk-delete items you + could provide checkboxes next to every item seen on a list and the + Delete Selected button on the bottom of the list. + + Dedicated admin pages. If you want admins to have + access to data that users aren't interested in or aren't allowed + to see you will need dedicated admin pages. The conventional + place to put those dedicated admin pages is in the + /var/lib/aolserver/service0/packages/myfirstpackage/www/admin + directory. + +[service0 www]$ mkdir admin +[service0 www]$ cd admin + + Even if your application doesn't need any admin pages of its own you will + usually need at least one simple page with a bunch of links to existing + administration UI such as Category Management or standard Parameters UI. + Adding the link to Category Management is described in the section on + categories. The listing below adds a link to the Parameters UI of our + package. + +[service0 admin]$ vi index.adp + +<master> +<property name="title">@title;noquote@</property> +<property name="context">@context;noquote@</property> + +<ul class="action-links"> + <li><a href="@parameters_url@" title="Set parameters" class="action_link">Set parameters</a></li> +</ul> + +[service0 admin]$ vi index.tcl + +ad_page_contract {} { +} -properties { + context_bar +} + +set package_id [ad_conn package_id] + +set admin_p [ad_require_permission $package_id admin] + +set context [list] + +set title "Administration" + +set parameters_url [export_vars -base "/shared/parameters" { + package_id { return_url [ad_return_url] } +}] + + + + +Now that you have the first admin page it would be nice to have a link to it +somewhere in the system so that admins don't have to type in the +/admin every time they need to reach it. You +could put a static link to the toplevel +index.adp but that might be distracting for +people who are not admins. Besides, some people consider it impolite to first +offer a link and then display a nasty "You don't have permission to access this +page" message. + + +In order to display the link to the admin page only to users that have admin +privileges add the following code near the top of +/var/lib/aolserver/service0/packages/myfirstpackage/www/admin/index.tcl: + + + +set package_id [ad_conn package_id] + +set admin_p [permission::permission_p -object_id $package_id \ + -privilege admin -party_id [ad_conn untrusted_user_id]] + +if { $admin_p } { + set admin_url "admin" + set admin_title Administration +} + + +In +/var/lib/aolserver/service0/packages/myfirstpackage/www/admin/index.adp put: + + +<if @admin_p@ ne nil> + <a href="@admin_url@">@admin_title@</a> +</if> + + + + + + + - Delete with confirmation - We need a way to delete records. We'll create a - recursive confirmation page. - Add this column to the table_def in index.tcl - {delete "" {} {<td><a href="note-delete?note_id=$note_id">Delete</a></td>}} - Create the delete confirmation/execution page. - [service0@yourserver www]$ emacs note-delete.tcl - ad_page_contract { - A page that gets confirmation and then delete notes. + Categories - @author joel@aufrecht.org - @creation-date 2003-02-12 - @cvs-id $Id$ -} { - note_id:integer - confirm_p:optional + You can associate any ACS Object with one or more categories. + In this tutorial we'll show how to equip your application with user + interface to take advantage of the Categories service. + + + We'll start by installing the Categories service. Go to + /acs/admin and install it. This step + won't be necessary for the users of your applications because you'll create + a dependency with the Package Manager which will take care that the + Categories service always gets installed when your application gets + installed. + + + Now that we have installed the Categories service we can proceed to + modifying our application so that it can take advantage of it. We'll do it + in three steps: + + + + The Categories service provides a mechanism to associate one or + more category trees that are relevant to + your application. One example of such tree is a tree of + geographical locations. Continents are on the top of such tree, + each continent containing countries etc. Another tree might + contain market segments etc. Before users of your application + can take advantage of the Categories service there needs to be a + way for administrators of your application to choose which + category trees are applicable for the application. + + + The way to achieve this is is to provide a link + to the Category Management pages. Add the following snippet to your + /var/lib/aolserver/service0/packages/myfirstpackage/www/admin/index.tcl + file: + + +set category_map_url [export_vars -base \ + "[site_node::get_package_url -package_key categories]cadmin/one-object" \ + { { object_id $package_id } }] + + + and the following snippet to your + /var/lib/aolserver/service0/packages/myfirstpackage/www/admin/index.adp + file: + + +<li><a href="@category_map_url@" + class="action_link">Site-Wide Categories</a> + + The link created by the above code will take the admin to the generic + admin UI where he can pick category trees that make sense for this + application. The same UI also includes facilities to build and edit + category trees. Notice that the only parameter in this example is + package_id so that category trees + will be associated with the object identified by this + package_id. The categorization + service is actually more general than that: instead of + package_id you could use an ID of + some other object that serves as a "container" in your application. + For example, if your discussion forums application supports multiple + forums you would use forum_id to + associate category trees with just that one forum rather than the + entire application instance. + + + Once the category trees have been selected users need a way + to categorize items. The easiest way to do this is by adding the + category widget type of the + form builder to note-edit.tcl. + To achieve this we'll need to use the -extend + switch to the ad_form command. Here's the "meat" of the + note-edit.tcl page: + +ad_form -name note -form { + {item_id:key} + {title:text {label Title}} } -set title "Delete Note" +set package_id [ad_conn package_id] -if {![exists_and_not_null confirm_p]} { - # first pass, not confirmed. Display a form for confirmation - set note_name [db_string get_name { *SQL }] - set title "Delete $note_name" - template::form::create note-del-confirm - template::element::create note-del-confirm note_id -value $note_id -widget hidden - template::element::create note-del-confirm confirm_p -value 1 -widget hidden - template::element::create note-del-confirm submit \ - -label "Confirm deletion of $note_name" \ - -widget submit -} else { - # second pass, confirmed. Call the database to delete the record - db_1row do_delete { *SQL* } - ad_returnredirect "index" +set category_trees [category_tree::get_mapped_trees $package_id] + +foreach tree $category_trees { + foreach { tree_id name subtree_id } $tree {} + ad_form -extend -name note -form \ + [list [list category_id_${tree_id}:integer(category),optional \ + {label $name} \ + {html {single single}} \ + {category_tree_id $tree_id} \ + {category_subtree_id $subtree_id} \ + {category_object_id {[value_if_exists entry_id]}}]] +} + +ad_form -extend \ + -name note \ + -new_request { + permission::require_permission -object_id [ad_conn package_id] -privilege create + set page_title "Add a Note" + set context [list $page_title] +} -edit_request { + permission::require_write_permission -object_id $item_id + mfp::note::get \ + -item_id $item_id \ + -array note_array + + set title $note_array(title) + + set page_title "Edit a Note" + set context [list $page_title] +} -new_data { + mfp::note::add \ + -title $title +} -after_submit { + ad_returnredirect "." ad_script_abort } This page requires a @@ -248,7 +435,11 @@ </form> The ADP is very simple. The formtemplate tag outputs the HTML -form generated by the ad_form command with the matching name. Test it by adding the new files in the APM and then deleting a few samplenotes. +form generated by the ad_form command with the matching name. Test it + by adding the new files in the APM and then deleting a few + samplenotes. + + General comments @@ -415,10 +606,8 @@ contain market segments etc. Before users of your application can take advantage of the Categories service there needs to be a way for administrators of your application to choose which - category trees are applicable for the application. + category trees are applicable for the application. - - The way to achieve this is is to provide a link to the Category Management pages. Add the following snippet to your /var/lib/aolserver/service0/packages/myfirstpackage/www/admin/index.tcl @@ -438,7 +627,7 @@ <li><a href="@category_map_url@" class="action_link">Site-Wide Categories</a> - The link created by the above code will take the admin to the generic + The link created by the above code will take the admin to the generic admin UI where he can pick category trees that make sense for this application. The same UI also includes facilities to build and edit category trees. Notice that the only parameter in this example is @@ -663,4 +852,25 @@ look at the forums package. + Future Topics: + + How to enforce security so that users can't + change other users records + + How to use the content management tables so that + ... what? + How to change the default stylesheets for Form + Builder HTML forms. + How to make your package searchable with OpenFTS/Oracle + How to prepare pagelets for inclusion in other pages + How and when to put procedures in a tcl procedure library + More on ad_form - data validation, other stuff. + (plan to draw from Jon Griffin's doc) + How and when to implement caching + partialquery in xql + How to use the html/text entry widget to get the + "does this look right" confirm page + APM package dependencies + + See also the OpenACS Programming FAQ Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-db.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-db.xml,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-db.xml 26 Jan 2004 15:39:44 -0000 1.9 +++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-db.xml 4 Feb 2004 16:47:34 -0000 1.10 @@ -49,6 +49,14 @@ url="/doc/acs-content-repository">More information about the Content Repository.) +
                  + Tutorial Data Model + + + + + +
                  The top of each sql file has some standard comments, including doc tags such as @author which will be picked up @@ -68,7 +76,6 @@ object. Notice the use of "mfp." This token, derived from "My First Package," ensures that our object is unlikely to conflict with objects from other packages. - Create a database file to drop everything if the package is uninstalled. Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-debug.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-debug.xml,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-debug.xml 2 Feb 2004 08:32:36 -0000 1.6 +++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-debug.xml 4 Feb 2004 16:47:34 -0000 1.7 @@ -1,15 +1,11 @@ - %myvars; ]> Debugging and Automated Testing - - This section is a work in progress. - - by Joel Aufrecht @@ -27,20 +23,19 @@ PostgreSQL You can work directly with the database to do debugging steps like looking directly at tables and testing stored - procedures. Start emacs. Type + procedures. Start emacs. Type M-x sql-postgres. Press enter for - server name and use openacs-dev for + server name and use service0 for database name. You can use C-(up arrow) and C-(down arrow) - for command history. + for command history. Hint: "Parse error near *" usually means that an xql file wasn't recognized, because the tcl file is choking on the *SQL* placeholder that it falls back on. Watching the server log - NOTE: explain how to add tcl to directly write your own - log output + To set up real-time monitoring of the AOLserver error log, type less /var/lib/aolserver/service0/log/openacs-dev-error.log @@ -50,7 +45,7 @@ ? searches backward / searches forward. - + Manual testing @@ -74,6 +69,21 @@ The text added in the form should be visible on the index page. + + API-001 + Invoke mfp::note::create with a specific word as the title. + Proc should return an object id. + + + API-002 + Given an object id from API-001, invoke mfp::note::get. + Proc should return the specific word in the title. + + + API-003 + Given the object id from API-001, invoke mfp::note::delete. + Proc should return 0 for success. + Other things to test: try to delete someone else's note. Try to delete your own note. Edit your own note. @@ -84,129 +94,64 @@ Write automated tests - by Simon Carstensen + by Simon Carstensen and Joel Aufrecht - - Automated tests -It seems to me that a lot of -people have been asking for some guidelines on how to write automated -tests. I've done several tests by now and have found the process to be -extremely easy and useful. It's a joy to work with automated testing -once you get the hang of it. - - I just wrote a test script for the acs-service-contract package and -thought I'd might as well post a step-by-step run-through, since some -people have been asking for this. Here goes. - - - - Create the directory that will contain the test - script(s): - -$ cd /web/simon/packages/acs-service-contract/tcl -$ mkdir test - - - - Create the .tcl library that holds the test - procs: - -$ cd test -$ emacs acs-service-contract-procs.tcl - - - - Write the tests. This is obviously the big step - :) - -The script should first call ad_library like any normal -procs.tcl file: - -ad_library { + Automated tests + It seems to me that a lot of people have been asking for some guidelines on how to write automated tests. I've done several tests by now and have found the process to be extremely easy and useful. It's a joy to work with automated testing once you get the hang of it. + Create the directory that will contain the test + script and edit the script file. The directory location and file name are standards which are recognized by the automated testing package: + [service0 www]$ mkdir /var/lib/aolserver/service0/packages/myfirstpackage/tcl/test +[service0 www]$ cd /var/lib/aolserver/service0/packages/myfirstpackage/tcl/test +[service0 test]$ emacs myfirstpackages-procs.tcl + Write the tests. This is obviously the big step :) The script should first call ad_library like any normal -procs.tcl file: + ad_library { ... } To create a test case you call aa_register_case test_case_name.. Once you've created the test case you start writing the needed logic. -Let's say you just wrote an API for adding and deleting notes in the +We'll use the tutorial package, "myfirstpackage," as an example. +Let's say you just wrote an API for adding and deleting notes in the notes packages and wanted to test that. You'd probably want to write a test that first creates a note, then verifies that it was inserted, then perhaps deletes it again, and finally verifies that it is -gone. +gone. + + Naturally this means you'll be adding a lot of bogus data to the database, which you're not really interested in having there. To avoid this I usually do two things. I always put all my test code inside a call to aa_run_with_teardown which basically means that all the inserts, deletes, and updates will be rolled back once the test has been executed. A very useful feature. Instead of inserting bogus data -like: set name "Simon", I tend to generate a random script in order avoid inserting a value that's already in the database: +like: set name "Simon", I tend to generate a random script in order avoid inserting a value that's already in the database: set name [ad_generate_random_string] Here's how the test case looks so far: -aa_register_case acs_sc_impl_new_from_spec { - - aa_run_with_teardown \ +aa_register_case mfp_basic_test { + My test +} { + aa_run_with_teardown \ -rollback \ - -testcode { - ... logic ... + -test_code { + } } - -Now let's look at the actual test code. That's the code that -goes inside -testcode {}. -In my case I had added a new column to acs_sc_impls (pretty_name), -which meant that I had to change the datamodel and the Tcl API to -support this new change. To make sure I didn't screw up, I wrote a test -that created a new service contract, then a new implementation of that -contract, and called acs_sc::impl::get to check that the data in the -new column had been added correctly and then finally verified that the -pretty_name was actually what I had tried to insert. It looked -something like this: -set spec { - name "foo_contract" - description "Blah blah" - ... -} - -# Create service contract -acs_sc::contract::new_from_spec -spec $spec - -set spec { - name "foo_impl" - description "Blah blah blah" - pretty_name "Foo Implementation" - ... -} - -# Create implementation -set impl_id [acs_sc::impl::new_from_spec -spec $spec] - -# Get the values of the implementation we just created -acs_sc::impl::get -impl_id $impl_id -array impl - -#Verify that the pretty_name column has the correct value -aa_equals "did column pretty_name get set correctly?" $impl(pretty_name) "Foo Implementation" - -Now you might not know how acs-service-contract works, but that -doesn't matter. I'm basically inserting data into the database, then -querying for the database to check that it got inserted and then -finally, using aa_equals, I compare the result with what I inserted to -verify that everything is correct. - -There are number of other useful procs for determening whether a test case was successful or not, namely: - - aa_true "is this true?" [expr ![empty_string $foo]] -aa_false "is this true?" [empty_string $foo] - There a number of other useful procs and I will encourage you to -look at the few packages for which tests have already been implemented. -That is perhaps the best documentation we have so far. See also . - - - +Now let's look at the actual test code. That's the code that +goes inside -test_code {}. We want to implement test case API-001, "Given an object id from API-001, invoke mfp::note::get. Proc should return the specific word in the title." + + set name [ad_generate_random_string] + set new_id [mfp::note::add -title $name] + aa_true "Note add succeeded" [exists_and_not_null new_id] + To test our simple case, we must load the test file into the system (just as with the /tcl file in the basic tutorial, since the file didn't exist when the system started, the system doesn't know about it.) To make this file take effect, go to the APM and choose "Reload changed" for "MyFirstPackage". Since we'll be changing it frequently, select "watch this file" on the next page. This will cause the system to check this file every time any page is requested, which is bad for production systems but convenient for developing. + Once the file is loaded, go to ACS Automated Testing and click on myfirstpackage. You should see your test case. Run it and examine the results. + Now we can add the rest of the API tests. The complete test looks like: + example missing + See also . - Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-pages.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-pages.xml,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-pages.xml 4 Feb 2004 14:50:09 -0000 1.9 +++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-pages.xml 4 Feb 2004 16:47:34 -0000 1.10 @@ -15,10 +15,22 @@ Install some API As a workaround for missing content-repository functionality, copy a provided file into the directory for tcl files: - cp /var/lib/aolserver/service0/packages/acs-core-docs/www/files/note-procs.tcl /var/lib/aolserver/service0/packages/myfirstpackage/tcl/ + cp /var/lib/aolserver/service0/packages/acs-core-docs/www/files/note-procs.tcl /var/lib/aolserver/service0/packages/myfirstpackage/tcl/ To make this file take effect, go to the APM and choose "Reload changed" for "MyFirstPackage". + Page Map + Our package will have two visible pages. The first shows a list of all objects; the second shows a single object in view or edit mode, and can also be used to add an object. The index page will display the list, but since we might reuse the list later, we'll put it in a seperate file and include it on the index page. +
                  + Page Map + + + + + +
                  +
                  + Build the "Index" page Each user-visible page in your package has, typically, three parts. The tcl file @@ -31,139 +43,32 @@ database-specific SQL. The default page in any directory is index, so we'll build that first, starting with the tcl file: - [service0 postgresql]$ cd /var/lib/aolserver/service0/myfirstpackages/www + [service0 postgresql]$ cd /var/lib/aolserver/service0/packages/myfirstpackages/www [service0 www]$ emacs index.tcl Paste this into the file. - ad_page_contract { - This is the main page for the package. It displays all of the Notes and provides links to edit them and to create new Notes. - - @author Your Name (you@example.com) - @cvs-id $Id$ -} - -set page_title [ad_conn instance_name] -set context [list] - -template::list::create \ - -name notes \ - -multirow notes \ - -actions { "Add a Note" note-edit} \ - -elements { - edit { - link_url_col edit_url - display_template { - <img src="/resources/acs-subsite/Edit16.gif" width="16" height="16" border="0"> - } - sub_class narrow - } - title { - label "Title" - } - delete { - link_url_col delete_url - display_template { - <img src="/resources/acs-subsite/Delete16.gif" width="16" height="16" border="0"> - } - sub_class narrow - } - } - -db_multirow \ - -extend { - edit_url - delete_url - } notes notes_select { - select ci.item_id, - n.title - from cr_items ci, - mfp_notesx n - where n.revision_id = ci.live_revision - } { - set edit_url [export_vars -base "note-edit" {item_id}] - set delete_url [export_vars -base "note-delete" {item_id}] - } - - + example missing Now index.adp: - -<master> - <property name="title">@page_title;noquote@</property> - <property name="context">@context;noquote@</property> -<listtemplate name="notes"></listtemplate> - - Now we create the add/edit page. If note_id is passed in, - it edits that note. Otherwise, it presents a form for adding - notes. Edit - note-edit.tcl: - ad_page_contract { - This is the view-edit page for notes. + example missing + You can test your work by viewing the page. + The index page includes the list page, which we put in /lib instead of /www to designate that it's available for reuse by other packages. + [service0 www]$ mkdir /var/lib/aolserver/service0/packages/myfirstpackage/lib +[service0 www]$ cd /var/lib/aolserver/service0/packages/myfirstpackage/lib +[service0 lib]$ emacs note-list.tcl + example missing +[service0 lib]$ emacs note-list.adp +example missing + Create the add/edit page. If note_id is passed in, + it display that note, and can change to edit mode if appropriate. Otherwise, it presents a form for adding notes. + [service0 lib]$ cd /var/lib/aolserver/service0/packages/myfirstpackage/www +[service0 www]$ emacs note-edit.tcl + example missing +[service0 www]$ emacs note-edit.adp + example missing - @author Your Name (you@example.com) - @cvs-id $Id$ - - @param item_id If present, assume we are editing that note. Otherwise, we are creating a new note. -} { - item_id:integer,optional -} - -ad_form -name note -form { - {item_id:key} - {title:text {label Title}} -} -new_request { - permission::require_permission -object_id [ad_conn package_id] -privilege create - set page_title "Add a Note" - set context [list $page_title] -} -edit_request { - permission::require_write_permission -object_id $item_id - mfp::note::get \ - -item_id $item_id \ - -array note_array - - set title $note_array(title) - - set page_title "Edit a Note" - set context [list $page_title] -} -new_data { - mfp::note::add \ - -title $title \ - -item_id $item_id - set message "Note $title added" -} -edit_data { - mfp::note::edit \ - -item_id $item_id \ - -title $title - set message "Note $title changed" -} -after_submit { - ad_returnredirect -message $message "." - ad_script_abort -} - And note-edit.adp: - <master> - <property name="title">@page_title;noquote@</property> - <property name="context">@context;noquote@</property> - <property name="focus">note.title</property> - -<formtemplate id="note"></formtemplate> And the delete page. Since it has no UI, there is only a - tcl page, and no adp page. Edit -note-delete.tcl: - ad_page_contract { - This deletes a note - - @author Your Name (you@example.com) - @cvs-id $Id$ - - @param item_id The item_id of the note to delete -} { - item_id:integer -} - -permission::require_write_permission -object_id $item_id -set title [item::get_title $item_id] -mfp::note::delete -item_id $item_id -ad_returnredirect -message "Item $title deleted." "." - - + tcl page, and no adp page. +[service0 www]$ emacs note-delete.tcl + example missing Index: openacs-4/packages/acs-core-docs/www/xml/engineering-standards/eng-standards-versioning.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/engineering-standards/eng-standards-versioning.xml,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/acs-core-docs/www/xml/engineering-standards/eng-standards-versioning.xml 11 Dec 2003 21:39:49 -0000 1.5 +++ openacs-4/packages/acs-core-docs/www/xml/engineering-standards/eng-standards-versioning.xml 4 Feb 2004 16:47:35 -0000 1.6 @@ -9,6 +9,7 @@ By Ron Henderson +Revised by Joel Aufrecht @@ -18,55 +19,62 @@
                  -major-minor-release +major.minor.dot[ milestone ]
                  - -A change in the major version number indicates a fundamental -change in the architecture of the system, e.g. OpenACS 3 to ACS 4. A -change in the minor version number signifies the addition of -new modules and minor data model changes, e.g. OpenACS 3.1 to OpenACS 3.2. -The final release number indicates the relative maturity of a -release and marks things like bug fixes; it follows the ordered -progression: - - + + + A major number change indicates a fundamental change in the architecture of the system, e.g. OpenACS 3 to ACS 4. A major change is required if core backwards compatibility is broken, if upgrade is non-trivial, or if the platform changes substantially. + + + A minor change represents the addition of new functionality or changed UI. + + + A dot holds only bug fixes and security patches. Dot releases are always recommended and safe. + + + + A milestone marker indicates the state of the release: + + + d, for development, means the release is in active development and is not in its intended released form. + + + a, for alpha, means new development is complete and code checkins are frozen. Alpha builds should work well enough to be testable. + + + b, for beta, means most severe bugs are fixed and end users can start trying the release. + + + Release Candidate builds (rc) are believed to meet all of the criteria for release and can be installed on test instances of production systems. + + + Final releases have no milestone marker. (Exception: In CVS, they are tagged with -final to differentiate them from branch tags.) + + + + Milestone markers are numbered: d1, d2, ..., a1, b1, rc1, etc. + + +A complete sequence of milestones between two releases: +5.0.0 +5.0.0rc2 +5.0.0rc1 +5.0.0b4 +5.0.0b1 +5.0.0a4 +5.0.0a3 +5.0.0a1 +5.0.0d1 +4.6.3 - -alpha -beta -0 (production release) -1 -2 -... - - -So typical release version numbers would be: - - - - -openacs-3.2.5 -openacs-4.0.beta - - - -The first is a relatively mature release of the OpenACS 3.2 base code -and the second is a non-public release of OpenACS 4.0 that probably still -has lots of bugs. - - - Version numbers are also recorded in the CVS repository so that the code tree can be restored to the exact state it was in for a particular release. To translate between a distribution tar file -(acs-3.2.2.tar.gz) and a CVS tag, just swap '.' for '-' and add the -release date. The entire release history of the toolkit is recorded -in the tags for the top-level readme.txt file: +(acs-3.2.2.tar.gz) and a CVS tag, just swap '.' for '-'.The entire release history of the toolkit is recorded in the tags for the top-level readme.txt file: - > cvs log readme.txt RCS file: /usr/local/cvsroot/acs/readme.txt,v @@ -114,60 +122,10 @@ So what distinguishes an alpha release from a beta release? Or from a production release? We follow a specific set of rules for how OpenACS makes the transition from one state of maturity to -the next. +the next. These rules are fine-tuned with each release; an example is 5.0.0 Milestones and Milestone Criteria - Every release must pass the minimum requirements that it cleanly -installs and cleanly upgrades from the previous version of OpenACS. In -addition to this the release label implies: - -
                  - - - -development - - -This is the default state for the head of the current release branch. We -make no guarantees about this code. - - - -alpha - - -All tickets of severity critical have been closed and the -distribution has no known installation or upgrade problems. - - - -beta - - -All tickets of severity serious or greater have been closed -and all documentation is up to date (version history, release notes, -new module docs, etc.). - - - -production [0, 1, ...] - - -All tickets of severity medium or greater have been closed, -including issues reported from outside users. - - - -
                  - - In the future we will guarantee that more mature releases -incorporate all the fixes for earlier problems by developing a -detailed set of regression tests. For now we try to enforce this by -restricting work on the release branch to fixing reported problem in -the current release, e.g. no new features or big changes to -fundamental behavior. - ($Id$) - + Index: openacs-4/packages/acs-core-docs/www/xml/install-guide/aolserver4.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/install-guide/aolserver4.xml,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-core-docs/www/xml/install-guide/aolserver4.xml 26 Jan 2004 15:39:44 -0000 1.2 +++ openacs-4/packages/acs-core-docs/www/xml/install-guide/aolserver4.xml 4 Feb 2004 16:47:35 -0000 1.3 @@ -172,6 +172,11 @@ + + Change startup script (optional). + If you want to run AOLserver on a port below 1024 (normally, for a webserver you will use 80), you will have to change the /var/lib/aolserver/service0/etc/daemontools/run script according to the documentation found there (namely: Add the -b yourip:yourport switch) + + Test AOLserver. Index: openacs-4/packages/acs-core-docs/www/xml/install-guide/configuring.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/install-guide/configuring.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-core-docs/www/xml/install-guide/configuring.xml 4 Feb 2004 16:47:35 -0000 1.2 @@ -0,0 +1,101 @@ + + +%myvars; +]> + + Configuring a new OpenACS Site + + + by Joel Aufrecht + + + In this chapter, Configuring refers to making changes to a new OpenACS site through the web interface. In crude terms, these changes happen in the database, and are upgrade-safe. Customizing refers to changes that touch the file system, and require some planning if easy upgradability is to be maintained. + + + How Do I? + + How do I edit the front page of a new site through a web interface? + The easiest way is to install the Edit-This-Page package. + + + Log in to the web site as an administrator. + + + Click on Admin > Install Software > Install from OpenACS Repository / Install new application + + + Choose Edit This Page and install + + + Follow the instructions within Edit This Page (the link will only work after Edit This Page is installed). + + + + + How do I let anybody who registers post to a weblog? + Go to /admin/permissions and grant Create to Registered Users + + + How do I replace the front page of a new site with the front page of an application on that site + Suppose you install a new site and install Weblogger, and you want all visitors to see weblogger automatically. + + + On the front page, click the Admin button. + + + On the administration page, click Parameters link. + + + Change the parameter IndexRedirectUrl to be the URI of the desired application. For a default weblogger installation, this would be weblogger/. Note the trailing slash. + + + + + How do I put custom functionality on front page of a new site? + Every page within an OpenACS site is part of a subsite More information). The home page of the entire site is the front page is a special, default instance of a subsite, served from /var/lib/aolserver/service0/www. If an index page is not found there, the default index page for all subsites is used. To customize the code on the front page, copy the default index page from the Subsite package to the Main site and edit it: + + + cp /var/lib/aolserver/service0/packages/acs-subsite/www/index* /var/lib/aolserver/service0/www + + + Edit the new index.adp to change the text; you shouldn't need to edit index.tcl unless you are adding new functionality. + + + + + How do I change the site-wide style? + Almost all pages on an OpenACS site use ACS Templating, and so their appearance is driven by a layer of different files. Let's examine how this works: + + + + A templated page uses an ADP/TCL pair. The first line in the ADP file is usually: + + <master> + If it appears exactly like this, without any arguments, the template processer uses default-master for that subsite. For pages in /var/lib/aolserver/service0/www, this is /var/lib/aolserver/service0/www/default-master.adp and the associated .tcl file. + + + + The default-master is itself a normal ADP page. It draws the subsite navigation elements and invokes site-master (/var/lib/aolserver/service0/www/site-master.adp and .tcl) + + + The site-master draws site-wide navigation elements and invokes blank-master (/var/lib/aolserver/service0/www/blank-master.adp and .tcl). + + + Blank-master does HTML housekeeping and provides a framework for special sitewide navigation "meta" elements such as Translator widgets and Admin widgets. + + +
                  + Site Templates + + + + + +
                  +
                  + +
                  +
                  + Index: openacs-4/packages/acs-core-docs/www/xml/install-guide/maintenance-performance.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/install-guide/Attic/maintenance-performance.xml,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-core-docs/www/xml/install-guide/maintenance-performance.xml 23 Jan 2004 15:16:02 -0000 1.2 +++ openacs-4/packages/acs-core-docs/www/xml/install-guide/maintenance-performance.xml 4 Feb 2004 16:47:35 -0000 1.3 @@ -19,7 +19,7 @@ Isolating and solving database problems. - Without daily internal maintenance, most databases slowly degrade in performance. For PostGreSQL, see . For Oracle, "gather schema stats" (more info?). + Without daily internal maintenance, most databases slowly degrade in performance. For PostGreSQL, see . For Oracle, use exec dbms_stats.gather_schema_stats('SCHEMA_NAME') (Andrew Piskorski's Oracle notes). You can track the exact amount of time each database query on a page takes: Index: openacs-4/packages/acs-core-docs/www/xml/install-guide/maintenance.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/install-guide/maintenance.xml,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/acs-core-docs/www/xml/install-guide/maintenance.xml 26 Jan 2004 15:39:44 -0000 1.7 +++ openacs-4/packages/acs-core-docs/www/xml/install-guide/maintenance.xml 4 Feb 2004 16:47:35 -0000 1.8 @@ -1,23 +1,24 @@ - %myvars; ]> - - Hosting Web Sites + + Running OpenACS in Production Environments + By Joel Aufrecht Maintenance tasks, optional software, and alternate configurations for AOLserver. - Keep AOLserver Alive + Starting and Stopping an OpenACS instance. - Assuming AOLserver started cleanly in the previous step, we'll set it up so that it's always running, and automatically restarts whenever it dies or is stopped. This step is strongly recommended, even for development sites, because it makes install and maintenance much simpler. - + The simplest way to start and stop and OpenACS site is to run the startup shell script provided, /var/lib/aolserver/service0/etc/daemontools/run. This runs as a regular task, and logs to the logfile. To stop the site, kill the script. + A more stable way to run OpenACS is with a "keepalive" mechanism of some sort, so that whenever the server halts or is stopped for a reset, it restarts automatically. This is recommended for development and production servers. The Reference Platform uses Daemontools to control AOLserver. A simpler method, using init, is here. Index: openacs-4/packages/acs-core-docs/www/xml/install-guide/openacs.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/install-guide/openacs.xml,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/acs-core-docs/www/xml/install-guide/openacs.xml 26 Jan 2004 15:39:44 -0000 1.17 +++ openacs-4/packages/acs-core-docs/www/xml/install-guide/openacs.xml 4 Feb 2004 16:47:35 -0000 1.18 @@ -60,11 +60,8 @@ - Install with automated script (EXPERIMENTAL) - Starting with OpenACS 5.0, an experimental script is - available to automate all of the steps for the rest of this - section. Requires tclwebtest. If you are not feeling lucky, skip to . + Install with automated script + A bash script is available to automate all of the steps for the rest of this section. It requires tclwebtest. The automated script can greatly accelerate the install process, but is very sensitive to the install environment. We recommend that you run the automated install and, if it does not work the first time, consider switching to a manual installation. Get the install script from CVS. It is located within the main cvs tree, at /etc/install. Use anonymous CVS checkout to get that directory in the home directory of the @@ -80,23 +77,23 @@ U install/tcl/twt-procs.tcl U install/tcl/user-procs.tcl [service0 service0]$ cd install -[service0 install]$ +[service0 install]$ emacs install.tcl - Edit - /home/service0/install/install.tcl - and change the values as documented in the file. It will work - unchanged at 127.0.0.1:8000. - Run the file as root. + Edit the installation configuration file, /home/service0/install/install.tcl and update the site-specific values, such as the new service's IP address and name, which will be written into the new service's config.tcl file. If your system is different from the one described in the previous sections, check the file paths as well. Set do_checkout=yes to create a new OpenACS site directly from a CVS checkout, or =no if you have a fully configured site and just want to rebuild it (drop and recreate the database and repeat the installation). If you have followed a stock installation, the default configuration will work without changes and will install an OpenACS site at 127.0.0.1:8000. + Run the install script install.sh as root: [service0 service0]$ exit [root root]# sh /home/service0/install/install.sh /home/service0/install/install.sh: Starting installation with config_file /home/service0/install/install.tcl. Using serverroot=/var/lib/aolserver/ service0, server_url=http://0.0.0.0:8000, do_checkout=yes, do_install=yes, dotlrn=no, and database=postgres., use_daemontools=true - ... many lines omitted ... -./install.sh: Finished (re)installing /var/lib/aolserver/service0 at Wed Nov -5 13:27:17 CET 2003. Access the new site at http://127.0.0.1:8000 with admin -username admin@yourserver.test and password 1 + ... many lines omitted ... +Tue Jan 27 11:50:59 CET 2004: Finished (re)installing /var/lib/aolserver/service0. +###################################################################### + New site URL: http://127.0.0.1:8000 +admin email : admin@yourserver.net +admin password: xxxx +###################################################################### [root root]# You can proceed to . @@ -572,7 +569,7 @@ You'll see the final Installer page, "OpenACS Installation: Complete." It will tell you that the server is being restarted; note that unless you already set up a way for - AOLserver to restart itself (ie. inittab or daemontools), + AOLserver to restart itself (ie. inittab or daemontools), you'll need to manually restart your service. [service0 service0]$ /usr/local/aolserver/bin/nsd-postgres -t /var/lib/aolserver/service0/config.tcl @@ -593,6 +590,9 @@ Next Steps + Use daemontools supervice and svc, or inittab, to automate server startup and shutdown. + + Install Full Text Search (OPTIONAL). If you have installed OpenFTS and enabled OpenFTS, you can now install the OpenFTS Driver package and @@ -611,7 +611,7 @@ Follow the instruction on the home page to change the appearance of your service or add more - packages. (more information) + packages. (more information) Proceed to the tutorial to learn how to develop your own packages. Index: openacs-4/packages/acs-core-docs/www/xml/install-guide/overview.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/install-guide/overview.xml,v diff -u -N -r1.19 -r1.20 --- openacs-4/packages/acs-core-docs/www/xml/install-guide/overview.xml 26 Jan 2004 15:39:44 -0000 1.19 +++ openacs-4/packages/acs-core-docs/www/xml/install-guide/overview.xml 4 Feb 2004 16:47:35 -0000 1.20 @@ -72,119 +72,12 @@ linkend="individual-programs"/>) - All of the software that you will need is free and open-source, + All of the software mentioned is free and open-source, except for Oracle. You can obtain a free copy of Oracle for development purposes. This is described in the section. - - Version Compatibility Matrix - - - - - - - - - - - - - OpenACS Version - 3.2.5 - 4.5 - 4.6 - 4.6.1 - 4.6.2 - 4.6.3 - 5.0.0 - - - - - AOLserver - 3 - Verified - No - - - 3.3+ad13 - Untested - Verified - - - 3.3oacs1 - Untested - Verified - - - 3.4.2 - No - - - 3.4.2oacs1 - Untested - Verified - Untested - - - 3.5.5 - Untested - Verified - No - - - 4.0 - Untested - Verified - - - PostgreSQL - 7.0 - Verified - No - - - 7.2.x - Verified - No - - - 7.3.2 - 7.3.4 - No - Verified - - - 7.4 - No - Untested - - - Oracle - 8.1.6 - Verified - - - 8.1.7 - Verified - - - 9i - No - Untested - - - -
                  - - - - At the time of writing AOLserver 4.0 has been tested with OpenACS and works but has not been used in - production. OpenACS 5.0.0 installs successfully on PostgreSQL 7.4 and Oracle 9i but not all packages - outside core have been tested. - Index: openacs-4/packages/acs-core-docs/www/xml/install-guide/postgres.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/install-guide/postgres.xml,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/acs-core-docs/www/xml/install-guide/postgres.xml 26 Jan 2004 15:39:44 -0000 1.17 +++ openacs-4/packages/acs-core-docs/www/xml/install-guide/postgres.xml 4 Feb 2004 16:47:35 -0000 1.18 @@ -28,7 +28,7 @@ Debian - Debian users can install the package and add some backwards-compatibility links: + Debian users, especially Debian stable users, should install PostGreSQL from source as detailed below. Debian unstable users: the following process has been known to work: apt-get install postgresql postgresql-dev postgresql-doc ln -s /usr/include/postgresql/ /usr/include/pgsql ln -s /var/lib/postgres /usr/local/pgsql @@ -512,8 +512,5 @@ ($Id$) - - - Index: openacs-4/packages/acs-core-docs/www/xml/install-guide/software.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/install-guide/software.xml,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/acs-core-docs/www/xml/install-guide/software.xml 11 Dec 2003 21:39:49 -0000 1.11 +++ openacs-4/packages/acs-core-docs/www/xml/install-guide/software.xml 4 Feb 2004 16:47:35 -0000 1.12 @@ -18,6 +18,109 @@ a fully effective instance. + + Version Compatibility Matrix + + + + + + + + + + + + + OpenACS Version + 3.2.5 + 4.5 + 4.6 + 4.6.1 + 4.6.2 + 4.6.3 + 5.0.0 + + + + + AOLserver + 3 + Yes + No + + + 3.3+ad13 + Maybe + Yes + + + 3.3oacs1 + Maybe + Yes + + + 3.4.2 + No + + + 3.4.2oacs1 + Maybe + Yes + Maybe + + + 3.5.5 + Maybe + Yes + No + + + 4.0 + Maybe + Yes + + + PostgreSQL + 7.0 + Yes + No + + + 7.2.x + Yes + No + + + 7.3.2 - 7.3.4 + No + Yes + + + 7.4 + No + Maybe + + + Oracle + 8.1.6 + Maybe + Yes + + + 8.1.7 + Maybe + Yes + + + 9i + No + Yes + + + +
                  + <ulink url="http://openacs.org/projects/openacs/download/">OpenACS &version;</ulink> @@ -298,8 +401,7 @@ calender entries, and notes) is stored in the database. OpenACS seperates the database with an abstraction layer, which means that several different databases all function - identically. Currently OpenACS supports PostgreSQL 7.2 and - Oracle 8.1.7. While you can run the core OpenACS on any + identically. While you can run the core OpenACS on any supported database, not all contributed packages support all databases. Index: openacs-4/packages/acs-core-docs/www/xml/install-guide/upgrade.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/install-guide/upgrade.xml,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/acs-core-docs/www/xml/install-guide/upgrade.xml 26 Jan 2004 15:39:45 -0000 1.8 +++ openacs-4/packages/acs-core-docs/www/xml/install-guide/upgrade.xml 4 Feb 2004 16:47:35 -0000 1.9 @@ -49,7 +49,7 @@ Upgrading OpenACS - Upgrading 4.5 to 4.6.x + Upgrading 4.5 or higher to 4.6.3 upgrade OpenACS 4.5 to 4.6.x @@ -151,16 +151,21 @@ PostGreSQL - - You must use PostGreSQL 7.3.x or newer, or Oracle, to upgrade OpenACS beyond 4.6.3. (OpenACS 5.0 requires PostGreSQL 7.3; OpenACS versions prior to 4.6.3 do not support PostGreSQL 7.3; only OpenACS 4.6.3 supports both 7.2 and 7.3. Upgrade PostGreSQL to 7.3) + You must use PostGreSQL 7.3.x or newer to upgrade OpenACS beyond 4.6.3. See Upgrade PostGreSQL to 7.3; Back up the database and file system. + + + Upgrade the file system for packages/acs-kernel + + + - Upgrade the kernel manually: + Upgrade the kernel manually. (There is a script to do most of the rest: /contrib/misc/upgrade_4.6_to_5.0.sh on HEAD). You'll still have to do a lot of stuff manually, but automated trial and error is much more fun.) [root root]# su - service0 [service0 aolserver]$ cd /var/lib/aolserver/ service0/packages/acs-kernel/sql/postgresql/upgrade @@ -182,6 +187,12 @@ psql -f upgrade-5.0.0b3-5.0.0b4.sql service0
                  + Upgrade ACS Service Contracts manually: + [service0 aolserver]$ cd /var/lib/aolserver/ service0/packages/acs-service-contracts/sql/postgresql/upgrade +psql -f upgrade-4.7d2-4.7d3.sql service0 + + + Load acs-authentication data model. psql -f /var/lib/aolserver/service0/openacs-5/packages/acs-authentication/sql/postgresql/acs-authentication-create.sql service0 @@ -190,7 +201,7 @@ psql -f /var/lib/aolserver/service0/packages/acs-lang/sql/postgresql/acs-lang-create.sql service0 - Create a file which will be executed on startup which takes care of a few issues with authentication and internationalization: create service0/tcl/zzz-postload.tcl containing: + (This step may overlap with the two previous steps, but I think it's harmless?) Create a file which will be executed on startup which takes care of a few issues with authentication and internationalization: create service0/tcl/zzz-postload.tcl containing: if {![apm_package_installed_p acs-lang]} { apm_package_install -enable -mount_path acs-lang [acs_root_dir]/packages/acs-lang/acs-lang.info lang::catalog::import -locales [list "en_US"] @@ -217,7 +228,7 @@ - See also this forum post: Forum OpenACS Development: 4.6.3 upgrade to 5-HEAD: final results. + See also these forum posts: Forum OpenACS Development: 4.6.3 upgrade to 5-HEAD: final results, OpenACS 5.0 Upgrade Experiences. @@ -246,7 +257,7 @@ - Upgrading files for a site which is in a CVS repository + Upgrading files for a site in a private CVS repository @@ -296,6 +307,19 @@ + + + Upgrading files for a site using the OpenACS.org CVS repository + + + + [service0 ~]$ cd /var/lib/aolserver/service0 + [service0 service0]$ cvs up -Pd + (CVS feedback) + [service0 service0]$ + + +