Index: openacs-4/packages/acs-core-docs/www/nextsteps.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/Attic/nextsteps.html,v diff -u -r1.6 -r1.6.2.1 --- openacs-4/packages/acs-core-docs/www/nextsteps.html 10 Aug 2002 20:07:20 -0000 1.6 +++ openacs-4/packages/acs-core-docs/www/nextsteps.html 24 Nov 2002 21:29:17 -0000 1.6.2.1 @@ -1,48 +1,58 @@ -Next Steps

Next Steps

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

Backup Strategy

Here are some tips from Don Baccus regarding backup strategy:

- The need for making backups should be self-explanatory. There are - several strategies you can use. My own strategy for minimizing the - odds that I'll lose all my data is quite simple: -

  • - The database is stored on a mirrored (RAID 1) disk. -

  • - The machine has battery backup. -

  • - Backups are made nightly onto a third disk on another controller -

  • - FTP is used to copy the resulting backup to two separate remote - servers in two locations -

- Rather than making remote copies, you might choose to dump to tape or - writeable CD media. Whatever strategy you use, it is important to - routinely check dumps to make sure they can be reloaded. The strategy - outlined above means that in the case of catastrophic failure, I'll - lose at most one day's data. +Next Steps

Next Steps

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

Backup Strategy

- By mirroring disks and using a battery backup, preferably one that - can trigger an automatic and controlled shutdown of the system when - the battery runs low, you greatly lower the odds of ever having to - use your nightly backup. Despite this, it is important to take - backups seriously if the data stored at your site is valuable to you - or your users. -

Set Up Nightly Oracle Exports

- While you're working with Oracle, you should configure it to do - automatic exports. An export is a separate backup copy of the - database. This copy includes all of the database's state at the - time that the export was initiated. If your database is corrupted, - you can restore from one of these backups. You should do this step as - root. -

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

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

    -nsadmin:~$ su -
    +      Here are some tips from Don Baccus regarding backup strategy:
    +
    +    

    + + The need for making backups should be self-explanatory. There are + several strategies you can use. My own strategy for minimizing the + odds that I'll lose all my data is quite simple: + +

    • + The database is stored on a mirrored (RAID 1) disk. +

    • + The machine has battery backup. +

    • + Backups are made nightly onto a third disk on another controller +

    • + FTP is used to copy the resulting backup to two separate remote + servers in two locations +

    + + Rather than making remote copies, you might choose to dump to tape or + writeable CD media. Whatever strategy you use, it is important to + routinely check dumps to make sure they can be reloaded. The strategy + outlined above means that in the case of catastrophic failure, I'll + lose at most one day's data. + +

    + + By mirroring disks and using a battery backup, preferably one that + can trigger an automatic and controlled shutdown of the system when + the battery runs low, you greatly lower the odds of ever having to + use your nightly backup. Despite this, it is important to take + backups seriously if the data stored at your site is valuable to you + or your users. + +

Set Up Nightly Oracle Exports

+ While you're working with Oracle, you should configure it to do + automatic exports. An export is a separate backup copy of the + database. This copy includes all of the database's state at the + time that the export was initiated. If your database is corrupted, + you can restore from one of these backups. You should do this step as + root. +

  • + Download the backup script. Save the file export-oracle.txt as + /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
  • @@ -52,17 +62,17 @@ 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 - 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 - also need to change the - exportdir setting. -

    - Test the export procedure by running the command: -

    +          Now edit
    +          /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
    +          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
     
    @@ -100,217 +110,227 @@
     . exporting post-schema procedural objects and actions
     . exporting statistics
     Export terminated successfully without warnings.

    If you don't have any warnings, proceed to automate the - backups.

  • - Automating backups is accomplished using the UNIX - crontab facility.

    - While still root, run the - following command. You can replace the - EDITOR="emacs -nw" - portion with whatever editor your prefer, such as - EDITOR=vi. -

    +          backups.

  • + Automating backups is accomplished using the UNIX + crontab facility.

    + While still root, run the + following command. You can replace the + EDITOR="emacs -nw" + portion with whatever editor your prefer, such as + EDITOR=vi. +

     root:~# export EDITOR="emacs -nw"
     root:~# crontab -e

    Now add the following line on a line by itself

     0 23 * * * /usr/sbin/export-oracle

    - Save the file, exit the editor. Verify that the addition - succeeded by checking the output of the following command.

    +          Save the file, exit the editor. Verify that the addition
    +          succeeded by checking the output of the following command.

     root:~# crontab -l | grep export-oracle
     0 23 * * * /usr/sbin/export-oracle
     root:~# exit
     ; Logout

    If you see the line, go ahead and log out.

