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.5 -r1.6 --- openacs-4/packages/acs-core-docs/www/nextsteps.html 7 Mar 2002 06:55:36 -0000 1.5 +++ openacs-4/packages/acs-core-docs/www/nextsteps.html 10 Aug 2002 20:07:20 -0000 1.6 @@ -1,54 +1,22 @@ - -
- -Here are some tips from Don Baccus regarding 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 @@ -61,46 +29,29 @@ 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. -
-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 - Password: *********** root:~# cp /tmp/export-oracle.txt /usr/sbin/export-oracle -root:~# chmod 700 /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.
-+ /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-
+root:~# chmod 770 /ora8/m02/oracle-exports
Now edit /usr/sbin/export-oracle and change the SERVICE_NAME and @@ -109,11 +60,9 @@ /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 @@ -150,92 +99,58 @@ . exporting dimensions . 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.
-
+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.
-+ 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-+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.
-+ 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.
-
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-+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) -
-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 @@ -248,252 +163,154 @@ 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:
--0 1 * * * /usr/local/pgsql/bin/vacuumdb birdnotes-
Starting another server is simply a matter of configuring another +
Edit your crontab:
+nsadmin:~$ 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
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 -
-+ our new server birdnotes-dev
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”, + 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.
-+ birdnotes-dev.
Create a new database instance called - birdnotes-dev. Follow the instructions in + birdnotes-dev. Follow the instructions in Prepare Oracle for OpenACS or Prepare PostgreSQL for OpenACS. -
+
You can either copy your current OpenACS installation: -
-+nsadmin:~$ cd /web -nsadmin:~$ cp -r birdnotes birdnotes-dev-+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-
+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
-+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.
-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) -
-+
As root, download the Search-OpenFTS driver. -
-+nsadmin:~$ 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-
+root:/usr/local/src# exit
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-
+nsadmin:/usr/local/src/Search-OpenFTS-tcl-0.2$ ./configure --with-aolserver-src=/usr/local/src/aolserver/aolserver
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:
-++INC = ../include -I/usr/include/tcl8.3Then 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-
+nsadmin:/usr/local/src/Search-OpenFTS-tcl-0.2/aolserver$ make
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/-
+nsadmin:/usr/local/src/Search-OpenFTS-tcl-0.2/aolserver$ cp nsfts.so /usr/local/aolserver/bin/
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: -
-- ns_param nsfts ${bindir}/nsfts.so-
+
+ ns_param nsfts ${bindir}/nsfts.so
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-
+nsadmin:~$ psql -f /web/birdnotes/packages/openfts-driver/sql/postgresql/load.sql birdnotes +nsadmin:~$ restart-aolserver birdnotes
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. -
+
Click on the "Install packages" link and follow the instructions to install the Note package and the OpenFTS Driver 4.2 package. -
+
Restart your server.
-nsadmin:~$ restart-aolserver birdnotes
- +nsadmin:~$ restart-aolserver 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 +
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 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. +
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. -