| User | Purpose | Archive | Category | Branch | Version | Ports |
|---|---|---|---|---|---|---|
| safe4all-dev | Mirror OpenACS core releases | jade@safe4all.org--2005 | openacs | stable | 5.1.0 | None |
| safe4all-dev | Import packages, html pages | jade@safe4all.org--2005 | openacs | dev | 5.1.0 | 8000/8443 |
| safe4all-staging | Local customization | jade@safe4all.org--2005 | openacs | staging | 5.1.0 | 8001/8444 |
| safe4all | Live site | jade@safe4all.org--2005 | openacs | staging | 5.1.0 | 80/443 |
See the OpenACS wiki guide to installing OpenACS on Debian. Set up the Arch IDs for all the users# groupadd web # useradd -m -g web safe4all-dev # useradd -m -g web safe4all-staging # useradd -m -g web safe4all # apt-get install tla tla-doc
You should also edit your .bash_profile or equivalent to make your umask 0002 instead of 0022. This helps you with permissions issues later. Do this for safe4all-dev and safe4all-staging.# su - safe4all-dev $ tla my-id "Jade Rubick <safe4all-dev@safe4all.org>" $ exit # su - safe4all-staging $ tla my-id "Jade Rubick <safe4all-staging@safe4all.org>" $ exit # su - safe4all $ tla my-id "Jade Rubick <safe4all@safe4all.org>" $ exit
# su - safe4all-dev
$ mkdir ~/{archives}
Now set up your openacs-stable archive.
$ tla make-archive jade@safe4all.org--2005 ~/{archives}/2005
$ tla my-default-archive jade@safe4all.org--2005
$ tla archive-setup openacs--stable--5.1.0
* creating category jade@safe4all.org--2005/openacs
* creating branch jade@safe4all.org--2005/openacs--stable
* creating version jade@safe4all.org--2005/openacs--stable--5.1.0
$ mkdir ~/wd
$ cd ~/wd
$ cvs -z5 -d :pserver:anonymous@cvs.openacs.org:/cvsroot co -r openacs-5-1-0-final acs-core
(see http://openacs.org/4/checkout)
$ mv openacs-4 openacs-5-1-0
$ cd openacs-5-1-0
$ tla init-tree openacs--stable--5.1.0
We have to get all the source into Arch. You should look up the inventory and tree-lint commands if you don't understand what they do. They essentially help us make sure that we're importing all the files into Arch the way we want to.
We have to get to a point where tla tree-lint doesn't report any issues. Here are some hints: We now need to edit the =tagging-method file, to ensure that log files aren't stored in Arch, that the daemontools' supervise directory isn't stored in Arch, etc..$tla inventory --names --both --source |xargs tla add $tla tree-lint
emacs {arch}/=tagging-method
Change this line:
precious ^(\+.*|\.gdbinit|\.#ckpts-lock|=build\.*|=install\.*|CVS|CVS\.adm|RCS|RCSLOG|SCCS|TAGS|\.svn)$to
precious ^(\+.*|\.gdbinit|\.#ckpts-lock|=build\.*|=install\.*|CVS|CVS\.adm|RCS|RCSLOG|SCCS|TAGS|\.svn|supervise|content-repository-content-files)$You also will need to add a .arch-inventory file to prevent Arch from storing database backups, server certificates, etc... See: http://wiki.gnuarch.org/moin.cgi/Tla_20Files
Add in code that hasn't been added in yet (check without xargs first)echo "precious ^log|apm-workspace|rss|database-backup$" > .arch-inventory echo "precious ^certs$" > etc/.arch-inventory echo "precious ^down$" > etc/daemontools/.arch-inventory
Do this until tree-lint doesn't complain. Now we commit the new stable branch:$ tla tree-lint -t |xargs tla add
$ tla import * imported jade@safe4all.org--2005/openacs--stable--5.1.0 $ tla commit --summary "Imported OpenACS 5.1.0" * update pristine tree (jade@safe4all.org--2005/openacs--stable--5.1.0--base-0 => openacs--stable--5.1.0--patch-1) * committed jade@safe4all.org--2005/openacs--stable--5.1.0--patch-1
safe4all. You'll
base this dev instance on the openacs stable version, by creating a branch:
This follows the recipe here: Maintain your own version of another project. See also Elementary branches.
Now we have a dev branch of the openacs-stable archive. Now you can set up a dev server. This step is not strictly necessary. When you edit your config.tcl file, I recommend setting up the email redirecting, so email isn't sent from your staging server. See "Configure an AOLserver Service for OpenACS" on the OpenACS documentation.$ cd ~wd $ tla archive-setup openacs--dev--5.1.0 * creating branch jade@safe4all.org--2005/openacs--dev * creating version jade@safe4all.org--2005/openacs--dev--5.1.0 $ tla tag jade@safe4all.org--2005/openacs--stable--5.1.0 openacs--dev--5.1.0
Now set up the database. If you are starting from scratch:$ cd $ tla get openacs--dev--5.1.0 safe4all-dev * from import revision: jade@safe4all.org--2005/openacs--stable--5.1.0--base-0 * patching for revision: jade@safe4all.org--2005/openacs--stable--5.1.0--patch-1 * patching for revision: jade@safe4all.org--2005/openacs--dev--5.1.0--base-0 * making pristine copy * tree version set jade@safe4all.org--2005/openacs--dev--5.1.0 $ ln -s /home/safe4all-dev/safe4all-dev /var/lib/aolserver/safe4all-dev $ mkdir ~/safe4all-dev/log $ emacs ~/safe4all-dev/etc/config.tcl $ emacs ~/safe4all-dev/etc/daemontools/run $ touch ~/safe4all-dev/etc/daemontools/down
Set up the database as per Prepare PostgreSQL for an OpenACS Service on the OpenACS install docs.
If you are importing an existing database, then, if you have a database dump to import, you can use Perl to make sure you are loading the information correctly into the dev and staging instances:
Put this in the crontab, changing the directory to pgsql depending on what which said for vacuum. Note the first line is commented out -- it is no longer necessary as of Postgres 7.4.# su - postgres $ createuser -a -d safe4all-dev $ exit # su - safe4all-dev $ createdb -E UNICODE safe4all-dev $ perl -pi -e "s/^\\connect olduser$/\\connect safe4all-dev/" dumpfilename.dmp $ psql -f dumpfilename.dmp safe4all-dev $ locate vacuum |grep vacuumdb $ export EDITOR=emacs;crontab -e
# 0 1-23 * * * /usr/lib/postgresql/bin/vacuumdb --analyze safe4all-dev > /dev/null 2>&1 0 0 * * * /usr/lib/postgresql/bin/vacuumdb --full --analyze safe4all-dev > /dev/null 2>&1
Now let's make sure everything is set up correctly. Run the etc/daemontools/run script by hand.
If you get this error message:$ su - # cd /home/safe4all-dev/safe4all-dev/etc/daemontools # ./run
/usr/local/aolserver/bin/nsd: error while loading shared libraries: libnsd.so: cannot open shared object file: No such file or directorySee: error while loading shared libraries: libnsd.so Check that the server actually starts up, look at the ~safe4all-dev/log/error.log files to troubleshoot. Post on the OpenACS Forums if you have problems. Once it works, then link it in.
If the svgroup command doesn't work, you need to install it (see the OpenACS installation guide (here). Once you get it right, commit the changes you've made. You can go through the web interface now and set up OpenACS if you didn't import anything.$ su - # ln -s /var/lib/aolserver/safe4all-dev/etc/daemontools /service/safe4all-dev # svgroup web /service/safe4all-dev # exit $ svc -u /service/safe4all-dev
safe4all. We
base this website on the safe4all-dev branch, but create another branch:
This follows the recipe here: Maintain your own version of another project. See also Elementary branches.
# su - safe4all-staging
$ cd
$ tla register-archive /home/safe4all-dev/\{archives\}/2005/
$ tla my-default-archive jade@safe4all.org--2005
$ tla archive-setup openacs--staging--5.1.0
* creating branch jade@safe4all.org--2005/openacs--staging
* creating version jade@safe4all.org--2005/openacs--staging--5.1.0
$ tla tag jade@safe4all.org--2005/openacs--dev--5.1.0 openacs--staging--5.1.0
Now we have a staging branch of the dev branch.
Now set up the staging server:
When you edit your config.tcl file, I recommend setting up the email redirecting, so email isn't sent from your staging server. Now set up the database. If you are starting from scratch:$ cd $ tla get openacs--staging--5.1.0 safe4all-staging * from pristine cache: jade@safe4all.org--2005/openacs--dev--5.1.0--base-0 * patching for revision: jade@safe4all.org--2005/openacs--staging--5.1.0--base-0 * making pristine copy * tree version set jade@safe4all.org--2005/openacs--staging--5.1.0 $ ln -s /home/safe4all-staging/safe4all-staging /var/lib/aolserver/safe4all-staging $ emacs ~/safe4all-staging/etc/config.tcl $ emacs ~/safe4all-staging/etc/daemontools/run $ touch ~/safe4all-staging/etc/daemontools/down
Set up the database as per Prepare PostgreSQL for an OpenACS Service on the OpenACS install docs.
If you are importing an existing database, then, if you have a database dump to import, you can use Perl to make sure you are loading the information correctly into the dev and staging instances:
Add to the crontab entries for safe4all-staging:# su - postgres $ createuser -a -d safe4all-staging $ exit # su - safe4all-staging $ createdb -E UNICODE safe4all-staging $ perl -pi -e "s/^\\connect olduser$/\\connect safe4all-staging/" dumpfilename.dmp $ psql -f dumpfilename.dmp safe4all-staging $ export EDITOR=emacs;crontab -e
#15 1-23 * * * /usr/lib/postgresql/bin/vacuumdb --analyze safe4all-staging > /dev/null 2>&1 15 0 * * * /usr/lib/postgresql/bin/vacuumdb --full --analyze safe4all-staging > /dev/null 2>&1
Now let's make sure everything is set up correctly. Run the etc/daemontools/run script by hand.
Check that the server actually starts up, look at the error.log files to troubleshoot. Once it works, then:$ su - # cd /home/safe4all-staging/safe4all-staging/etc/daemontools # ./run
$ su - # ln -s /var/lib/aolserver/safe4all-staging/etc/daemontools /service/safe4all-staging # svgroup web /service/safe4all-staging # exit $ svc -u /service/safe4all-staging
$ cd
$ tla register-archive /home/safe4all-dev/\{archives\}/2005/
$ tla my-default-archive jade@safe4all.org--2005
Now set up the live server:
Now set up the database. If you are starting from scratch:$ cd $ tla get openacs--staging--5.1.0 safe4all $ ln -s /home/safe4all/safe4all /var/lib/aolserver/safe4all $ emacs ~/safe4all/etc/config.tcl $ emacs ~/safe4all/etc/daemontools/run
Set up the database as per Prepare PostgreSQL for an OpenACS Service on the OpenACS install docs.
If you are importing an existing database, then, if you have a database dump to import, you can use Perl to make sure you are loading the information correctly into the dev and staging instances:
Add to the crontab entries for safe4all:# su - postgres $ createuser -a -d safe4all $ exit # su - safe4all $ createdb -E UNICODE safe4all $ perl -pi -e "s/^\\connect olduser$/\\connect safe4all/" dumpfilename.dmp $ psql -f dumpfilename.dmp safe4all
$ export EDITOR=emacs;crontab -e
#30 1-23 * * * /usr/lib/postgresql/bin/vacuumdb --analyze safe4all > /dev/null 2>&1 30 0 * * * /usr/lib/postgresql/bin/vacuumdb --full --analyze safe4all > /dev/null 2>&1
Now let's make sure everything is set up correctly. Run the etc/daemontools/run script by hand.
Check that the server actually starts up, look at the error.log files to troubleshoot. Once it works, then:$ su - # cd /home/safe4all/safe4all/etc/daemontools # ./run
$ su - # ln -s /var/lib/aolserver/safe4all/etc/daemontools /service/safe4all # svgroup web /service/safe4all # exit $ svc -u /service/safe4all
The old version of OpenACS is at ~/wd/openacs-5-1-0, and the new version is at ~/wd/openacs-5-1-1.# su - safe4all-dev $ cd wd $ cvs -z5 -d :pserver:anonymous@cvs.openacs.org:/cvsroot export -r openacs-5-1-1-final acs-core $ mv openacs-4 openacs-5-1-1
$ rsync -av --delete-after --force --exclude='{arch}' --exclude='**/.arch-ids**' openacs-5-1-1/* openacs-5-1-0
$ cd openacs-5-1-0
$ find . \( -name {arch} -o -name ".arch-ids" \) -prune -o -print | sort | \
perl -ne 'chomp; print "$o\n" if -d $o && !/^\Q$o\E/; $o=$_'
$ find . \( -name {arch} -o -name ".arch-ids" \) -prune -o -print | sort | \
perl -ne 'chomp; print "$o\n" if -d $o && !/^\Q$o\E/; $o=$_' | xargs rm -rf
$ tla tree-lint -m (if you get anything do the next line)
$ tla tree-lint -m | xargs rm
$ tla tree-lint -t | xargs tla add-id
$ tla tree-lint
Make sure tree-lint doesn't complain before continuing.
We made the ~/wd/openacs-5-1-0 directory have all the changes from openacs-5-1-1, so just to avoid confusion, let's clean up the working directory:$ tla commit --summary "Imported OpenACS 5.1.1"
$ cd ~/wd $ mv openacs-5-1-1 /tmp $ mv openacs-5-1-0 openacs-5-1-1
If you do have changes to commit, then commit them first, using the directions below.$ cd safe4all-dev $ tla changes
# su - safe4all-dev $ cd safe4all-dev $ tla missing --summary openacs--stable--5.1.0 $ tla replay openacs--stable--5.1.0 $ tla tree-lint -m | xargs rm $ tla tree-lint -t |xargs tla add $ tla changes $ tla log-for-merge >> $(tla make-log) $ emacs +(TAB) (edit the log entry) $ tla commit
If you do have changes to commit, then commit them first, using the directions below. I usually check which packages are available using the acs-admin/install page. I don't actually install from there. Here is an example using calendar:$ cd safe4all-dev $ tla changes
# su - safe4all-dev
$ cd
$ cvs -d:pserver:anonymous@cvs.openacs.org:/cvsroot export -r openacs-5-1-compat calendar
$ rsync -av --delete-after --force --exclude='{arch}' --exclude='**/.arch-ids**' calendar/* dev-server/packages/calendar
$ find dev-server \( -name {arch} -o -name ".arch-ids" \) -prune -o -print | sort | perl -ne 'chomp; print "$o\n" if -d $o && !/^\Q$o\E/; $o=$_'
If you see any results from the find command, you can delete those directories as appropriate. See Tracking a project that doesn't use Arch.
$ cd dev-server $ tla tree-lint $ tla tree-lint -m | xargs rm $ tla tree-lint -t |xargs tla add-id (may have to do multiple times) $ tla changes $ tla make-log $ emacs +(TAB) (edit the log entry) $ tla commit $ cd $ mv calendar /tmp
If you do have changes to commit, then commit them first, using the directions below.$ cd safe4all-staging $ tla changes
If you get conflicts during the replay, see how to deal with .rej files, which are the files that you get when there are conflicts.# su - safe4all-staging $ cd safe4all-staging $ tla missing --summary openacs--dev--5.1.0 $ tla replay openacs--dev--5.1.0
Now commit the changes to the staging branch
$ tla changes $ tla log-for-merge >> $(tla make-log) $ emacs +(TAB) (edit the log entry) $ tla commit
You can make local changes to files, and updates will not overwrite them. So you can edit the etc/config.tcl file for example. If there are conflicts, you will have to resolve them, however.$ su - safe4all $ cd safe4all $ tla missing -s $ tla replay
$ tla changes --diffs $ tla tree-lint -m | xargs rm $ tla tree-lint -t |xargs tla add # (may need to do this multiple times) $ tla commit --summary "Description of my changes"
Make your changes. Commit your changes$ svc -u /service/safe4all-staging
You'll have to resolve any conflicts if you find any. See how to deal with .rej files. Now that we're done, we'll take down the staging server, then update the live server$ tla changes $ tla tree-lint $ tla tree-lint -t $ tla tree-lint -t |xargs tla add $ tla commit --summary "Describe my customization here"
$ svc -d /service/safe4all-staging
$ su - safe4all-staging $ svc -d /service/safe4all-staging $ dropdb safe4all-staging $ createdb -E UNICODE safe4all-staging $ cp ~safe4all/safe4all/database-backup/backup.dmp ~/safe4all-staging/database-backup/ $ perl -pi -e "s/^\\connect safe4all$/\\connect safe4all-staging/" backup.dmp $ psql < backup.dmp safe4all-staging $ svc -u /service/safe4all-staging
You'll see this:$ su - safe4all-dev $ ls -1
dev-server
oacs-5-1
oacs-HEAD
wd
{archives}
The directory: oacs-5-1 is a cvs checkout of OpenACS, from the oacs-5-1 branch.
Let's say the change I want to commit is patch-8.
$ tla get openacs--dev--5.1.0--patch-7 patch-7
$ tla get openacs--dev--5.1.0--patch-8 patch-8
$ diff -ur patch-7 patch-8 -x '{arch}' > patch-file
Then you can use that patch-file to patch oacs-5-1, using the patch command
$ man patch
By default, the dev and staging servers should not start up, and only the production server should. With daemontools, this is accomplished by putting a file called down in the daemontools directory. We want Arch to ignore this.# su - safe4all-dev $ touch ~safe4all-dev/dev-server/etc/daemontools/down # exit # su - safe4all-staging $ cd staging-server $ touch etc/daemontools/down $ echo "precious ^down$" > etc/daemontools/.arch-inventory $ tla tree-lint $ tla tree-lint -t |xargs tla add (will need to do this several times) $ tla tree-lint -m |xargs rm $ tla make-log (edit the log file) $ tla commit
- December 12, 2005:
As of Postgres 7.4, you do not need to explicitly run vacuum all the time. So you may need to update your crontab entries:# 0 1-23 * * * /usr/lib/postgresql/bin/vacuumdb --analyze safe4all-dev > /dev/null 2>&1 0 0 * * * /usr/lib/postgresql/bin/vacuumdb --full --analyze safe4all-dev > /dev/null 2>&1This can be done for dev, staging, and production.