Set up nightly Postgres exports

- Dowload this script - to /tmp. At the top of the script - are several variables that you'll need to customize: -

  • - bak - location where you want - local backups to be saved -

  • - servername - name of your server - (and database instance) -

  • - ftp_user - username on your ftp - account -

  • - ftp_password - password on your - ftp account -

  • - ftp_dir - path on the remote - server where your backups will be uploaded -

  • - ftp_server - your ftp server -

+ Dowload this script + to /tmp. At the top of the script + are several variables that you'll need to customize: +

  • + bak - location where you want + local backups to be saved +

  • + servername - name of your server + (and database instance) +

  • + ftp_user - username on your ftp + account +

  • + ftp_password - password on your + ftp account +

  • + ftp_dir - path on the remote + server where your backups will be uploaded +

  • + ftp_server - your ftp server +

- Next, we'll save this file to our server's - tcl directory so that it will be - loaded on startup. It will automatically be run every night at - midnight. Note that this script only backs up the database - not the - OpenACS scripts and file content. -

-nsadmin:~$ cp /tmp/acs-pgbackup-init.txt /web/birdnotes/tcl/acs-pgbackup-init.tcl
-nsadmin:~$ restart-aolserver birdnotes

- That's it! The script will email you with each successful backup (or - if it fails, it will send you an email with the reason) -

Vacuum Postgres nightly

- The "vacuum" command must be run periodically to reclaim space. The - "vacuum analyze" form additionally collects statistics on the - disbursion of columns in the database, which the optimizer uses when - it calculates just how to execute queries. The availability of this - data can make a tremendous difference in the execution speed of - queries. This command can also be run from cron, but it probably makes - more sense to run this command as part of your nightly backup - procedure - if "vacuum" is going to screw up the database, you'd - prefer it to happen immediately after (not before!) you've made a - 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:

-nsadmin:~$ crontab -e

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

+      Next, we'll save this file to our server's
+      tcl directory so that it will be
+      loaded on startup. It will automatically be run every night at
+      midnight. Note that this script only backs up the database - not the
+      OpenACS scripts and file content.
+    

+joeuser:~$ cp /tmp/acs-pgbackup-init.txt ~/web/birdnotes/tcl/acs-pgbackup-init.tcl
+joeuser:~$ restart-aolserver birdnotes

+ That's it! The script will email you with each successful backup (or + if it fails, it will send you an email with the reason) +

Vacuum Postgres nightly

+ The "vacuum" command must be run periodically to reclaim space. The + "vacuum analyze" form additionally collects statistics on the + disbursion of columns in the database, which the optimizer uses when + it calculates just how to execute queries. The availability of this + data can make a tremendous difference in the execution speed of + queries. This command can also be run from cron, but it probably makes + more sense to run this command as part of your nightly backup + procedure - if "vacuum" is going to screw up the database, you'd + prefer it to happen immediately after (not before!) you've made a + 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 + line:

 0 1 * * * /usr/local/pgsql/bin/vacuumdb birdnotes

How to add a second server on a different port

Starting another server is simply a matter of configuring another - aolserver instance, creating another database and pointing this - aolserver instance at a fresh copy of the OpenACS-4 code. We'll call - our new server birdnotes-dev

  1. - Download another copy of openacs4.tcl.txt - into /tmp.

    -nsadmin:~$ cp /tmp/openacs4.tcl.txt ./birdnotes-dev.tcl
    -nsadmin:~$ chmod 660 birdnotes-dev.tcl
    -nsadmin:~$ emacs birdnotes-dev.tcl

    Just like in the section called “Configuring AOLserver”, - you'll need to set the server parameters appropriately. Be sure to - choose a different port than your original server and to set - server to - birdnotes-dev.

  2. + aolserver instance, creating another database and pointing this + aolserver instance at a fresh copy of the OpenACS-4 code. We'll call + our new server birdnotes-dev

    1. + You can either copy your current OpenACS installation: +

      +joeuser:~$ cp -r web/birdnotes web/birdnotes-dev

      + Or Download the OpenACS + 4 software into /tmp again. +

      +joeuser:~$ cd web
      +joeuser:~/web$ tar xzvf /tmp/openacs-4-5-release.tgz
      +joeuser:~/web$ mv openacs-4 birdnotes-dev
    2. + Download another copy of openacs4.tcl.txt + into /tmp.

      +joeuser:~/web$ cp /tmp/openacs4.tcl.txt ./birdnotes-dev/nsd.tcl
      +joeuser:~/web$ chmod 600 birdnotes-dev/nsd.tcl
      +joeuser:~/web$ emacs birdnotes-dev/nsd.tcl

      Just like in the section called “Configuring AOLserver”, + you'll need to set the server parameters appropriately. Be sure to + choose a different port than your original server and to set + server to + birdnotes-dev.

    3. - Create a new database instance called - birdnotes-dev. Follow the instructions in - Prepare Oracle for OpenACS or Prepare PostgreSQL for OpenACS. + Create a new database instance called + birdnotes-dev. Follow the instructions in + Prepare Oracle for OpenACS or Prepare PostgreSQL for OpenACS. -

    4. +

    5. + Start your new server! +

      +joeuser:~/web$ cd
      +joeuser:~/web$ /usr/local/aolserver/bin/nsd-postgres -t /home/joeuser/web/birdnotes-dev/nsd.tcl

      + Visit the site with a web browser (using the port that you set + above). You should see the OpenACS installer. Once you install + the OpenACS datamodel, you'll also need to add your new aolserver + instance to /etc/inittab (or + daemontools) so it restarts automatically.

Set up site-wide search

- You can either copy your current OpenACS installation: -

-nsadmin:~$ cd /web
-nsadmin:~$ cp -r birdnotes birdnotes-dev

- Or Download the OpenACS - 4 software into /tmp again. -

-nsadmin:~$ cd /web
-nsadmin:/web$ tar xzvf /tmp/alpha2.tgz
-nsadmin:/web$ mv openacs-4 birdnotes-dev
  • - Start your new server! -

    -nsadmin:/web$ cd
    -nsadmin:~$ /usr/local/aolserver/bin/nsd-postgres -t /usr/local/aolserver/birdnotes-dev.tcl

    - Visit the site with a web browser (using the port that you set - above). You should see the OpenACS installer. Once you install - the OpenACS datamodel, you'll also need to add your new aolserver - instance to /etc/inittab (or - daemontools) so it restarts automatically.

  • Set up site-wide search

    - OpenACS uses the OpenFTS package to - implement site-wide-search. You'll need to have the Tcl development - libraries and headers installed. (Debian users: - apt-get install tcl8.3-dev) -

    1. - As root, download the - Search-OpenFTS driver. -

      -nsadmin:~$ su -
      +      OpenACS uses the OpenFTS package to
      +      implement site-wide-search. As of this writing, the current version
      +      is 0.3.2. There are good instructions included in the OpenFTS
      +      instructions which I will repeat here. Be sure to look at those
      +      instructions if you're installing a version later than 0.3.2; the
      +      instructions may have changed. You'll need to have the Tcl
      +      development libraries and headers installed. (Debian users:
      +      apt-get install tcl8.3-dev)
      +
      +    

      1. + + As root, download the latest TCL + version of the Search-OpenFTS driver from SourceForge + into /tmp. Extract the source + into /usr/local/src + +

        +joeuser:~$ su -
         Password: **********
        -root:~# cd /tmp
        -root:/tmp# wget http://prdownloads.sourceforge.net/openfts/Search-OpenFTS-tcl-0.2.tar.gz
         root:~# cd /usr/local/src
        -root:/usr/local/src# tar xzf /tmp/Search-OpenFTS-tcl-0.2.tar.gz
        -root:/usr/local/src# chown -R nsadmin.web Search-OpenFTS-tcl-0.2
        -root:/usr/local/src# exit
      2. - Configure it. Note that you may need to set - --with-tcl=(your Tcl library - location). For Debian, add this to the end of the - ./configure command: - --with-tcl=/usr/lib/tcl8.3 -

        -nsadmin:~$ cd /usr/local/src/Search-OpenFTS-tcl-0.2
        -nsadmin:/usr/local/src/Search-OpenFTS-tcl-0.2$ ./configure --with-aolserver-src=/usr/local/src/aolserver/aolserver
      3. - In order to compile on Debian, I had to edit my - Makefile.global. Add - -I/usr/include/tcl8.3 to the - line where INC is defined, so it looks like this: -

        -INC          = ../include -I/usr/include/tcl8.3

        Then compile it:

        -nsadmin:/usr/local/src/Search-OpenFTS-tcl-0.2$ make
        -nsadmin:/usr/local/src/Search-OpenFTS-tcl-0.2$ cd aolserver
        -nsadmin:/usr/local/src/Search-OpenFTS-tcl-0.2/aolserver$ make
      4. - Install it. You need to do this step as root since some of the - libraries will be installed alongside your TCL libraries and some - alongside your PostgreSQL libraries. -

        -nsadmin:/usr/local/src/Search-OpenFTS-tcl-0.2/aolserver$ su -
        -Password: ***********
        -root:~# cd /usr/local/src/Search-OpenFTS-tcl-0.2
        -root:/usr/local/src/Search-OpenFTS-tcl-0.2# make install
        -root:/usr/local/src/Search-OpenFTS-tcl-0.2# exit
        -nsadmin:/usr/local/src/Search-OpenFTS-tcl-0.2/aolserver$ cp nsfts.so /usr/local/aolserver/bin/
      5. - Add the following line to your aolserver config file (in our - example: - /usr/local/aolserver/birdnotes.tcl) - in the "ns_section ns/server/${server}/modules" section: -

        +root:/usr/local/src# tar xzf /tmp/Search-OpenFTS-tcl-0.3.2.tar.gz
        +root:/usr/local/src# chown -R root.root Search-OpenFTS-tcl-0.3.2
        +root:/usr/local/src# cd Search-OpenFTS-tcl-0.3.2
      6. + + Configure it. Note that you may need to set + --with-tcl=(your Tcl library + location). For Debian, add this to the end of the + ./configure command: + --with-tcl=/usr/lib/tcl8.3 + +

        +root:/usr/local/src/Search-OpenFTS-tcl-0.3.2# ./configure --with-aolserver-src=/usr/local/src/aolserver/aolserver
      7. + + Then compile it, copy the module to your AOLserver + bin directory, and copy the TCL + files to your AOLserver tcl + directory: + +

        +root:/usr/local/src/Search-OpenFTS-tcl-0.3.2# cd aolserver
        +root:/usr/local/src/Search-OpenFTS-tcl-0.3.2/aolserver# make
        +root:/usr/local/src/Search-OpenFTS-tcl-0.3.2/aolserver# cp nsfts.so /usr/local/aolserver/bin
        +root:/usr/local/src/Search-OpenFTS-tcl-0.3.2/aolserver# cd ..
      8. + + Load the tsearch module SQL into your database and then compile + the openfts module in the Postgresql contrib directory. + +

        +root:/usr/local/src/Search-OpenFTS-tcl-0.3.2# cp -r pgsql_contrib_openfts /usr/local/src/postgresql-7.2.3/contrib
        +root:/usr/local/src/Search-OpenFTS-tcl-0.3.2# cd /usr/local/src/postgresql-7.2.3/contrib/pgsql_contrib_openfts
        +root:/usr/local/postgresql-7.2.3/contrib/pgsql_contrib_openfts# make
        +root:/usr/local/postgresql-7.2.3/contrib/pgsql_contrib_openfts# su postgres
        +postgres:/usr/local/postgresql-7.2.3/contrib/pgsql_contrib_openfts$ make install
        +postgres:/usr/local/postgresql-7.2.3/contrib/pgsql_contrib_openfts$ /usr/local/pgsql/bin/psql birdnotes -f /usr/local/src/postgresql-7.2.3/contrib/tsearch/tsearch.sql
        +postgres:/usr/local/postgresql-7.2.3/contrib/pgsql_contrib_openfts$ /usr/local/pgsql/bin/psql birdnotes -f openfts.sql
        +postgres:/usr/local/postgresql-7.2.3/contrib/pgsql_contrib_openfts$ exit
        +root:/usr/local/postgresql-7.2.3/contrib/pgsql_contrib_openfts# exit
      9. + + Uncomment the following line in your aolserver config file (in our + example: + ~/web/birdnotes/nsd.tcl) + in the "ns_section ns/server/${server}/modules" section: + +

                 ns_param   nsfts           ${bindir}/nsfts.so
      10. - Load the openFTS code into your database: -

        -nsadmin:/usr/local/src/Search-OpenFTS-tcl-0.2/aolserver$ cd
        -nsadmin:~$ psql -f /web/birdnotes/packages/openfts-driver/sql/postgresql/load.sql birdnotes
        -nsadmin:~$ restart-aolserver birdnotes
      11. - Open a browser and go to your server - (http://yourserver:port). Click on the "Package Manager" link in - the "Quick Links" section on the right side of the page. -

      12. - Click on the "Install packages" link and follow the instructions - to install the Note package and the OpenFTS Driver 4.2 package. -

      13. - Restart your server. + Open a browser and go to your server + (http://yourserver:port). Click on the "Package Manager" link in + the "Quick Links" section on the right side of the page. +

      14. + Click on the "Install packages" link and follow the instructions + to install the Note package and the OpenFTS Driver 4.2 package. +

      15. + Restart your server. -

        -nsadmin:~$ restart-aolserver birdnotes
        -

      16. - Give the server a few minutes to restart and then go back to your - server's front page and click on "Site Map" from the "Quick - Links" -

      17. - Create a "new sub folder" under "Main Site". Call the url - "openfts". -

      18. Click "mount" to mount the OpenFTS driver at the url - "openfts" (despite what the system says about these packages not - being meant to be mounted) -

      19. Click on "Set parameters" for the OpenFTS instance - and make sure that openfts_tcl_src_path properly points to your - local copy of the Search package source code. If you've followed - these directions strictly, you shouldn't need to change it. -

      20. - Create another folder under "Main Site" at the url - "search". Create a "new application". Call the application - "Search" and choose the "Search" package from the drop-down list. -

      21. - Create a third folder under "Main Site" at the url - "notes". Create a "new application". Call the application "Notes" - and choose the "Note" package from the drop-down list. -

      22. - Restart the server. -

      23. - Return to your home page. Near the bottom of the page, Click on - the "OpenFTS Driver" link. Then click on - "Administration". Finally, click on "Initialize OpenFTS - Engine". Accept the defaults and continue. -

      24. - Click on the "Main Site" link to get back to the home page. Now, - click on the "ACS Service Contract" link near the bottom of the - home page. -

      25. - Click on the link to "install" the FtsEngineDriver. Also, click - the link to install the Note content provider. -

      26. - Restart the server. You can try inserting some notes and then - going to the search page to search for stuff. Note that the - content may not get indexed immediately, so give it a few - minutes. -

    ($Id$)
    +

    +joeuser:~$ svc -t /service/birdnotes

    +

  • + Give the server a few minutes to restart and then go back to your + server's front page and click on "Site Map" from the "Quick + Links" +

  • + Create a "new sub folder" under "Main Site". Call the url + "openfts". +

  • Click "mount" to mount the OpenFTS driver at the url + "openfts" (despite what the system says about these packages not + being meant to be mounted) +

  • + + Click the "Set parameters" link next to OpenFTS. Change the + openfts_tcl_src_path to + /usr/local/src/Search-OpenFTS-tcl-0.3.2 + +

  • + Create another folder under "Main Site" at the url + "search". Create a "new application". Call the application + "Search" and choose the "Search" package from the drop-down list. +

  • + Create a third folder under "Main Site" at the url + "notes". Create a "new application". Call the application "Notes" + and choose the "Note" package from the drop-down list. +

  • + Restart the server. +

  • + Return to your home page. Near the bottom of the page, Click on + the "OpenFTS Driver" link. Then click on + "Administration". Finally, click on "Initialize OpenFTS + Engine". Accept the defaults and continue. +

  • + Click on the "Main Site" link to get back to the home page. Now, + click on the "ACS Service Contract" link near the bottom of the + home page. +

  • + Click on the link to "install" the FtsEngineDriver. Also, click + the link to install the Note content provider. +

  • + Restart the server. You can try inserting some notes and then + going to the search page to search for stuff. Note that the + content may not get indexed immediately, so give it a few + minutes. +

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