Filtered by category Subsystems Documentation, 1 - 10 of 74 Postings (
all,
summary)
Created by Gustaf Neumann, last modified by Gustaf Neumann 05:16 PM, Friday
The head version of OpenACS (5.8) works with PostgreSQL 9.1 or newer out of the box, no special configurations in postgresql.conf are needed.
To work with PostgreSQL 9, one has to use an actual postgres driver:
OpenACS core + commonly used packages (search, forums, xowiki, ...) have been tested with PostgreSQL 9.2
Created by Rocael Hernández Rizzardini, last modified by Gustaf Neumann 05:06 PM, Friday
Postgres 8.x (e.g. 8.1.* and later) require a few changes in the configuration file for backward compatibility:
1. Configure postgres8 with all compatibility ON in postgresql.conf:
add_missing_from = on
regex_flavor = extended
default_with_oids = on
2. If you are upgrading an OpenACS site between versions 4.5.2 to 5.2 and not continuing to 5.3, then: After the createdb step to create the OpenACS database, generate the next function before you import the pre-existing OpenACS database.
From your shell prompt enter:
psql <dbname>
From the psql prompt enter the follow plpgsql code to create the bitfromint4 function:
create or replace function bitfromint4 (integer)
returns bit varying as '
begin
return $1::bit(32);
end;' language 'plpgsql' immutable strict;
Exit psql:
\q
This is the original thread
For a full script on how to install PG 8.2 with ltree and tsearch2 look at Malte's install script
Created by OpenACS community, last modified by Gustaf Neumann 06 Mar 2013, at 08:47 PM
OpenACS 5.7.0 .LRN 2.5.0 and the main XOTcl components (such as XoWiki) are available as a native Win32 and Win64 applications for Windows XP, Vista, Windows 7, Windows 8, Windows Server 2003, 2008. No extra software (such as Cygwin or VMware) is needed to use this distribution.
The current release is Windows-OpenACS version 1.23 (released August 2011).
For more details, http://www.spazioit.com/pages_en/sol_inf_en/windows-openacs_en/ .
Created by OpenACS community, last modified by Prem Thomas 18 Jan 2013, at 09:54 PM
emacs integrated development environment for OpenACS
emacs documentation: http://www.gnu.org/software/emacs/manual/html_node/
Emacs uses major and minor modes that provide a UI context for editing various file types. Here are some useful ones for working with OpenACS:
CVS Mode Emacs with OpenACS
I use M-x cvs-examine to update and check in code when I am working with OpenACS. One thing that is a pain with CVS is that cvs diff does not tell you what you are going to get if you update, it only tells you what is changed in your local copy.
You can use M-x cvs-examine and then type "d e" next to any of the files in your checkout in the *cvs* buffer to open ediff mode and then interactively merge what's in CVS with your local changes. In ediff mode you use n/p to got to the next/previous difference. You can copy changes from the CVS buffer to your local copy using a/b to copy the the buffer marked A to B or B to A. Type ? on the ediff window to get a list of other commands.
OpenACS Mode for Emacs
See historical page describing oacs.el http://web.archive.org/web/20040621200046/www.thecodemill.biz/services/oacs/
Download: oacs.el.tar updated 2006-08-15 . The lastest version includes nXML mode support in addition to PSGML support. There are good installation instructions in the INSTALL.txt file. A quick install guide for Debian
sudo su -
cd /usr/share/emacs/site-lisp
wget http://www.emacswiki.org/elisp/color-occur.el
wget http://openacs.org/storage/view/xowiki-resources%5C/oacs.el.tar
tar xf oacs.el.tar
apt-get install psgml mmm-mode
# Alternatively compile manually
wget http://www.lysator.liu.se/~lenst/about_psgml/psgml-1.2.5.tar.gz
tar xfz psgml-1.2.5.tar.gz
cd psgml-1.2.5
./configure
make install
cd ..
wget http://switch.dl.sourceforge.net/sourceforge/mmm-mode/mmm-mode-0.4.8.tar.gz
tar xfz mmm-mode-0.4.8.tar.gz
cd mmm-mode-0.4.8
./configure
make install
After this login as the user who is doing the development and edit you .emacs file.
(add-to-list 'load-path "/usr/share/emacs/site-lisp/oacs")
(require 'oacs)
(setq user-full-name "<yourname>")
(setq user-mail-address "<your email>")
(add-to-list 'auto-mode-alist '("\\.vuh" . tcl-mode))
(add-to-list 'auto-mode-alist '("\\.adp" . html-mode))
For recent Emacs versions (> 2008), modify oacs-nxml.el in the downloaded tarball:
line 30: (load "nxml-mode.el") instead of (load "rng-auto.el")
See http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg00947.html
Also, you may need to modify adp.rnc to the correct path to the xhtml.rnc schema on your installation. On OS X, for example, line 5 should read:
include "/Applications/Emacs.app/Contents/Resources/etc/schema/xhtml.rnc"
The following was written by Bart the author of oacs.el
OpenACS lacked a good Integrated Development Environment and as I use Emacs for almost everything it was only natural to fill the void. The Emacs OACS module is an extension to GNU Emacs, the extensible, customizable, self-documenting real-time display editor.
Development status
Emacs OACS's development is driven by the needs I encounter in my OpenACS projects. Development takes place in my spare time. At this stage the code is the documentation. I lack the time to write a proper article. However, as Emacs OACS addresses the issues described in articles XQL Document Type Definition and Replacing SQL bind vars in Emacs some background information can be found in those articles.
Forum thread: Beta Emacs OACS module available
Useful commands
Formating TCL
- M-o ft to re-format Tcl code. See code for details.
- M-o fh to reformat Html or Adp code.
- M-o fs to reformat Sql code.
- M-x oacs-format-separate-tags to separate adjacent tags. E.g. <tr><td>
- M-x oacs-format-includes to place all include attribubtes on a separate line.
Code navigation
- M-o oo to search for any custom regular expression.
- M-o on to search the log for Notice oacs-dbg messages. That is a Notice level message created with the macro 'oddbg'.
- M-o od to search the log for Debug oacs-dbg messages.
- M-o oe to search the log for Error oacs-dbg messages. Etc for all other ns_log levels.
- M-o op to browse Tcl libraries for procedure definitions. This is by far my favorite way of navigating a library!
- M-o fp (find-file-at-point) to NSD error log mode.
- M-o rl to revert the logfile
- M-o ml to to open an error log file and monitor the changes to the log.
Editing docbook xml
editing via Muse mode
editing via nXML mode
See http://openacs.org/doc/nxml-mode.html
psgml mode
See:
Developing with emacs
To make emacs display .vuh files similar to .tcl files, add to .emacs file:
(add-to-list 'auto-mode-alist '("\\.vuh" . tcl-mode))
To make emacs display .adp files similar to .html files, add to .emacs file:
(add-to-list 'auto-mode-alist '("\\.adp" . html-mode))
Common command shortcuts
Minor Modes
M-x global-font-lock-mode highlights syntax using colors
M-x transient-mark-mode shows a highlighted text region
M-x show-paren-mode shows matching parentheses (and when the do not)
Move, Search and Replace
M-x goto-line go to a specific line in a file
M-x goto-char go to a specific character number in a file
M-C-f search forward for matching brace
M-C-b search backward for matching brace
M-x replace-regexp search/replace using regular expressions
M-x query-replace-regexp query/search/replace using regular expressions
note \\( and \\) for start and end subgroups
M-x grep grep creates new buffer with results
for fast loading/editing search hits
Useful "sleepers" (not found in many shortcut sheets)
fg<cr> restart a suspended emacs session from commandline
C-q <key press> add a key without emacs interpreting the key binding
You can configure emacs to create 4 spaces when you press the tab key--important for meeting coding standards. Add this to your .emacs file:
(setq-default tab-width 4 indent-tabs-mode nil)
other useful quicksheets
Created by Joel Aufrecht, last modified by Gustaf Neumann 02 Nov 2012, at 12:13 PM
OpenACS requires, at a minimum, an operating system, database,
and webserver to work. Many additional programs, such as a build environment, Mail
Transport Agent, and source control system, are also needed for
a fully effective installation.
Table 2.2. Version Compatibility Matrix
| OpenACS Version |
3.2.5 |
4.5 |
4.6 |
4.6.1 |
4.6.2 |
4.6.3 |
5.0 |
5.1 |
5.2 (core)
|
5.3 (core)
|
5.4 (core)
|
5.5 (core)
|
5.6 (core)
|
5.7 (core)
|
5.8 (core)
|
| AOLserver |
3 |
Yes |
No |
| 3.3+ad13 |
Maybe |
Yes |
No |
| 3.3oacs1 |
Maybe |
Yes |
No |
| 3.4.4 |
No |
| 3.4.4oacs1 |
Maybe |
Yes |
No |
| 3.5.5 |
Maybe |
Yes |
No |
| 4.0 |
Maybe |
Yes |
| 4.5 |
No |
Yes |
| Naviserver |
4.99.4 |
No |
Maybe |
Yes |
| Tcl |
8.4 |
Yes |
No |
| 8.5.4 - |
Maybe |
Yes |
| PostgreSQL |
7.0 |
Yes |
No |
| 7.2 |
Maybe |
Yes |
No |
| 7.3.2 - 7.3.x |
No |
Yes |
No |
| 7.4 |
No |
Yes |
No |
| 8.0 |
No |
Maybe |
Yes |
| 8.1 |
No |
Yes |
| 8.2 |
No |
tar: no, CVS: Yes |
Yes |
| 8.3 |
No |
Yes |
| 8.4 |
No |
Yes |
| 9.0 |
No |
Yes |
| 9.1 |
No |
Yes |
| 9.2 |
No |
Yes |
| Oracle |
8.1.6 |
Maybe |
Yes |
Maybe |
| 8.1.7 |
Maybe |
Yes |
Maybe |
| 9i |
No |
Yes |
Maybe |
| 10g |
No |
Yes |
Maybe |
| 11g |
No |
Maybe |
The value in the cells correspond to the last version of that release, and
not necessarily to all minor releases. Empty cells denote an unknown status.
Created by OpenACS community, last modified by Gustaf Neumann 22 Jun 2012, at 05:07 PM
Get AOLserver and modules Download AOLserver and modules from CVS. Install Tcl if it is not installed yet.
Comments:
- one should base the documentation on releases, not on head versions. So, just relying on the head version of github is not recommended for beginners.
- newer versions of aolserver have ns_cache included (4.5.1 or newer). no need for the extra module listed below.
- using "aolserver40r10" as name for the install directory is strange, especially, when the release is not 4.0.10
[root root]# mkdir -p /usr/local/src/aolserver40r10/
[root root]# git clone git://github.com/aolserver/aolserver.git /usr/local/src/aolserver40r10/aolserver/
[root root]# git clone git://github.com/aolserver/nssha1.git /usr/local/src/aolserver40r10/nssha1/
[root root]# git clone git://github.com/aolserver/nspostgres.git /usr/local/src/aolserver40r10/nspostgres/
[root root]# git clone git://github.com/aolserver/nsoracle.git /usr/local/src/aolserver40r10/nsoracle/
[root root]# cd /usr/local/src/aolserver40r10
[root root]# cvs -z3 -d:pserver:anonymous@aolserver.cvs.sourceforge.net:/cvsroot/aolserver co nscache
Download en:tdom, tcllib, and XOTcl.
[root aolserver]# cvs -z3 -d:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs co tdom
[root aolserver]# wget http://heanet.dl.sourceforge.net/sourceforge/tcllib/tcllib-1.10.tar.bz2
[root aolserver]# wget http://media.wu-wien.ac.at/download/xotcl-1.6.7.tar.gz
Configure, compile and install AOLserver. Many people need to run more than one version of AOLserver in parallel. This section accomodates future upgrades by installing AOLserver 4 in /usr/local/aolserver40r10.
[root aolserver]# cd /usr/local/src/aolserver40r10/aolserver
[root aolserver]# ./configure --prefix=/usr/local/aolserver40r10 \
--with-tcl=/usr/local/lib/ \
--enable-threads
[root aolserver]# make
[root aolserver]# make install
If this is the only version of AOLserver in use, or is the default version, create a symlink. If not, then be sure to use /usr/local/aolserver40r10 instead of /usr/local/aolserver in future steps and check any scripts and makefiles you run to ensure they use the correct path.
[root aolserver]# ln -s /usr/local/aolserver40r10 /usr/local/aolserver
Configure, compile and install the modules.
OpenACS looks for the Oracle driver at /usr/local/aolserver/bin/ora8.so, but some versions of nsoracle may create nsoracle.so instead. In that case, you can symlink (ln -s nsoracle.so ora8.so) to fix it.
-
Install nscache
[root aolserver]# cd /usr/local/src/aolserver40r10/nscache
[root nscache]# make install AOLSERVER=/usr/local/aolserver40r10
-
Install nsoracle (if you want to use Oracle)
[root nscache]# cd ../nsoracle
[root nsoracle]# make install AOLSERVER=/usr/local/aolserver40r10
-
Install nspostgres (if you want to use Postgres)
[root nscache]# cd ../nspostgres
[root nspostgres]# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib
[root nspostgres]# make install POSTGRES=LSB \
ACS=1 \
INST=/usr/local/aolserver40r10 \
AOLSERVER=/usr/local/aolserver40r10
You might try POSTGRES=PG_CONFIG if that does not work.
If you get errors like:
nspostgres.c: In function `Ns_PgTableList':
nspostgres.c:679: warning: passing arg 3 of `Tcl_DStringAppend' as signed due to prototype
then PostGreSQL is probably not in the standard location.
[jiml at cvs openacs here.] There are -new- (as of within 2nd quarter 2007) changes to nspostgres, there have been expansions of the ways to locate postgres, and changes to some error reporting. Please read the README and the Makefile. The nspostgres build can now use postgres's pg_config to locate a particular postgres installation. [jiml out]
The location of PostGreSQL is very dependent on which method was used to install it. To correct the problem, replace LSB with the path to the path to your PostGreSQL installation. Often this is /usr/local/pgsql.
Another possibility is that you may need to set the LD_LIBRARY_PATH environmental variable. You may still get warnings, but sometimes this will fix things enough to work.
[root nspostgres]# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib
You can use the ldd command to verify that all libraries are linked in: ldd /usr/local/src/aolserver40r10/nspostgres/nspostgres.so
If you run into problems with libpq.a do the following (and repeat the step above)
[root nspostgres]# ranlib /usr/local/pgsql/lib/libpq.a
If you run into problems with the linker, edit the Makefile. Add -lnsdb to the MODLIBS var.
MODLIBS = -L$(PGLIB) -lpq -lnsdb
-
Install nssha1
[root nspostgres]# cd ../nssha1
Now install nssha1:
[root nssha1]# make install NSHOME=/usr/local/aolserver40r10
If the make fails you will have to edit nssha1.c. Comment out the following 2 lines (lines 139-140):
// typedef unsigned int u_int32_t;
// typedef unsigned char u_int8_t;
-
Install tDOM
Note, if you use bash31 you need to apply a patch, see http://openacs.org/forums/message-view?message_id=369867 for details.
[root nssha1]# cd ../tDOM-0.8.0/unix
Edit the CONFIG file. Uncomment the instructions meant for AOLserver 4, but edit it to look like this:
../configure --enable-threads --disable-tdomalloc --prefix=/usr/local/aolserver40r10 --with-tcl=/usr/local/src/aolserver40r10/tcl-8.4.14/unix
Now you can compile and configure tDOM
[root unix]# sh CONFIG
[root unix]# make install
-
Install tcllib
[root aolserver]# cd /usr/local/src/aolserver40r10
[root aolserver]# tar xvfj tcllib-1.10.tar.bz2
[root aolserver]# cd tcllib-1.10
[root aolserver]# ./configure --prefix=/usr/local/aolserver40r10
[root aolserver]# make install
-
Install XOTcl
[root aolserver]# cd /usr/local/src/aolserver40r10
[root aolserver]# tar xvfz xotcl-1.6.7.tar.gz
[root aolserver]# cd xotcl-1.6.7/
[root aolserver]# export CC=gcc
[root aolserver]# ./configure --enable-threads --enable-symbols \
--prefix=/usr/local/aolserver40r10 \
--exec-prefix=/usr/local/aolserver40r10 \
--with-tcl=/usr/local/src/aolserver40r10/tcl8.4.14/unix
[root aolserver]# make
[root aolserver]# make install-aol
Add a database-specific wrapper script. This script sets database environment variables before starting AOLserver; this allows the AOLserver instance can communicate with the database. There is one script each for Oracle and PostgreSQL. They don't conflict, so if you plan to use both databases, install both. Note that this section requires you to have the OpenACS, which you can get through CVS, through a tarball, or by other means. You can come back to this section after you acquire the OpenACS code, but don't forget to come back. (Note to maintainers: this should be moved to the next page and integrated into the text there)
-
Oracle
[root aolserver]# cd /usr/local/aolserver40r10/bin
[root bin]# cp /tmp/openacs-5.2.0d1/packages/acs-core-docs/www/files/nsd-oracle.txt ./nsd-oracle
[root bin]# chmod 750 nsd-oracle
[root bin]#
-
PostgreSQL
[root aolserver]# cd /usr/local/aolserver40r10/bin
[root bin]# cp /var/tmp/openacs-5.2.0d1/packages/acs-core-docs/www/files/nsd-postgres.txt ./nsd-postgres
[root bin]# chmod 755 nsd-postgres
[root bin]#
You may need to edit these scripts if you are not using /usr/local/aolserver as the directory of Aolserver4.
Test AOLserver. We will use the sample-config.tcl file provided in the AOLserver distribution to test AOLserver. This test will use the nobody user and web group. The sample-config.tcl configuration writes to the default log locations, so we need to give it permission to do so or it will fail. Grant the web group permission to write to /usr/local/aolserver/log and /usr/local/aolserver/servers.
[root root]# cd /usr/local/aolserver
[root aolserver]# chown -R root.web log servers
[root aolserver]# chmod -R g+w log servers
[root aolserver]# ls -l
total 32
drwxr-sr-x 2 root root 4096 Mar 8 12:57 bin
drwxr-xr-x 3 root root 4096 Mar 8 10:34 include
drwxr-sr-x 3 root root 4096 Mar 8 10:34 lib
drwxrwsr-x 2 root web 4096 Mar 8 10:31 log
drwxr-sr-x 3 root root 4096 Mar 8 10:31 modules
-rw-r--r-- 1 root root 7320 Mar 31 2001 sample-config.tcl
drwxrwsr-x 3 root web 4096 Mar 8 10:31 servers
[root aolserver]#
Note: AOLserver4.x does not include a default start page, so we create one for this test. Type echo "Welcome to AOLserver" > /usr/local/aolserver40r10/servers/server1/pages/index.html
Now, run AOLserver using the sample configuration to verify it runs without errors. This configuration attempts to automatically get the machine's IP address and hostname. It will then start up the server at port 8000 of that IP address.
[root aolserver]# ./bin/nsd -t sample-config.tcl -u nobody -g web
[root aolserver]# [08/Mar/2003:15:07:18][31175.8192][-main-] Notice: config.tcl: starting to read config file...
[08/Mar/2003:15:07:18][31175.8192][-main-] Warning: config.tcl: nsssl not loaded -- key/cert files do not exist.
[08/Mar/2003:15:07:18][31175.8192][-main-] Warning: config.tcl: nscp not loaded
-- user/password is not set.
[08/Mar/2003:15:07:18][31175.8192][-main-] Notice: config.tcl: finished reading
config file.
The first warning, about nsssl, can be ignored. We will not be using nsssl; we will be using nsopenssl instead. The nssl error happens because we have not fully configured secure connections to use nsopenssl. The nscp warning means that without a user and password in the sample-config.tcl file, the administrative panel of AOLserver will not load. We do not plan to use it and can ignore that error as well. Any other warning or error is unexpected and probably indicates a problem.
Test to see if AOLserver is working by starting Mozilla or Lynx on the same computer and surfing over to your web page. If you browse from another computer and the sample config file didn't guess your hostname or ip correctly, you will get a false negative test.
[root aolserver]# lynx localhost:8000
You should see a "Welcome to AOLserver" page. If this does not work, try browsing to http://127.0.0.1:8000/. If this still does not work, read the en:aolserver-admin section on "Troubleshooting AOLserver". Note that you will not be able to browse to the web page from another machine, because AOLserver is only listening to the local address.
Shutdown the test server:
[root aolserver]# killall nsd
[root aolserver]#
The killall command will kill all processes with the name nsd, but clearly this is not a good tool to use for managing your services in general. We cover this topic in en:aolserver-admin section.
Set up the file system for one or more OpenACS Sites
This should already have been done, according to the instructions at the bottom of this page: en:Get_the_Code
Set up a user account for each site.
AOLserver needs to be started as the root user if you want to use port 80. Once it starts, though, it will drop the root privileges and run as another user, which you must specify on the command line. This user should have as few privileges as possible, because if an intruder somehow breaks in through AOLserver, you do not want the intruder to have any ability to do damage to the rest of your server.
At the same time, AOLserver needs to have write access to some files on your system in order for OpenACS to function properly. So, we run AOLserver with a different user account for each different service. Create the username as $OPENACS_SERVICE_NAME.
The password should be blank, to prevent login by password, for increased security. The only way to log in will be with ssh certificates. The only people who should log in are developers for that specific instance. Add this user, and put it in the $OPENACS_SERVICE_NAME group so that it can use database and server commands associated with that group. (If you don't know how to do this, type man usermod. You can type groups to find out which groups a user is a part of)
[root root]# useradd $OPENACS_SERVICE_NAME
You also need to set up a group called web.
[root root]# groupadd web
Then change the user to be a part of this group:
[root root]# usermod -g web $OPENACS_SERVICE_NAME
ref: http://openacs.org/doc/aolserver4.html
Created by roc@, last modified by Dafydd Crosby 20 Jun 2012, at 10:10 PM
There are many ways to obtain the latest OpenACS Distribution:
get the tarball:
Download from OpenACS.org: http://openacs.org/projects/openacs/download/
Unpack the OpenACS tarball. Usually something like this works:
tar xvf openacs-4.tar
or get the files via CVS: If you want to track fresh code developments between releases, or you are an OpenACS core developer, you may want to install from CVS. This is identical to downloading a distribution, except that you get the files from CVS instead of the tarball. The following commands are used to obtain OpenACS 5.6 from CVS:
cvs -d:pserver:anonymous@cvs.openacs.org:/cvsroot login
# press enter for password
cvs -d:pserver:anonymous@cvs.openacs.org:/cvsroot checkout -r oacs-5-6 acs-core
The command above checks out the core packages of OpenACS in a directory named openacs-4. For the entire OpenACS version 5.6 branch you can use the following commands (adjust as required going forward):
cvs -d:pserver:anonymous@cvs.openacs.org:/cvsroot checkout -r oacs-5-6 openacs-4
If the the branch name (like oacs-5-6) is omitted, the the leading edge developer version (the HEAD release) is obtained
cvs -d:pserver:anonymous@cvs.openacs.org:/cvsroot checkout openacs-4
In order to check out a single package (e.g. the package cronjob) from e.g. the leading edge developer version (HEAD), use
cvs -d:pserver:anonymous@cvs.openacs.org:/cvsroot checkout openacs-4/packages/cronjob
For most OpenACS packages, CVS aliases are defined. In order to checkout e.g. the forums package from OpenACS 5.5, just use:
cvs -d:pserver:anonymous@cvs.openacs.org:/cvsroot checkout -r oacs-5-5 forums
More info here: http://www.openacs.org/test-doc/using-cvs-with-openacs
Looking for README instructions or installers? View the OpenACS Installation instructions: en:openacs-system-install, otherwise continue by setting up the OpenACS distribution:
Set up the file system for one or more OpenACS sites
For Linux Standard Base compliance and ease of backup, all of the files in each OpenACS site are stored in a subdirectory of /var/lib/aolserver, one subdirectory (SERVERROOT) per site (see: en:openacs-reference-platform). The first time you install an OpenACS site on a server, you must create the parent directory and set its permissions:
While logged in as root:
mkdir -p /var/lib/aolserver
chgrp web /var/lib/aolserver
chmod 770 /var/lib/aolserver
Move the uncompressed code to SERVERROOT and rename the directory to $OPENACS_SERVICE_NAME:
mv openacs-4 /var/lib/aolserver/$OPENACS_SERVICE_NAME
Created by David Arroyo Menéndez, last modified by Gustaf Neumann 09 Nov 2011, at 02:07 PM
There are now debian packages for all OpenACS requirements, and OpenACS (.LRN) itself.
See The debian wiki page
The rest of this page is superseded by the debian wiki page.
You can also use the en:OpenACSDebianInstallGuide quicksheet.
Install tcl 8.4
apt-get install tcl8.4 tcl8.4-dev tcl8.4-doc
Install PostgreSQL 8.2
(from ubuntu repository or debian etch) for PG 8.2 I had to add this line to the /etc/apt/sources.list (under debian etch)
deb http://www.backports.org/debian etch-backports main contrib non-free
Install with apt
apt-get install postgresql-8.2 postgresql-client postgresql-dev postgresql-doc
under debian-etch I did this to avoid downloading some 7.4-packages
apt-get install postgresql-8.2 postgresql-client-8.2 postgresql-dev postgresql-doc-8.2
Config the postgresql 8.x
from http://openacs.org/xowiki/How_to_install_in_Postgres_8.x
/etc/postgresql/8.2/main/postgresql.conf
add_missing_from = on
regex_flavor = extended
default_with_oids = on
On debian you could need to change the postgresql port number to 5432, see /etc/postgresql/8.2/main/postgresql.conf
Create the database
su postgres -c "/usr/lib/postgresql/8.2/bin/createlang plpgsql template1"
su postgres -c "createuser service"
Shall the new user be allowed to create
databases? (y/n) y
Shall the new user be allowed to create
more new users? (y/n) y
CREATE USER
su postgres -c "createdb -E UNICODE service"
Install AOLserver
(AOLserver 4.5 for now only from debian unstable)
# Note: on ubuntu maybe more better install AOLserver 4.0 and you can download it from debian stable
- Add the next lines to /etc/apt/sources.list
deb http://http.us.debian.org/debian stable main contrib non-free
deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free
deb http://security.debian.org stable/updates main contrib non-free
- Update
apt-get update
# If you have any trouble with gpg keys, then you must read: http://www.davidam.com/debian/debian-gpg
- Install wit apt
apt-get install -t unstable aolserver4 aolserver4-nscache aolserver4-nsopenssl aolserver4-nspostgres aolserver4-nssha1 aolserver4-dev aolserver4-doc daemontools-installer cvs
*note: unpack the https.gz from aolserver4-nsopenssl and copy it over to the tcl directory of aolserver4, if not the api with https such as ns_httpspost will not be available.
https.gz is normally found at /usr/share/doc/aolserver4-nsopenssl/examples/
The tcl directory for aolserver4 is normally found at /usr/lib/aolserver4/modules/tcl/
- Install tdom from cvs
# Sometimes cvs.tdom.org is down, if you have problems you can download with
wget http://cognovis.de/file-storage/view/aolserver45.tar.bz2
cd /usr/lib/aolserver4
sudo ln -s /usr/include/aolserver4 include
mkdir /usr/local/src/aolserver4
cd /usr/local/src/aolserver4
sudo cvs -z3 -d:pserver:anonymous@cvs.tdom.org:/usr/local/pubcvs co tdom
cd tdom/unix
../configure --enable-threads --disable-tdomalloc --with-aolserver=/usr/lib/aolserver4 --prefix=/usr/lib/aolserver4 --with-tcl=/usr/lib/tcl8.4
sudo make install
- Install XOTcl
cd /usr/local/src
sudo wget http://media.wu-wien.ac.at/download/xotcl-1.6.7.tar.gz
sudo tar xvfz xotcl-1.6.7.tar.gz
cd xotcl-1.6.7/
export CC=gcc
sudo ./configure --enable-threads --enable-symbols --prefix=/usr/lib/aolserver4 --exec-prefix=/usr/lib/aolserver4 --with-tcl=/usr/lib/tcl8.4
sudo make
sudo make install-aol
- Install TclLib
cd /usr/local/src
sudo wget http://kent.dl.sourceforge.net/sourceforge/tcllib/tcllib-1.10.tar.gz
sudo tar xvzf tcllib-1.10.tar.gz
cd tcllib-1.10
sudo ./configure --prefix=/usr/lib/aolserver4
sudo make install
Download and config OpenACS 5.4
- Create the directory where we can install OpenACS
adduser service
su - service
mkdir aolserver
cd aolserver
- Copy the two config files aolserver.nsadmin and nsadmin.tcl there:
wget http://www.davidam.com/debian/aolserver.nsadmin
wget http://www.davidam.com/debian/nsadmin.tcl
- Change nsadmin to service
mv aolserver.nsadmin aolserver.service
mv nsadmin.tcl service.tcl
sed -i "s/nsadmin/service/g" aolserver.service service.tcl
- Download OpenACS from cvs
cvs -z3 -d :pserver:anonymous@cvs.openacs.org:/cvsroot co -r oacs-5-4 openacs-4
mv openacs-4 service
chmod 774 aolserver.service
# create log directory (if needed)
mkdir service/log
- Start AOLserver
./aolserver.service start
Some minutes after that, it must be runing on http://localhost:8000
Created by Malte Sussdorff, last modified by Gustaf Neumann 03 Nov 2011, at 02:26 PM
I worked off the work of Dave Bauer and used Macports.
Unfortunately, the default configuration of Mac OS X does not allow suitable amounts of shared memory to be created to run the database server.
Therefore you should edit your /etc/sysctl.conf
On a MacBook Pro with 2GB of RAM, the author's sysctl.conf contains:
kern.sysv.shmmax=1610612736
kern.sysv.shmall=393216
kern.sysv.shmmin=1
kern.sysv.shmmni=32
kern.sysv.shmseg=8
kern.maxprocperuid=512
kern.maxproc=2048
Download and install MacPorts from http://www.macports.org/install.php and get the latest version (1.7.1 as of 2009-04-18)
Install PostgreSQL 8.4
sudo port -k install postgresql84
cd `port work postgresql84`/postgresql-8.4.7/contrib/ltree
make all
sudo make install
sudo port install postgresql84-server
This installs expat, gperf, libiconv, ncursesw, ncurses, gettext, m4, bison, zlib, libxml2, libxslt1, openssl, readline, postgresql82. The macports install then says
To create a database instance, after install do
sudo mkdir -p /opt/local/var/db/postgresql84/defaultdb
sudo chown postgres:postgres /opt/local/var/db/postgresql84/defaultdb
sudo su postgres -c '/opt/local/lib/postgresql84/bin/initdb -D /opt/local/var/db/postgresql84/defaultdb'
Then after initdb postgres says to start postgresql. Before that edit the config file to make it compatible with ACS
sudo emacs -nw /opt/local/var/db/postgresql84/defaultdb/postgresql.conf
Once you have emacs open, change the following config items:
autovacuum = on
add_missing_from = on
default_with_oids = on
regex_flavor = extended
Now start the PostgreSQL Server
sudo su postgres -c '/opt/local/lib/postgresql84/bin/postgres -D /opt/local/var/db/postgresql84/defaultdb' &
Install plpgsql as a language
/opt/local/lib/postgresql84/bin/createlang plpgsql template1 -U postgres
Last but not least, put postgresql under launchctl so you can start and stop it:
sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql84-server.plist
To start it from then on just call
sudo launchctl start org.macports.postgresql84-server
To stop it:
sudo launchctl stop org.macports.postgresql84-server
Install AOLserver 4.5
sudo port install tcl +threads +headers
This will install Tcl with threads enabled, which is needed for AOLserver.
sudo port install aolserver
Now we have AOLserver installed into /opt/local/aolserver. You now need to configure the server to your needs. You might want to create another user (e.g. aolserver) to run the server. First get all the files:
cd /usr/local/src
mkdir aolserver
cd aolserver
TCLLIB=1.13
XOTCL=1.6.7
# Path for the AOLserver installation
NS=/opt/local/aolserver
cvs -z3 -d:pserver:anonymous@aolserver.cvs.sourceforge.net:/cvsroot/aolserver co nssha1
cvs -z3 -d:pserver:anonymous@aolserver.cvs.sourceforge.net:/cvsroot/aolserver co nspostgres
echo "Getting TDOM ..."
git clone git://github.com/tDOM/tdom.git
echo "Getting TCL modules ..."
curl -L -O http://downloads.sourceforge.net/tcllib/tcllib-${TCLLIB}.tar.bz2
curl -L -O http://downloads.sourceforge.net/tcl/thread2.6.5.tar.gz
curl -L -O http://media.wu-wien.ac.at/download/xotcl-${XOTCL}.tar.gz
Now install nssha1
cd nssha1
sudo make install NSHOME=${NS}
cd ..
Now go for nspostgres
cd nspostgres/
# Edit the Makefile so it reads (adding the "-lnsdb")
MODLIBS = -L$(PGLIB) -lpq -lnsdb
sudo make install AOLSERVER=/opt/local/aolserver/ PGCONFIG=/opt/local/lib/postgresql84/bin/pg_config POSTGRES=/opt/local PGINC=/opt/local/include/postgresql84/ PGLIB=/opt/local/lib/postgresql84/ ACS=1
cd ..
tDOM
cd tDOM-0.8.2/unix
../configure --mandir=/usr/local/share/man --libdir=/opt/local/aolserver/lib --with-tcl=/opt/local/lib --with-aolserver=/opt/local/aolserver
sudo make install
cd ../..
Thread
tar xvfz thread2.6.5.tar.gz
cd thread2.6.5/unix
../configure --mandir=/usr/local/share/man --libdir=/Library/Tcl --with-tcl=/System/Library/Frameworks/Tcl.framework --with-tclinclude=/System/Library/Frameworks/Tcl.framework/Headers --with-aolserver=/opt/local/aolserver
sudo make install
cd ../..
XOTcl
The private header files of Tcl are missing, therefore I got the source and recompiled Tcl:
curl -L -O http://downloads.sourceforge.net/tcl/tcl8.5.9-src.tar.gz
tar xfz tcl8.5.9-src.tar.gz
cd tcl8.5.9/unix
./configure --enable-threads --prefix=/opt/local --disable-corefoundation
sudo make install
cd ../..
tar xvfz xotcl-1.6.7.tar.gz
cd xotcl-1.6.7
NS=/opt/local/aolserver/
./configure --enable-threads --enable-symbols --prefix=${NS} --exec-prefix=${NS} --with-tcl=/opt/local/lib
sudo make install-aol
cd ..
Now we finish off with tcllib
tar xvfj tcllib-1.13.tar.bz2
cd tcllib-1.13
./configure --prefix=/opt/local/aolserver/
sudo make install
Type in terminal before starting nsd
ulimit -n 256
I would recommend to install the server in ~/Sites/
yourserver if you don't intend to run multiple different servers with access rights on your machine. Checkout the OpenACS code and Edit ~/Sites/
yourserver/etc/config.tcl and make the following changes
# Change the server root
set serverroot "~/Sites/${server}"
# Make sure that OpenACS finds PostgreSQL. Add two lines to the $database if statement
if { $database eq "oracle" } {
set db_password "mysitepassword"
} else {
set db_host localhost
set db_port ""
set db_user $server
ns_section "ns/db/driver/postgres"
ns_param pgbin /opt/local/lib/postgresql84/bin/
}
# Change the AOLserver location
set homedir /opt/local/aolserver
Now you can start up your server. First try ist with /opt/local/aolserver/bin/nsd -t ~/Sites/yourserver/etc/config.tcl. If this works you might want to create a launchctl entry as you did above for postgresql
Edit /Library/LaunchDaemons/org.openacs.YOURSERVER.plist and enter the following
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.openacs.YOURSERVER</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/Users/youruser/Sites/yourserver/etc/daemontools/run</string>
</array>
<key>ServiceDescription</key>
<string>OpenACS Service</string>
<key>UserName</key>
<string>youruser</string>
<key>GroupName</key>
<string>staff</string>
</dict>
</plist>
Now put yourserver under launchctl so you can start and stop it:
sudo launchctl load -w /Library/LaunchDaemons/org.openacs.yourserver.plist
To start it from then on just call
sudo launchctl start org.openacs.yourserver
To stop it:
sudo launchctl stop org.openacs.yourserver
It is a good idea to schedule regular backups for your server(s). To do this create a shell script, e.g. backup.sh which executes your backups and then create a launchdaemon plist to run your backups nightly
Edit /Library/LaunchDaemons/org.openacs.backup.plist and enter the following
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.openacs.backup</string>
<key>ProgramArguments</key>
<array>
<string>/Users/youruser/Sites/backup.sh</string>
</array>
<key>LowPriorityIO</key>
<true/>
<key>Nice</key>
<integer>1</integer>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>3</integer>
<key>Minute</key>
<integer>15</integer>
</dict>
</dict>
</plist>
If you intend to run AOLserver on a continous basis remember that it is a great idea to make sure it responds properly. To do this you can run a keepalive service.
Edit /Library/LaunchDaemons/org.openacs.keepalive.plist and enter the following
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.openacs.keepalive.plist</string>
<key>ProgramArguments</key>
<array>
<string>/Users/youruser/Sites/keepalive.sh</string>
<string>yourserver</string>
<string>yourport</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>180</integer>
</dict>
</plist>
Your keepalive.sh could look like this
#!/bin/bash
GREP=/usr/bin/grep
HEAD="/usr/bin/head -1"
INSTANCE="$1";
PORT="$2"
[ -z "$1" ] && exit
[ -z "$2" ] && exit
MAIL_ADDR=""
WGET_FILE=/tmp/.output-keepalive-${INSTANCE}
URL_TEST="http://127.0.0.1:${PORT}/SYSTEM/dbtest"
[ -f ${WGET_FILE} ] && rm -f ${WGET_FILE}
_restartwebserver ()
{
/bin/launchctl start org.openacs.$INSTANCE
sleep 3
/bin/launchctl start org.openacs.$INSTANCE
}
_sendmail ()
{
echo "${1}" |mailx -s AolWebserver ${MAIL_ADDR}
}
while [ 1 -eq 1 ];
do
[ -f ${WGET_FILE} ] && /bin/rm -f ${WGET_FILE}
/usr/bin/curl -s -o $WGET_FILE --connect-timeout 3 --retry 3 "${URL_TEST}"
if [ -f ${WGET_FILE} ]
then
FIRST_LINE=`${HEAD} ${WGET_FILE} | ${GREP} -i "success"`
[ -z "${FIRST_LINE}" ] && _restartwebserver && _sendmail "I just restarted the $INSTANCE webserver on `uname -n`" && echo "`date +'%D-%H:%M'` :: FAILURE" || echo "`date +'%D-%H:%M'` :: success $INSTANCE" >>/Users/malte/Sites/keepalive.log
else
_restartwebserver && _sendmail "I just restarted the $INSTANCE webserver on `uname -n`"
# _restartwebserver
echo "`date +'%D-%H:%M'` :: FAILURE"
fi
done
If you intend to run AOLserver on a continous basis remember that it is a great idea to restart your server once per night, otherwise the memory footprint will grow and grow and grow.
Edit /Library/LaunchDaemons/org.openacs.restart.plist and enter the following
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.openacs.restart</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/Users/youruser/Sites/restart.sh</string>
</array>
<key>LowPriorityIO</key>
<true/>
<key>Nice</key>
<integer>1</integer>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>4</integer>
<key>Minute</key>
<integer>15</integer>
</dict>
</dict>
</plist>
Now put scripts under launchctl so they will run in the night:
sudo launchctl load -w /Library/LaunchDaemons/org.openacs.backup.plist
sudo launchctl load -w /Library/LaunchDaemons/org.openacs.restart.plist
sudo launchctl load -w /Library/LaunchDaemons/org.openacs.keepalive.plist
Your restart.sh could look like this
#!/bin/bash
echo "cognovis"
sudo launchctl stop org.openacs.yourserver
sleep 10
sudo launchctl start org.openacs.yourserver
Created by Gustaf Neumann, last modified by Gustaf Neumann 03 Nov 2011, at 02:25 PM
XOTcl is an object oriented extension for Tcl and required part of OpenACS installations since
TIP #87. The OpenACS package xotcl-core provides base functionality and
integration with the OpenACS framework.
The current version of
XOTcl is 1.6.7. Read about XOTcl motivations and feature from
http://media.wu-wien.ac.at/whatIsXOTcl.html .
For more details about XOTcl, see XOTcl Homepage .
INSTALLATION of XOTcl:
One can get XOTcl e.g. in binary form from
debian or it can be complied from source. The following instructions describe, how to compile XOTcl from source.
- Get, compile and install XOTcl
Get xotcl-1.6.7:
cd /usr/local/src
wget http://media.wu-wien.ac.at/download/xotcl-1.6.7.tar.gz
tar zxvf xotcl-1.6.7.tar.gz
The following commands can be used to compile XOTcl and install it into the appropriate places of the specified aolserver. We assume that the aolserver is installed under /usr/local/aolserver:
cd xotcl-1.6.7
CC=gcc;export CC
./configure --enable-threads --enable-symbols --prefix=/usr/local/aolserver --exec-prefix=/usr/local/aolserver --with-tcl=/usr/src/tcl8.4.16/unix
Use appropriate paths for aolserver4 and your tcl version.
make
make install-aol
After the "make install-aol" from the XOTcl sources, a file xotcl.tcl is installed in the directory /usr/local/aolserver/modules/tcl/ that handles .xotcl files and XOTcl serialization in the aolserver.
- Restart your aolserver to load xotcl.