Index: openacs-4/etc/install/README =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/README,v diff -u -N -r1.2 -r1.3 --- openacs-4/etc/install/README 5 Sep 2003 10:23:08 -0000 1.2 +++ openacs-4/etc/install/README 12 Oct 2003 08:31:41 -0000 1.3 @@ -1,98 +1,72 @@ -OpenACS/dotLRN automated install script +OpenACS and .LRN automated install and test scripts -Prerequisites: +*** Prerequisites in brief tclwebtest aolserver oracle or postgresql +For oracle a tablespace with same name as db user must exist user named service0 +root access to server see /packages/acs-core-docs/www/index.html for more documentation about installing OpenACS and its prerequisites -Quick Guide +*** Quick Guide edit config.tcl +su - ./install.sh By default, this will 1) stop any OpenACS service supervised at /var/lib/svscan/service0 2) drop the database service0 if it exists - 3) update or create a CVS HEAD checkout of OpenACS at + 3) create a CVS HEAD checkout of OpenACS at /var/lib/aolserver/service0 4) create the database service0 5) install OpenACS, including configuring the web-driven pages, to http://localhost:8000 -*** Before running install.sh script please check that: +The install.sh script can also be used to perform a full .LRN test +data setup, or to only perform a cvs checkout, or only recreate the +database. Invoke install.sh --help to see command line switches. -0) If you already have a server running that is to be recreated - move +*** Prerequisites + +1) If you already have a server running that is to be recreated - move away and save any local changes (patches) that you have made to the -source code. The whole source code tree of the server will be moved -away to temporary storage and deleted on the next recreation. Any -patches that you want to apply on recreation should be executed by a -script specified in the config file (see below) as -post_checkout_script. This script will be executed after checkout is -completed. Per default there is no such script but remember to use -such a script if you wish to copy for example a log directory and -AOLServer config file into the source tree of the server (to avoid -having to do this I usually keep my AOLServer config and log files -outside the source tree, i.e. under /usr/local/aolserver rather than - under /web/server_name). If you do keep such files in the server tree -you should save them before the checkout with the pre_checkout_script -(specify path in config file), otherwise any changes to the AOLServer -config file will be lost as the whole server tree is moved away for a -new checkout from CVS. +source code. If the do_checkout parameter is set to true the whole +source code tree of the server will be moved away to temporary storage +and deleted on the next recreation. Any patches that you want to apply +on recreation should be executed by a script specified in the config +file (see below) as post_checkout_script. This script will be executed +after checkout is completed. If you keep AOLserver config file and log +files under the server root dir you might want to save them before the +checkout with the pre_checkout_script (specify path in config file), +otherwise any changes to the AOLServer config file will be lost as the +whole server tree is moved away for a new checkout from CVS. -1) A tablespace must exist with the same name as the oracle user of +2) A tablespace must exist with the same name as the oracle user of the server. The oracle recreate script uses statements from http://www.pinds.com/acs-tips/oracle-statements. Make sure you are not connected to the database user that the server uses so that that user can be dropped (i.e. log out of any sqlplus or psql sessions you might have). -2) Use config.tcl.in (don't edit this file, it's just a template) to create +3) Use the config template config.tcl to create a server specific installation config file. Per default install.sh will use the file config.tcl in the same directory but you can specify any config file on the command line with the switch --config-file. -3) Make sure an AOLServer config file is prepared. You can use -/etc/config.tcl as a template you are probably better off using any -existing config files on your server as templates instead. As far as -I know TCLWebTest cannot handle port numbers in URLs so try -to avoid those (use port 80 or use virtual hosting). This is a known tcl bug: +4) Make sure an AOLServer config file is prepared. You can use +/etc/config.tcl as a template. -http://sourceforge.net/tracker/index.php?func=detail&aid=452217&group_id=10894&atid=110894 - -that is supposedly fixed in some recent version of TCL. - -4) If you are using supervise (svc) to manage your server you need - to create a run script and specify its path in - the variable run_script in the config file. You may use run.in - as a template. Per default the file run in the same directory as - install.sh will be used. - 5) The server you are to create/recreate must be under supervise (i.e. ln -s /web/dotlrn-test /service/dotlrn-test). 6) Make sure you have root access since you must run install.sh as root. -7) Fetch a fresh checkout from CVS of TclWebTest (see http://tclwebtest.sourceforge.net) and -specify the directory the tclwebtest executable resides in in your config file (the default config file is config.tcl). - -*** The install.sh script roughly does the following by default - (there are switches, use install.sh --help): - -1) Takes down your old server, moves away the old source code (be -careful so you don't loose local changes) and checks out new sources. - -2) Recreates the database user. - -3) Installs OpenACS and .LRN over HTTP using TclWebTest. - -4) Sets up a few .LRN users and classes with TclWebTest - -When the script finishes it brings the new server up so that you can -login with the site-wide admin user. There are switches to use PostgreSQL -rather than Oracle and to only install OpenACS, invoke -install.sh --help for details. +7) Fetch a fresh checkout from CVS of TclWebTest (see +http://tclwebtest.sourceforge.net) and specify the directory the +tclwebtest executable resides in in your config file (the default +config file is config.tcl). Index: openacs-4/etc/install/TODO =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/TODO,v diff -u -N -r1.1 -r1.2 --- openacs-4/etc/install/TODO 4 Sep 2003 16:51:26 -0000 1.1 +++ openacs-4/etc/install/TODO 12 Oct 2003 08:31:41 -0000 1.2 @@ -1 +1,2 @@ -- TclWebTest selects options in selects bases on label rather than value. I would like to be able to select based on value. \ No newline at end of file +- TclWebTest selects options in selects bases on label rather than value. I would like to be able to select based on value. +- Grep for TODO in this dir and in the tcl dir to see TODO comments in the scripts. Index: openacs-4/etc/install/tcl/dotlrn-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/dotlrn-procs.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/etc/install/tcl/dotlrn-procs.tcl 12 Oct 2003 01:10:13 -0000 1.4 +++ openacs-4/etc/install/tcl/dotlrn-procs.tcl 12 Oct 2003 08:31:28 -0000 1.5 @@ -9,7 +9,7 @@ ad_proc ::twt::dotlrn::add_term { server_url term_name start_month start_year end_month end_year } { - ::twt::do_request "$server_url/dotlrn/admin/term-new" + ::twt::do_request "/dotlrn/admin/term-new" form find ~n add_term field find ~n "term_name" @@ -53,12 +53,12 @@ ad_proc ::twt::dotlrn::class_admin_url { {-term_id "-1"} } { - return "dotlrn/admin/term?term_id=$term_id" + return "/dotlrn/admin/term?term_id=$term_id" } ad_proc ::twt::dotlrn::add_department { server_url pretty_name description external_url } { - ::twt::do_request "$server_url/dotlrn/admin/department-new" + ::twt::do_request "/dotlrn/admin/department-new" form find ~n add_department field find ~n "pretty_name" field fill $pretty_name @@ -91,7 +91,7 @@ ad_proc ::twt::dotlrn::add_subject { server_url department_pretty_name pretty_name description } { - ::twt::do_request "$server_url/dotlrn/admin/class-new" + ::twt::do_request "/dotlrn/admin/class-new" form find ~n add_class field find ~n "form:id" @@ -129,7 +129,7 @@ ad_proc ::twt::dotlrn::get_class_add_urls { server_url } { - return [::twt::get_url_list "dotlrn/admin/classes" "class-instance-new"] + return [::twt::get_url_list "/dotlrn/admin/classes" "class-instance-new"] } ad_proc ::twt::dotlrn::setup_classes { server_url } { @@ -164,7 +164,7 @@ ad_proc ::twt::dotlrn::add_community { server_url name description policy } { - ::twt::do_request "${server_url}/dotlrn/admin/club-new" + ::twt::do_request "/dotlrn/admin/club-new" form find ~n add_club @@ -182,9 +182,9 @@ Get the .LRN admin URL for a user. This is awkward. If we could lookup the user_id from email this would be much easier. } { - ::twt::do_request "dotlrn/admin/users-search?name=$email&form%3Aid=user_search" + ::twt::do_request "/dotlrn/admin/users-search?name=einstein&form%3Aid=user_search" - link follow ~u {user} + link follow ~u {user\?user} return [response url] } @@ -197,7 +197,7 @@ ::twt::do_request "/dotlrn/admin/users?type=pending" # Goto the community page for the site-wide admin (assuming he's first in the list) - link follow ~u {user\?user_id=} + link follow ~u {^user\?user} # Follow the add to dotlrn link link follow ~u "user-new-2" Index: openacs-4/etc/install/tcl/twt-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/twt-procs.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/etc/install/tcl/twt-procs.tcl 12 Oct 2003 01:10:13 -0000 1.1 +++ openacs-4/etc/install/tcl/twt-procs.tcl 12 Oct 2003 08:31:28 -0000 1.2 @@ -18,19 +18,9 @@ } ad_proc ::twt::do_request { page_url } { - Takes a a url and invokes tclwebtest::do_request. The URL - can either be relative to server root or absolute - (in which case it must start with with http://). + Takes a a url and invokes tclwebtest::do_request. } { - if { [regexp {^http://} $page_url] } { - # We were given an absolute url - set absolute_url $page_url - } else { - # Relative url - prepend system url - set absolute_url "[::twt::config::server_url]/$page_url" - } - - ::tclwebtest::do_request $absolute_url + ::tclwebtest::do_request $page_url } ad_proc ::twt::get_url_list { page_url link_url_pattern } { Index: openacs-4/etc/install/tcl/user-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/user-procs.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/etc/install/tcl/user-procs.tcl 12 Oct 2003 01:10:13 -0000 1.4 +++ openacs-4/etc/install/tcl/user-procs.tcl 12 Oct 2003 08:31:28 -0000 1.5 @@ -44,10 +44,8 @@ ::twt::user::logout - global __server_url - # Request the start page - ::twt::do_request "${__server_url}/register" + ::twt::do_request "[::twt::config::server_url]/register" # Login the user form find ~n login @@ -59,9 +57,7 @@ } ad_proc ::twt::user::logout {} { - global __server_url - - ::twt::do_request "${__server_url}/register/logout" + ::twt::do_request "[::twt::config::server_url]/register/logout" } ad_proc ::twt::user::login_site_wide_admin {} { @@ -79,7 +75,7 @@ full_access guest } { - ::twt::do_request "$server_url/dotlrn/admin/users" + ::twt::do_request "/dotlrn/admin/users" link follow ~u "user-add" form find ~a "/dotlrn/user-add" @@ -195,7 +191,7 @@ #puts "setting guest password for user $user_email" # User admin page - ::twt::do_request "${server_url}/dotlrn/admin/users" + ::twt::do_request "/dotlrn/admin/users" form find ~a "users-search" field fill $user_email ~n name