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 -r1.6.2.6 -r1.6.2.7 --- openacs-4/packages/acs-core-docs/www/openacs.html 15 Apr 2003 17:03:02 -0000 1.6.2.6 +++ openacs-4/packages/acs-core-docs/www/openacs.html 19 Apr 2003 20:39:32 -0000 1.6.2.7 @@ -1,9 +1,9 @@ -Install OpenACS 4.6.2

Install OpenACS 4.6.2

+Install OpenACS 4.6.2

Install OpenACS 4.6.2

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

Set up the file system for an OpenACS Service

  1. The reference install stores all OpenACS services in +

Set up the file system for an OpenACS Service

  1. The reference install stores all OpenACS services in /web, with one subdirectory per service. The first time you install a service, you must create that directory and set its permissions:

    [root@yourserver root]# mkdir /web
    @@ -72,8 +72,8 @@
     
     [root@yourserver root]#
  2. 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 /web
    -[service0@yourserver web]$ tar xzf /tmp/openacs-4-6.tgz
    -[service0@yourserver web]$ mv openacs-4-6 service0
    +[service0@yourserver web]$ tar xzf /tmp/openacs-4.6.2.tgz
    +[service0@yourserver web]$ mv openacs-4.6.2 service0
     [service0@yourserver web]$ chmod -R 700 service0
     [service0@yourserver web]$ ls -al
     total 3
    @@ -86,11 +86,11 @@
     [root@yourserver root]#
     
    su - service0
     cd /web
    -tar xzf /tmp/openacs-4-6.tgz
    -mv openacs-4-6 service0
    +tar xzf /tmp/openacs-4.6.2.tgz
    +mv openacs-4.6.2 service0
     chmod -R 700 service0/
     ls -al
    -exit
  3. Add the Service to CVS - OPTIONAL.�If this is a development server, you may want to add it to your local CVS repository.

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

      [root@yourserver root]# mkdir /cvsroot/service0
      +exit
    2. Add the Service to CVS - OPTIONAL.�If this is a development server, you may want to add it to your local 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]#
         
        mkdir /cvsroot/service0
        @@ -107,11 +107,11 @@
                     plus this string,
                     i.e.
                     /cvsroot/service0.
        -            "OpenACS" is the vendor tag, and "openacs-4-6" is the
        +            "OpenACS" is the vendor tag, and "openacs-4-6-2" 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-4-6
        +[service0@yourserver service0]$ cvs import -m "initial install" service0 OpenACS openacs-4-6-2
         N service0/license.txt
         N service0/readme.txt
         (many lines omitted)
        @@ -122,7 +122,7 @@
         [service0@yourserver service0]$
         
        su - service0
         cd /web/service0
        -cvs import -m "initial install" service0 OpenACS openacs-4-6

        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 ..
        +cvs import -m "initial install" service0 OpenACS openacs-4-6-2

        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 checkout: Updating service0
        @@ -293,7 +293,7 @@
         CREATE DATABASE
         [service0@yourserver service0]$
         
        su - service0
        -createdb 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.

        [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 * * * /usr/local/pgsql/bin/vacuumdb service0
      3. Add Full Text Search Support - OPTIONAL

        If you are installing Full Text Search, add required packages to the new database.

        [service0@yourserver service0]$ /usr/local/pgsql/bin/psql service0 -f /usr/local/src/postgresql-7.2.3/contrib/tsearch/tsearch.sql
        +createdb service0
      4. 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.

        [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 * * * /usr/local/pgsql/bin/vacuumdb service0
      5. Add Full Text Search Support - OPTIONAL

        If you are installing Full Text Search, add required packages to the new database.

        [service0@yourserver service0]$ /usr/local/pgsql/bin/psql service0 -f /usr/local/src/postgresql-7.2.3/contrib/tsearch/tsearch.sql
         BEGIN
         CREATE
         (many lines omitted)
        @@ -311,7 +311,7 @@
         	  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.  Copy it to the /web/service0/etc directory and open it in an editor to adjust the parameters.

        [root@yourserver root]# su - service0
        +	  need to configure a virtual server.  The Reference Platform uses a configuration file included in the OpenACS tarball.  Copy it to the /web/service0/etc directory and open it in an editor to adjust the parameters.

        [root@yourserver root]# su - service0
         [service0@yourserver service0]$ cd /web/service0/etc
         [service0@yourserver etc]# cp /web/service0/packages/acs-core-docs/www/files/config.tcl.txt config.tcl
         [service0@yourserver etc]# emacs config.tcl
        @@ -360,7 +360,7 @@
         S/Sd2MYA0JVmQuIt5bYowXR1KYKDka1d3DUgtoVTiFepIRUrMkZlCli08mWVjE6T
         (11 lines omitted)
         1MU24SHLgdTfDJprEdxZOnxajnbxL420xNVc5RRXlJA8Xxhx/HBKTw==
        ------END RSA PRIVATE KEY-----

Verify AOLserver startup

  1. +-----END RSA PRIVATE KEY-----

Verify AOLserver startup

  1. Kill any current running AOLserver processes and start a new one. (Note, if you are using Oracle, rather than PostgreSQL, replace nsd-postgres with @@ -382,7 +382,7 @@ to make sure the service is starting without any problems. If you need to make changes, don't forget to kill any running servers with killall nsd. -

  2. OPTIONAL - Automate AOLserver keepalive

    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. An earlier method using init, less flexible and reliable, 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. Create the appropriate directory as /web/service0/etc/daemontools, copy the prepared run file, and set permissions. If your server is not called service0, edit /web/service0/etc/run accordingly.

      [service0@yourserver log]$ cd /web/service0/etc
      +	

    3. OPTIONAL - Automate AOLserver keepalive

      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 directory in /service. That directory must have a file called run. Daemontools then creates additional files and directories to track status and log. Create the appropriate directory as /web/service0/etc/daemontools, copy the prepared run file, and set permissions. If your server is not called service0, edit /web/service0/etc/run accordingly.

        [service0@yourserver log]$ cd /web/service0/etc
         [service0@yourserver etc]$ mkdir daemontools
         [service0@yourserver etc]$ cp /web/service0/packages/acs-core-docs/www/files/run.txt daemontools/run
         [service0@yourserver etc]$ chmod 700 daemontools/run
        @@ -515,7 +515,7 @@
         line, click
         Install.
         

    4. Restart the service.

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

Back up the New Service - OPTIONAL

This is a very good time to back the service, even if it's not a production service. Making a backup now lets you roll back to this initial, clean setup at any point in the future, without repeating the install process. A full OpenACS service backup includes everything in the /web/service0/ directory. At this point it's probably sufficient to back up just the database, because you can recover the files from a tarball.

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

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

    [service0@yourserver service0]$ mkdir /web/service0/database-backup
    +[service0@yourserver service0]$
  • Test FTS. (INCOMPLETE). Add a package that supports search,like "note," add some content, and search for it.

Back up the New Service - OPTIONAL

This is a very good time to back the service, even if it's not a production service. Making a backup now lets you roll back to this initial, clean setup at any point in the future, without repeating the install process. A full OpenACS service backup includes everything in the /web/service0/ directory. At this point it's probably sufficient to back up just the database, because you can recover the files from a tarball.

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

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

    [service0@yourserver service0]$ mkdir /web/service0/database-backup
     [service0@yourserver service0]$ pg_dump -f /web/service0/database-backup/initial_backup.dmp service0
     [service0@yourserver service0]$ ls -al /web/service0/database-backup
     total 1425
    @@ -525,7 +525,7 @@
     [service0@yourserver service0]$
     
    mkdir /web/service0/database-backup
     pg_dump -f /web/service0/database-backup/initial_backup.dmp service0
    -ls -al /web/service0/database-backup
  • Oracle - INCOMPLETE.�

Set up Automated Backup - OPTIONAL

Backup can encompass all files in /web/service0. For a development server, putting the files in cvs is sufficient. (It's important then to back up the cvs repository!)

A quick way to automate database backup is a cron job. This is not recommended for production and is not part of the Reference Platform, because it is not cross-platform and can fail silently. More thorough methods are documented in the section called “Backup Strategy”

[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 * * * /usr/local/pgsql/bin/pg_dump -f /web/service0/database-backup/service0_$(date +%Y-%m-%d).dmp service0

If you plan to back up the whole /web/service0 directory, then it would be redundant to keep a history of database backups. In that case, set up the cron job to overwrite the previous backup each time:

0 1 * * * /usr/local/pgsql/bin/pg_dump -f /web/service0/database-backup/service0_nightly.dmp service0

Set up Log Analysis Reports - OPTIONAL

Analog is a program with processes webserver access logs, +ls -al /web/service0/database-backup

  • Oracle - INCOMPLETE.�

  • Set up Automated Backup - OPTIONAL

    Backup can encompass all files in /web/service0. For a development server, putting the files in cvs is sufficient. (It's important then to back up the cvs repository!)

    A quick way to automate database backup is a cron job. This is not recommended for production and is not part of the Reference Platform, because it is not cross-platform and can fail silently. More thorough methods are documented in the section called “Backup Strategy”

    [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 * * * /usr/local/pgsql/bin/pg_dump -f /web/service0/database-backup/service0_$(date +%Y-%m-%d).dmp service0

    If you plan to back up the whole /web/service0 directory, then it would be redundant to keep a history of database backups. In that case, set up the cron job to overwrite the previous backup each time:

    0 1 * * * /usr/local/pgsql/bin/pg_dump -f /web/service0/database-backup/service0_nightly.dmp service0

    Set up Log Analysis Reports - OPTIONAL

    Analog is a program with processes webserver access logs, performs DNS lookup, and outputs HTML reports. Analog should already be installed. A modified configuration file is included in @@ -556,4 +556,4 @@ [root@yourserver root]# emacs /etc/cron.daily/analog

    Put this into the file:

    #!/bin/sh
     
    -/usr/share/analog-5.31/analog -G -g/web/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

    Next Steps

    • Test your backup and recovery procedure.

    • Follow the instruction on the home page to change the appearance of your service or add more packages.

    • Proceed to the tutorial to learn how to develop your own packages.

    ($Id$)
    View comments on this page at openacs.org
    +/usr/share/analog-5.31/analog -G -g/web/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

    Next Steps

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