TODO: currently just copied from 3.11 version. update for 3.12
For installation instructions for older versions of Greenstone, please see the Advanced Users Installation Index Page.
For most users, the main Greenstone download (also called the "binary") with default settings is sufficient, and is very easy to install. However, there are some instances where you may want or need to go through a more advanced installation process:
Installation Option | Currency of Code | Code type | Description |
---|---|---|---|
Binary (the main download) | Release-Specific | Binary | This is the official, pre-compiled version of the software. It is platform-specific, and what most Greenstone users use. |
Source component | Release-Specific | Source Top-Up | if you already have the binary installed, you can top it up with the source component which provides the code that you can compile. Note that the source component belongs with a particular binary. This means it is static code (code as it was when the associated binary was released), not the latest version of the source code. |
Source distribution | Release-Specific | Source | if you want to compile the code for a particular binary release without installing the binary first, you can get the source distribution. Once more, this is static code: the code as it was when the binary was released. This is useful if you want to compile up Greenstone for a particular OS that we don't provide the binaries for, or if you had any issues with the pre-compiled binaries for your OS. It's also handy for if you want to locally patch up or modify the source code of a particular release that otherwise works fine for you. |
Source via SVN | Up-to-date | Source | SVN hosts the latest version of the Greenstone code. This is handy to get if you want to compile up Greenstone yourself and ensure you have the latest code in doing so. |
Important Note: Before proceeding, you're to set all instructed environment variables in the same terminal, unless explicitly stated otherwise.
Prerequisites for compiling the source component and source distribution on Windows:
(TODO - test whether buildtools is enough)
* **Apache Ant:** Version?? * If you don't already have Ant installed, please run get-selfcontained-ant.bat in the ext-cli folder * **Perl:** From 3.12 you need to use a Greenstone provided Perl which comes with all the necessary cpan libraries installed. This is supplied in a binary release but not in the source distribution. * Please run get-selfcontained-perl-with-cpan.bat in the ext-cli folder. * (Alternatively you can download the perl tarball...) * * (If you want to compile GS3 with debugging on, you will need Microsoft SDK) * ?? add this to gs3-devel.bat?? ''call "C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\SetEnv.cmd"''
Note: the bundled tar.exe (for unzipping) doesn't work on Windows 11. If you are having issues with this, please delete gs2build/bin/windows/tar.exe.
cd C:\path\to\greenstone3
gs3-devel.bat
- this will set up all the necessary environment variables needed for compilingpackages\jre
to something else, so that when Greenstone runs after compiling, it uses your system Java rather than the old 32 bit JRE v7.ant distclean
from the toplevel Greenstone installation folder, to clear all the older compile products created by compiling with 32 bit Java 7.[exec] Could Not Find GS3\gs2build\common-src\src\gdbmedit\gdbmdel\*.obj [exec] Could Not Find GS3\gs2build\common-src\src\gdbmedit\gdbmdel\gdbmdel.exe [exec] cd "GS3\gs2build\common-src" [exec] cd src\gdbmedit\gdbmdel [exec] "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\bin\HostX64\x6 4\nmake.exe" /f win32.mak GSDLHOME="GS3\gs2build" clean [exec] del *.obj [exec] del gdbmdel.exe [exec] cd "GS3\gs2build\common-src" [exec] cd indexers [exec] set DEBUG=0 [exec] set VISUAL_STUDIO_MAJORVERSION= [exec] set ENABLE_MG=1 [exec] set ENABLE_MGPP=1 [exec] set ENABLE_LUCENE=1 [exec] call winMake.bat clean [exec] GS3\gs2build\common-src\indexers\bin\*, Are you sure (Y/N)? >>>> [exec] 14 was unexpected at this time. <<<<<<<<<<<<<<<<<<<< [exec] NMAKE : fatal error U1077: 'call' : return code '0xff' [exec] Stop. BUILD FAILED GS3\build.xml:4104: exec returned: 2
Edit your GS3\gs2build\common-src\indexers\winMake.bat script by commenting out the following line in it
::if %VISUAL_STUDIO_MAJORVERSION% LSS 14 set ICONVZIP=iconv-PRE-VS14.zip
If you see a failure message about being unable to delete a file called 'cp.jar', run the following from the greenstone3 folder: del cp.jar admin\cp.jar lib\java\cp.jar lib\jni\cp.jar web\lib\cp.jar
. Running ant clean-classpath-jars
will tell you if there are any cp.jar left that are unable to be deleted. manually from the command line for the exact file path listed. Then re-run ant distclean
. There are several cp.jar files in different locations of the GS3 installation, any or all of which can cause this failure message. So keep repeating the cycle of re-running ant distclean
then manually running del
on any cp.jar file listed in any failure message, until the ant distclean
step finally succeeds (so without failure messages). This issue may be due to Windows having filelocks on the cp.jar
files.
ant install
.gs2build/bin/windows
. Rename the unzipped folder to strawberry-perl
, and make sure it doesn't contain a subfolder starting strawberry-perl
(if it does, the strawberry-perl subfolder should be the one directly under gs2build/bin/windows
).To run GS3 after re-compiling:
To run GLI after recompiling your binary on a 64 bit Windows machine, you need the same version of JDK or JRE (and for the same bit architecture, 32 or 64 bit) as that you used to compile up Greenstone 3. You will need this Java's bin
subfolder on your PATH. You'll also need the bin
subfolder of ANT on the PATH.
Note if you want to use the bundled JRE for Windows 64 bit:
To run GLI after recompiling your binary on a 64 bit Windows machine, you need JDK 8 or JRE 8 (for pre-GS3.11 you'd need JDK 7 else JRE 7) for 64 bit set up in your environment, since the JRE included with the Greenstone Windows binary is for 32 bit, as the Greenstone Windows binary itself is 32 bit. Otherwise, the problem seen when running the 64-bit recompiled GS3 server with the 32-bit JRE included in GS3 binaries is a tomcat error explaining the discrepancy between the two architectures.
Therefore, to run GLI after compiling GS3 for 64 bit, add the bin folder of JRE for 64 bit to the PATH, or set JAVA_HOME to JDK 64 bit and add its bin folder to the PATH. Then run GLI in this environment.
setupenv.bat
. (For 64-bit Windows, make sure the script sets JAVA_HOME to a 64-bit JDK7, and adds its bin
folder to the PATH, and that the script then calls vsvarsall.bat amd64
of your Visual Studio. VS Version 9 has been tested to work.)cd C:\path\to\Greenstone3\
, and run gs3-setup.bat
.GS3\gs2build\common-src\indexers\winMake.bat
script by commenting out the following line in it by prefixing 2 colon signs (::
) to the lineif %VISUAL_STUDIO_MAJORVERSION% LSS 14 set ICONVZIP=iconv-PRE-VS14.zip
So it looks as follows, then save the script file:
::if %VISUAL_STUDIO_MAJORVERSION% LSS 14 set ICONVZIP=iconv-PRE-VS14.zip
ant install
.gs2build\bin\windows
subfolder, so that you end up with an imagemagick
folder in there. Make sure it hasn't created an extra level of an imagemagick
subfolder on extraction, like gs2build\bin\windows\imagemagick\imagemagick
. (The dll files should be at the gs2build\bin\windows\imagemagick
level.)Notes for Windows 64 bit:
To run GLI or the gs3-server after compiling the source code on a 64 bit Windows machine, you need your environment to be set up with JDK 8 or JRE 8 (or JDK 7+ else JRE 7+ for Greenstone versions prior to GS3.11) for 64-bit and Ant: set the JAVA_HOME environment variable to your 64 bit JDK and add the JDK's bin
folder to the PATH. Also set the ANT_HOME environment variable and add its bin
folder to the PATH. Then run GLI or gs2-server in this environment using the gli.bat and gs2-server.bat scripts.
Prerequisites for compiling on Windows:
In addition to the Prerequisites for compiling Greenstone on Windows listed above, to install Greenstone from SVN source on Windows, you need to install svn.
(NOTE: Some of the prerequisite packages are available from greenstone's svn and are put into a subfolder called local
. For instructions on compiling up from source using the local
folder, refer to the Windows source installation page
Otherwise, proceed with the following.)
SVN, ANT, and JAVA must be put on PATH and Visual Studio must be set up for compiling the C/C++ code,
which can be accomplished using the file vcvars<number>.bat
, or vcvarsall.bat
passing in amd64
for 64 bit windows.
Run the following:
svn co https://svn.greenstone.org/main/trunk/greenstone3 gs3-svn cd gs3-svn ant ant prepare ant install
For more detailed instructions on source installation, please refer to the Windows source installation page.
In order to install Greenstone from source on Linux, you need to have the following installed:
bin
folder to the PATH. If you're on a 64 bit machine, you'll need a JDK for 64 bit machines, if you're on a 32 bit machine, you will need a JDK for 32 bit machines. Set ANT_HOME and add its bin
folder to the PATH. If you don't already have ant installed, the Greenstone 3 binary comes with one in its packages/ant
folder. Set that to ANT_HOME, and add its bin
subfolder to the PATH.export JAVA_HOME=/path/to/your/jdk7 export ANT_HOME=/path/to/GS3/packages/ant export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH
If you're on a Mac OS version anywhere from 10.11/El Capitan until Mojava (and possibly Catalina), set CFLAGS, CXXFLAGS and JNIFLAGS as follows:
export CFLAGS="$CFLAGS -I$JAVA_HOME/include -I$JAVA_HOME/include/darwin" export CXXFLAGS="$CXXFLAGS $CFLAGS" export JNICFLAGS="$JNICFLAGS $CFLAGS"
Since GS3.08 and until GS3.10, if you're on 64 bit linux, you will also need to add -fPIC to the CFLAGS and CXXFLAGS environment variables:
export CFLAGS="-fPIC $CFLAGS" export CXXFLAGS="-fPIC $CXXFLAGS"
If at any point you run source ./gs3-setup.sh
before compiling, you will have to set up the Java JDK environment again, because the gs3-setup
script will make the included JRE the default Java.
packages\jre
folder to something else, so that when Greenstone runs after compiling, it uses your system Java rather than the old 32 bit JRE v7.ant distclean
from the toplevel Greenstone installation folder, to clear all the older compile products that were compiled with Java 7.gli/jar
and gli/classes/org
, if they exist, to clear up GLI before recompiling.wvware
, then it means you need the gnome-lib extension. gs2build/ext/gnome-lib-minimal
folder. gnome-lib-minimal
version for your operating system and architecture, then clicking on the download link on the subsequent page. Download it into your Greenstone 3's gs2build/ext
folder.cd gs2build/ext tar -xvzf gnome-lib-minimal-<your-OS-version>.tar.gz cd gnome-lib-minimal source ./devel.bash cd ../../..
ant install
from the toplevel folder of the Greenstone 3 installation to start compiling. It can take several minutes. ant install
:> env | grep INSTALL PERL_MM_OPT=INSTALL_BASE=/something.../ > export INSTALL_BASE= > export PERL_MM_OPT= > ant install
Note:
The gnome-lib environment may conflict with graphical applications on Linux systems. After compiling, open a fresh terminal to run GLI or other graphical applications. But make sure the new terminal has the environment set up for Java and Ant too before running any Greenstone applications like the Greenstone Server (gs3-server) and GLI.
In the terminal:
where java
. Doing so should display a system location. Then run ls -la <java-location>
using that location value. If the result of this ls
operation shows that the location is a symlink, run ls -la <symlink>
on the symlink, until all symlinks are exhausted and you get to an actual location on the file system. Having found the actual location of java, you don't want the bin
directory, but its containing folder. Set this as JAVA_HOME. Locate and set ANT_HOME in similar manner.It may be easiest to create a bash script to set the above environment variables. Then you could run that script before compiling and, in a separate terminal, before running Greenstone applications.
export ANT_HOME=/path-to-your/ant export JAVA_HOME=/path-to-your/java export PATH=/path-to-your/svn/bin:$JAVA_HOME/bin:$ANT_HOME/bin:$PATH
gs2build/bin/<OS>
subfolder, where OS can be either windows/linux/darwin (for mac). There, svn export the perl-with-cpan tarball for your OS, by running the appropriate command for your OS from the followingsvn export https://svn.greenstone.org/gs2-extensions/perl-with-cpan/trunk/perl-5.32.1-x86_64-linux-thread-multi.tar.gz .
svn export https://svn.greenstone.org/gs2-extensions/perl-with-cpan/trunk/perl-5.32.1-i686-linux-gnu-thread-multi.tar.gz .
svn export https://svn.greenstone.org/gs2-extensions/perl-with-cpan/trunk/perl-5.32.1-darwin-thread-multi-2level.tar.gz .
svn export https://svn.greenstone.org/gs2-extensions/perl-with-cpan/trunk/strawberry-perl-5.32.1.1-MSWin32-x86-multi-thread.zip .
mv perl-5.32.1 strawberry-perl
mv perl-5.32.1 perl
bin
folder is added to the PATH. If you're on a 64 bit machine you need a JDK for 64 bit machines, if you're on a 32 bit machine, you will need a JDK for 32 bit machines. Also set ANT_HOME to an ant installation and add its bin
folder to the PATH.wvware
, then it means you need the gnome-lib extension. You can grab it by visiting http://trac.greenstone.org/browser/gs2-extensions/gnome-lib/trunk, selecting the link to the gnome-lib-minimal
version for your operating system and architecture, then clicking on the download link on the subsequent page. Download it into your extracted Greenstone 3's gs2build/ext
folder.cd gs2build/ext cd gnome-lib # gnome-lib can take longer to compile. # Alternatively, if you had internet access and had grabbed the gnome-lib-minimal tarball # as per instructions above, then run the following commands: #mv gnome-lib gnome-lib.orig #tar -xvzf gnome-lib-minimal-<your-OS-version>.tar.gz #cd gnome-lib-minimal source ./devel.bash cd ../../..
export CFLAGS="$CFLAGS -I$JAVA_HOME/include -I$JAVA_HOME/include/darwin" export CXXFLAGS="$CXXFLAGS $CFLAGS" export JNICFLAGS="$JNICFLAGS $CFLAGS"
Since GS3.08 and upto and including GS3.10, if you're on 64 bit linux, you will also need to add -fPIC to the CFLAGS and CXXFLAGS environment variables:
export CFLAGS="-fPIC $CFLAGS" export CXXFLAGS="-fPIC $CXXFLAGS"
ant install
from the toplevel folder of your extracted Greenstone 3 installation to start compilation. It can take several minutes. ant install
:> env | grep INSTALL PERL_MM_OPT=INSTALL_BASE=/something.../ > export INSTALL_BASE= > export PERL_MM_OPT= > ant install
darwin
subfolder to imagemagick
and move this subfolder into your GS3's gs2build/bin/darwin
folder. Launching GLI now should find this imagemagick and use it to generate thumbnails and screenview images.Note:
The gnome-lib environment may conflict with graphical applications on Linux systems. After compiling, open a fresh terminal to run GLI or other graphical applications. Make sure the new terminal has the environment set up for Java (version 8 from GS3.11 and onwards) and Ant too before running any Greenstone applications like the Greenstone Server (gs3-server) and GLI.
bin
folder to the PATH. If you're on a 64 bit machine, you'll need a JDK for 64 bit machines, if you're on a 32 bit machine, you will need a JDK for 32 bit machines. Set ANT_HOME and add its bin
folder to the PATH.export JAVA_HOME=/path/to/your/jdk7 export ANT_HOME=/path/to/your/ant export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH
NOTE: Some of the prerequisite packages are available from greenstone's svn and are put into a subfolder called local
. For instructions on compiling up from source using the local
folder, refer to the Unix source installation page. Otherwise, proceed with the following.
svn co https://svn.greenstone.org/main/trunk/greenstone3 cd greenstone3
build.properties
with: ant
Now, if necessary, you can customise the port/hostname fields in the newly generated toplevel file build.properties
.
gnome-lib
to speed up the process, in which case you'll carry out step 8 later, comment out the following line (by prefixing a # symbol to the line) in build.properties
to de-activate it: checkout.gnomelib.ext=true
build.properties
to activate it checkout.imagemagick.ext=true
imagemagick is not successfully compiling at present on MacOS High Sierra (10.13.4) onward (nor 32 bit linux at the moment). So use the pre-compiled imagemagick binary* for Mac instead.
ant prepare
gnome-lib
in step 5. In that case, visit https://trac.greenstone.org/browser/gs2-extensions/gnome-lib/trunk and there click on the link for the gnome-lib-minimal-
zip/tarball for your operating system. On the next page, click on the download link to download the zip/tarball file, then move this downloaded file into gs2build/ext
. After that, unpack and set up your gnome-lib-minimal for compiling as follows: cd gs2build/ext tar -xvzf gnome-lib-minimal-<your-OS-version>.tar.gz cd gnome-lib-minimal source ./devel.bash cd ../../..
ant install
* If you want imagemagick and ghostscript on a mac, check out the precompiled binaries from svn after the ant prepare
step
cd gs2build svn co https://svn.greenstone.org/main/trunk/binaries/mac/intel/ghostscript bin/darwin/ghostscript svn export https://svn.greenstone.org/gs2-extensions/imagemagick/trunk/imagemagick-darwin-10.11.tar.gz tar -xvzf imagemagick-darwin-10.11.tar.gz mv imagemagick/darwin bin/darwin/imagemagick rm -rf imagemagick-darwin-10.11.tar.gz rm -rf imagemagick
For more detailed instructions on installation, please refer to the Linux GS3, Linux GS2 and Mac OS source installation pages.
> ./Greenstone-3.06rc1-linux-x64 -textonly
NOTE: Previously, the instructions for running the installer in text-only mode were incorrect. They advised running the installer wrongly using ./Greenstone-3.06rc1-linux-x64 text-only
, which rather triggered the default behaviour of the installer software (antinstaller) for a different kind of text-only installation rather than triggering the Greenstone installer's specific -textonly mode. Unfortunately, the wrong route would not install the bundled JRE into the Greenstone installation, despite requiring the Greenstone user to run the java
command in the very next step of the install.
To support use of Greenstone 3 in a networked lab environment, it is possible to adjust the configuration settings of the installation to have one shared installation of the software, but allow individual users to build and serve collections from their own area of the file system. We refer to this as a "dispersed GS3" setup. More specifically, it is appropriate for a situation where your Greenstone 3 is to be distributed across 3 locations of your Windows machine: an installation location which is read-only regular users, and to which only the administrator has write permissions; a user-web location that is writable and specific to a user; and a temporary (typically local) file system area the user has read/write permissions to.
In the following text we describe the setup procedure for Windows, with Greenstone installed in C:/Program Files/. The same capability will work in networked situations for MacOS and Linux labs, choosing an appropriate directory such as /usr/local/Greenstone3 as the location to install the GS3 software to.
For one computer, here's how you can have Greenstone installed centrally (e.g. Program Files), but then have each different user when working at that computer have their own instance of the Greenstone 3 sites, collections, and customisations of the interface.
Install GS3 as an administrator using the binary installer. Then set the following 4 properties in build.properties:
using.user.web=true
web.home=${user.home}/greenstone3/web
gsdl3home.isreadonly=true
gsdl3.writablehome=${java.io.tmpdir}/greenstone/web
Set all the property values exactly as above, except web.home
, which you should customise to point to a location that is writable by the GS3 user where the user can create collections. File path separators should be URL style slashes, so forward slash, /.
Now if you replicate the installation to other machines in the lab, your users can log into any machine and continue working with Greenstone3.