Install OpenACS with NaviServer from Scratch
This page describes how to install OpenACS with NaviServer on Unix-like systems (e.g. Linux, macOS, Solaris, OmniOS) by compiling all but PostgreSQL from scratch, guided by script that collects the components from various sources, compiles it, etc.
The installation is done in two steps:
- install-ns.sh: Install NaviServer and its components for a PostgreSQL installation from scratch by obtaining the relevant sources and compiling it. The script assumes PostgreSQL to be already installed (or obtainable via package managers), and installs all other components by obtaining it from the source repositories and compiling it from scratch (e.g. Tcl, tcllib, tDOM, libthread, nsf/XOTcl 2).
- install-oacs.sh: Install OpenACS from CVS/git. This script configures a (pre-installed) PostgreSQL installation for
OpenACS, adds hstore, installs OpenACS core, basic OpenACS packages, xowiki, xowf and optionally dotlrn from CVS/git and generates a config file and startup files (for Ubuntu and Fedora Core). The script assumes a pre-existing NaviServer installation, installed e.g. via install-ns.sh
These install scripts are frequently updated when new components are released or problems are detected (commit log).
If you open the links above, use save-as in the browser to save the files. Alternatively, download the files as .zip file or clone the repository via GitHub.
cd /usr/local/src git clone https://github.com/gustafn/install-ns cd install-ns
The scripts work under a typical Linux installation (e.g. Ubuntu, Fedora Core) as well as on Mac OS X or on OmniOS, OpenBSD 6.1, 6.3, 6.6, 6.8, 6.9, FreeBSD 12.2, 13.0, Ubuntu 12.04, 13.04, 14.04, 16.04, 18.04, 20.04, Raspbian GNU/Linux 9.4 (stretch), Fedora Core 18, 20, 32, 35, CentOS 7, Roxy Linux 8.4, ArchLinux.. The scripts are tested (over the years) with PostgreSQL 9.1 to 14.5.
On a fresh Ubuntu installation, you should be able to download the two scripts from this page and install OpenACS with NaviServer in the following steps:
sudo bash bash install-ns.sh bash install-ns.sh build bash install-oacs.sh bash install-oacs.sh build
When running "install-ns.sh", you will see an output like the following (shortened here).
SETTINGS build_dir (Build directory) /usr/local/src ns_install_dir (Installation directory) /usr/local/ns version_ns (Version of NaviServer) 4.99.24 git_branch_ns (Branch for git checkout of ns) main version_modules (Version of NaviServer Modules) 4.99.24 version_tcllib (Version of Tcllib) 1.20 version_thread (Version Tcl thread library) version_xotcl (Version of NSF/NX/XOTcl) 2.4.0 version_tcl (Version of Tcl) 8.6.12 version_tdom (Version of tDOM) 0.9.1 ns_user (NaviServer user) nsadmin ns_group (NaviServer group) nsadmin (Make command) make (Type command) type -a ns_modules (NaviServer Modules) nsdbpg with_mongo (Add MongoDB client and server) 0 with_postgres (Install PostgreSQL DB server) 1 with_postgres_driver (Add PostgreSQL driver support) 1 with_system_malloc (Tcl compiled with system malloc) 0 with_ns_doc (NaviServer documentation) 1
The values in the first column can be used to tailor the system for your needs by setting same-named shell variables. One can use e.g.
version_tdom=0.9.3 bash install-ns.sh
to configure the compilation to use tDOM in version 0.9.3 instead of 0.9.1. As a more detailed example, if you want to use the newest version of NaviServer, and you want to use a different build directory and get also some extra modules compiled from their git versions, use e.g. the following command:
version_ns=GIT \ build_dir=/usr/local/src-test \ ns_modules="nsdbpg nsdbi nsdbipg nsudp nssmtpd nsloopctl" \ bash install-ns.sh
For standard setups, the default settings should be OK.
After running both scripts in the default configuration, you will see e.g.
Congratulations, you have installed OpenACS with NaviServer on your machine. You might start the server manually with sudo /usr/local/ns/bin/nsd -t /usr/local/ns/config-oacs-5-10-0.tcl -u nsadmin -g nsadmin
One can start the server manually with the mentioned command.
On Fedora/CentOS or on Ubuntu installations starting with 15.04, systemd is used. The generated startup file for RedHat/Fedora is in /lib/systemd/system/oacs-5-10-0.service. The startup commands for systemd are
sudo systemctl status oacs-5-10-0 sudo systemctl start oacs-5-10-0 sudo systemctl stop oacs-5-10-0
Remember, when a new systemd service is installed, systemd requires the following command to re-scan its service files:
sudo systemctl daemon-reload
To start OpenACS automatically on every new start of the machine, issue the following command:
sudo systemctl enable oacs-5-10-0
Alternatively, some older Ubuntu versions (up to 15.04) use upstart. For upstart, the the generated startup file is in /etc/init/oacs-5-9-1.conf. The service can be started/managed with the following commands
sudo initctl status oacs-5-10-0 sudo initctl start oacs-5-10-0 sudo initctl stop oacs-5-10-0
When the service is running, one can use OpenACS by browsing to http://localhost:8000/ (when the browser and server is running on the same host). The relevant files are stored under the following locations: