en:developer:linux_source_install
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:developer:linux_source_install [2016/11/17 22:43] – anupama | en:developer:linux_source_install [2023/03/19 21:05] (current) – splitting linux_source_install into gs2 and gs3 versions. No checking of content kjdon | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Source Installation on Linux ====== | ||
- | |||
- | <TABAREA tabs=" | ||
- | <TAB> | ||
- | ===== Greenstone3 ===== | ||
- | This walkthrough is for **Linux**. But it may have the side-effect of helping Windows users too. | ||
- | |||
- | =====Useful links and further information===== | ||
- | * [[en: | ||
- | * [[en: | ||
- | * [[en: | ||
- | * [[http:// | ||
- | |||
- | |||
- | ===== Preliminaries: | ||
- | |||
- | * **The correct folder for installing programs on Linux** | ||
- | |||
- | |||
- | The first step for University of Waikato students installing Greenstone 3 from source: | ||
- | |||
- | |||
- | You need to install it on the research partition, ELSE IT DOESN' | ||
- | < | ||
- | |||
- | |||
- | * **Download apr, apr-util, and subversion** as specified on the following page. Also check that the version of neon is as given on the page [[en: | ||
- | |||
- | * **Install apr and apr-util** as outlined at [[en: | ||
- | |||
- | |||
- | For students or developers at the University of Waikato: make sure these are installed in the RESEARCH partition, else it doesn' | ||
- | (**sources** is just a folder where I put the unzipped source code for Greenstone 3 related programs). | ||
- | For everyone else, replace this with your FULL PATH to where the apr, apr-util and subversion will be installed. | ||
- | |||
- | |||
- | * **Installing Subversion (SVN)** | ||
- | |||
- | |||
- | To install the versioning control system " | ||
- | < | ||
- | $ cd / | ||
- | $ tar -xzf / | ||
- | $ cd subversion-1.4.4 | ||
- | </ | ||
- | The following is separated into multi-lines, | ||
- | < | ||
- | $ ./ | ||
- | --without-apxs | ||
- | --with-apr=/ | ||
- | --with-apr-util=/ | ||
- | --with-neon=/ | ||
- | </ | ||
- | Then run the following two commands in the x-term: | ||
- | < | ||
- | make install</ | ||
- | Now it's created a folder called ' | ||
- | |||
- | |||
- | Next, add the path to the bin directory to the paths already exported: | ||
- | < | ||
- | For more details, see [[en: | ||
- | |||
- | |||
- | * **Apache Ant** | ||
- | |||
- | |||
- | The latest version of Greenstone 3 checked out from SVN requires Ant 1.7.1. Therefore, get and install [[http:// | ||
- | |||
- | * Create the ANT_HOME environment variable, and set its value to be the full path to the root directory of your ant installation. | ||
- | |||
- | * Then adjust the existing PATH variable to include the bin directory of ANT_HOME. | ||
- | |||
- | |||
- | |||
- | |||
- | E.g. if, after unzipping the ant binary (which you can download from the [[http:// | ||
- | < | ||
- | export PATH=$ANT_HOME/ | ||
- | |||
- | ===== Checking out and installing Greenstone 3 and GLI ===== | ||
- | |||
- | * **Checking out Greenstone 3 source code from subversion (SVN)** | ||
- | |||
- | |||
- | This is a slight variation on what's given in [[en: | ||
- | |||
- | |||
- | Go to / | ||
- | |||
- | |||
- | Type: | ||
- | < | ||
- | $ svn co http:// | ||
- | </ | ||
- | [co stands for checkout, which will checkout code from SVN] | ||
- | |||
- | Whenever you need to update with the latest source code from the SVN repository, cd to the $GSDL3HOME directory (your Greenstone installation directory, for example / | ||
- | < | ||
- | |||
- | |||
- | * **Checking out, compiling and running the Greenstone Librarian Interface (GLI) for Greenstone 3** | ||
- | |||
- | |||
- | Go to $GSDL3HOME, your greenstone3 home folder: | ||
- | < | ||
- | $ cd greenstone3 | ||
- | $ svn co http:// | ||
- | </ | ||
- | Then go to gli folder: | ||
- | < | ||
- | $ cd gli | ||
- | $ svn update | ||
- | </ | ||
- | < | ||
- | $ ./ | ||
- | $ ./ | ||
- | </ | ||
- | |||
- | To run GLI for Greenstone 3: | ||
- | < | ||
- | |||
- | |||
- | * **Editing your .profile: JAVA_HOME and the PATH variable** | ||
- | |||
- | |||
- | Update your .profile file, containing your settings, to export JAVA_HOME and update the PATH to point to your Java installation. Go to / | ||
- | < | ||
- | Find out where your Java installation is: | ||
- | < | ||
- | Export the JAVA_HOME variable such that it points to the installation of the JDK you are using. And //append// to the PATH the location of the JDK's bin directory and the compiler, javac. To do so, in the .profile file, export (or try setting and then exporting) the JAVA_HOME variable, and append the location of your JDK to the PATH variable. | ||
- | |||
- | For example, if you're working with Greenstone 3 at the University of Waikato, your .profile file should now additionally have the following: | ||
- | < | ||
- | # | ||
- | |||
- | PATH=/ | ||
- | export JAVA_HOME=/ | ||
- | </ | ||
- | **It is important that it is the direct path--and not an symbolic link or shortcut--to the Java installation.** | ||
- | |||
- | |||
- | Save the file. Note that if you are using Java 5 (JDK 1.5) or higher, see [[#Using Java 5 (JDK 1.5) or higher with Greenstone 3]]. | ||
- | |||
- | |||
- | Now source it to make the changes active (alternatively, | ||
- | < | ||
- | $ source ~/.profile | ||
- | </ | ||
- | |||
- | |||
- | * **Compiling Greenstone 3's source code and installing it** | ||
- | |||
- | |||
- | //NOTES:// | ||
- | * Before moving on, you should make sure that your SVN client' | ||
- | |||
- | * You also need to make sure that if you are behind a proxy, you set the proxy in the build.properties file in your Greenstone installation folder. At the start, there will be no such file. To generate it, you need to type the following in your terminal (from the Greenstone installation folder): | ||
- | < | ||
- | Now open the build.properties file and adjust the proxy settings (proxy host, port, username and password). You may want to take the opportunity to change the tomcat server details for your Greenstone server as well (host, port, shutdown port). | ||
- | |||
- | Now you are ready to compile up Greenstone: | ||
- | |||
- | As advised by Quan, qq6 (another explanation is given at [[en: | ||
- | |||
- | |||
- | Go to $GSDLHOME, Greenstone3 home directory (which in the example above is / | ||
- | < | ||
- | Press ' | ||
- | < | ||
- | |||
- | Page [[http:// | ||
- | |||
- | **Notes** | ||
- | |||
- | * Read the README for installation notes. | ||
- | * Installing from SVN: | ||
- | * You will need to have Apache Ant and a Subversion client installed to compile and install Greenstone3. Please read the README.txt file in the greenstone3 directory for more information. | ||
- | * Run: | ||
- | < | ||
- | cd greenstone3 | ||
- | (edit build.properties as appropriate) | ||
- | ant prepare install | ||
- | </ | ||
- | |||
- | * Debian Sarge system: You need to have libgdbm-dev installed, and create a symlink from libgdbm-compat.so.3 → libgdbm.so.2. | ||
- | |||
- | |||
- | * **Setting up the Greenstone3 environment** | ||
- | < | ||
- | |||
- | |||
- | ===== Advanced ===== | ||
- | ==== Changing the port number where tomcat is installed ==== | ||
- | During Greenstone 3's installation process, it asks whether you accept the default port 8080. If you don't (or decide afterwards to make your web server work on a different port), then you can do this as follows. | ||
- | |||
- | * Change the port-number in the build.properties file: | ||
- | |||
- | |||
- | e.g. set tomcat port number to 8081 and its stop port to 8006. | ||
- | Or you can set tomcat port number to 9090 and its stop port to 9005. | ||
- | |||
- | * After that, in an x-term type: | ||
- | < | ||
- | $ ant -projecthelp | ||
- | </ | ||
- | This will tell you that when you change the port number, you need to run ant configure. So: | ||
- | < | ||
- | $ ant configure | ||
- | </ | ||
- | |||
- | |||
- | **Sometimes this step does not change the port after all!** In such a case, the actual place to change it would be the following file. First **stop tomcat** (as explained somewhere above). Open the Greenstone 3 server.xml file: | ||
- | < | ||
- | And make the necessary changes. For example: | ||
- | * Change tomcat startup port num from 8080 to 9090, and | ||
- | * Change the shutdown port num from 8005 to 9005 | ||
- | Then **restart tomcat**. | ||
- | |||
- | === Deploying localsite === | ||
- | Make sure tomcat has **stopped**. | ||
- | |||
- | |||
- | In your greenstone3 home folder, $GSDLHOME: | ||
- | < | ||
- | Then, deploy (as written in the [[http:// | ||
- | < | ||
- | Check that it works, by **starting** tomcat again and going to: | ||
- | < | ||
- | Make sure that the page appears. You can also look at the wsdl file for the gs3 web service that's been exposed: | ||
- | < | ||
- | You can also deploy other sites, see the [[http:// | ||
- | |||
- | |||
- | |||
- | ==== Getting Greenstone Perl scripts working from the command line==== | ||
- | You would want to do this if you ever choose to execute Greenstone' | ||
- | |||
- | |||
- | Go to the gs2build folder of your Greenstone 3 home folder and source setup.bash: | ||
- | < | ||
- | $ source setup.bash | ||
- | </ | ||
- | This will set up the capabilities for export.pl and import.pl (it will have set the necessary environment variables for these two perl programs to work). | ||
- | |||
- | |||
- | ==== Using Java 5 (JDK 1.5) or higher with Greenstone 3 ==== | ||
- | |||
- | The following steps apply if | ||
- | * your Greenstone 3 installation is compiled with Java 5; | ||
- | * you are using Java 5 to write a Java program which uses (calls) Greenstone 3's code; | ||
- | * in your browser, the servlet throws some root exception about ' | ||
- | |||
- | In order for GS3 to work with Java 5 (Java 1.5) | ||
- | # go to $GSDLHOME/ | ||
- | # rename the file xalan.jar.tmp to xalan.jar | ||
- | # don't need to recompile after renaming xalan.jar.tmp to xalan.jar, but just do an | ||
- | < | ||
- | (or: an $ ant stop followed by $ant start) | ||
- | |||
- | |||
- | Of course, your .profile file should have JAVA_HOME pointing to JDK1.5, while its bin folder and javac should be on your PATH too, as explained earlier in this document. | ||
- | |||
- | If your Greenstone 3 source code was compiled with Java 5 and you didn't make these small changes, then running the Greenstone //test servlet// will still work, but running any of the //standard library servlet//, the //classic servlet// or the //gateway servlet// won't work. In those last three cases, it will throw an exception where the Root exception will mention something to do with xalan. | ||
- | |||
- | |||
- | ==Troubleshooting== | ||
- | ====Greenstone 3 installation problems==== | ||
- | If you're on Linux and in the BUILD FAILED message, you see it mention an error related to GDBM, then go to your greenstone 3 installation folder' | ||
- | |||
- | * ./configure | ||
- | * make | ||
- | |||
- | * make install | ||
- | |||
- | |||
- | Now try installing Greenstone 3 again. | ||
- | |||
- | |||
- | You could also try to modify your .profile file as described in step 3 of [[#Checking out and installing Greenstone 3 and GLI]]: //Editing your .profile: JAVA_HOME and the PATH variable//. (Make sure it has the actual path to the JDK instead of giving it the path to a shortcut/ | ||
- | |||
- | |||
- | If BUILD FAILED errors still occur during Greenstone3 installation with ant, then you could try checking out greenstone3 from SVN again and compiling it once more. This solution has often worked for me. | ||
- | |||
- | * Make sure tomcat is not running (from the $GSDLHOME folder): | ||
- | < | ||
- | This will throw an exception if tomcat wasn't running, but that's ok. You may also want to make sure *all* Greenstone3 tomcat instances--in case multiple instances had been launched--are stopped as explained in the section [[#Problems using ant start to run Tomcat]]. | ||
- | |||
- | * Delete the existing greenstone3 folder, by going to one directory higher than $GSDLHOME and typing: | ||
- | < | ||
- | |||
- | * And then check out greenstone3 again from the SVN code repository: | ||
- | < | ||
- | |||
- | * Go into folder greenstone3 ($GSDLHOME) and compile it: | ||
- | < | ||
- | $ ant prepare (press ' | ||
- | $ ant install | ||
- | </ | ||
- | |||
- | * Once it has all been installed successfully, | ||
- | < | ||
- | |||
- | * Check everything works by pointing your browser to: | ||
- | < | ||
- | |||
- | |||
- | |||
- | ====Problems using ant start to run Tomcat==== | ||
- | If executing **$ant start** doesn' | ||
- | |||
- | **Solution: | ||
- | |||
- | |||
- | **How:** | ||
- | |||
- | * In an xterm, go into the $GSDLHOME folder and find all the running instances of Tomcat by typing: | ||
- | < | ||
- | This gives you stats on how many instances of tomcat are running. | ||
- | |||
- | |||
- | For example, you may see something like | ||
- | < | ||
- | < | ||
- | < | ||
- | </ | ||
- | |||
- | * We want to terminate the process-id(s) marked with " | ||
- | < | ||
- | |||
- | * Again, do: | ||
- | < | ||
- | to check that there are no more running instances of tomcat (" | ||
- | |||
- | * If there are no previous instances of tomcat to kill anymore, then try an ant start now: | ||
- | < | ||
- | Hopefully it will work and come back with BUILD SUCCESSFUL. | ||
- | |||
- | |||
- | |||
- | |||
- | ====Servlet throws root exception about ' | ||
- | See [[#Using Java 5 (JDK 1.5) or higher with Greenstone 3]] | ||
- | |||
- | |||
- | </ | ||
- | < | ||
- | ############################################################################# | ||
- | ############################################################################# | ||
- | ############################################################################# | ||
- | <TAB> | ||
- | ===== Greenstone2 ===== | ||
- | NB: These instructions will apply from 7th June 2007 | ||
- | |||
- | * [[http:// | ||
- | |||
- | |||
- | ===== Getting Greenstone2 running under linux, using SVN and Apache ===== | ||
- | |||
- | My sample user is '' | ||
- | |||
- | ==== 1. Get Greenstone from SVN ==== | ||
- | We generally advise people to install greenstone on the research partition of your computer - some people have had problems installing in their home directory. But you can try in your home directory if you like. Assuming you will use the research partition: | ||
- | |||
- | < | ||
- | mkdir / | ||
- | cd / | ||
- | svn co http:// | ||
- | </ | ||
- | |||
- | Change to the '' | ||
- | < | ||
- | cd gsdl | ||
- | svn co http:// | ||
- | </ | ||
- | |||
- | Still in the '' | ||
- | < | ||
- | ./configure | ||
- | make | ||
- | make install | ||
- | </ | ||
- | |||
- | Now greenstone is installed in ''/ | ||
- | |||
- | ==== 2. If you want to use the GLI ==== | ||
- | In the '' | ||
- | < | ||
- | svn co http:// | ||
- | cd gli | ||
- | ./ | ||
- | </ | ||
- | |||
- | To start the GLI, in the '' | ||
- | < | ||
- | ./gli.sh | ||
- | </ | ||
- | |||
- | ==== 3. Install Apache ==== | ||
- | You will need to install Apache to be able to run the cgi executable. | ||
- | |||
- | Download a recent Apache2 binary from [[http:// | ||
- | (Apache1.3 will also work, but Apache2 is much better.) | ||
- | |||
- | Unpack the tar file: | ||
- | < | ||
- | cd / | ||
- | tar -xzf apache_2.x.x.tar.gz | ||
- | </ | ||
- | |||
- | Compile the source: | ||
- | < | ||
- | cd apache_2.x.x | ||
- | ./configure --prefix=/ | ||
- | make | ||
- | make install | ||
- | </ | ||
- | Now apache is installed in ''/ | ||
- | |||
- | To start and stop apache, type | ||
- | < | ||
- | / | ||
- | / | ||
- | </ | ||
- | To change the port that apache runs on, edit the ''/ | ||
- | change the Port or Listen directive to the correct port - '' | ||
- | After restarting apache you will then be able to access your apache installation at | ||
- | [[http:// | ||
- | |||
- | ==== 4. Tell apache about greenstone ==== | ||
- | The basic method for making a greenstone installation available through a web server is to | ||
- | * Make the contents of the gsdl home folder visible on the web by placing them (or a symbolic link to them) somewhere within the htdocs folder of your apache installation. | ||
- | * Make some or all of the contents of the gsdl/ | ||
- | * Create/edit the '' | ||
- | |||
- | This is the way I used: | ||
- | < | ||
- | cd / | ||
- | ln -s / | ||
- | ln -s / | ||
- | cp / | ||
- | cd / | ||
- | ln -s / | ||
- | </ | ||
- | |||
- | You may need to edit the '' | ||
- | Make sure the following are uncommented and set like this: | ||
- | < | ||
- | gsdlhome / | ||
- | httpprefix /gsdl | ||
- | httpimg / | ||
- | </ | ||
- | Now you need to edit apaches config file ''/ | ||
- | |||
- | In the ''< | ||
- | FollowSymlinks' | ||
- | |||
- | After editing the '' | ||
- | to take effect. | ||
- | |||
- | You should now be able to access your greenstone installation at | ||
- | ''< | ||
- | |||
- | ===== Updating your installation ===== | ||
- | // | ||
- | |||
- | |||
- | There is nothing particularly difficult about an upgrade on Linux, except that you may need to keep a close eye on several of the factors indicated below. | ||
- | |||
- | 1. Initially, 2.73 had been installed at usr/ | ||
- | |||
- | 2. The installation process asks questions throughout. Most of them have obvious answers. It's a good idea to have checked one's Apache setup earlier in order to have the right responses to questions relevant to that. Clearly, one obvious change given the creation of the usr/ | ||
- | relevant changes. I'll just note that I let the installation use the cgi-bin folder in the new gsdl installation rather than the Apache one. It's one of the questions you are asked. I had a systems administrator nearby, so any dealings with Apache had his advice behind it! | ||
- | |||
- | 3. There was sufficient space on the disk to actually copy all collections (a whopping 30Gbs worth) across to the new ' | ||
- | |||
- | 4. The really important part of the upgrade however is to ensure that you move across all other relevant files. | ||
- | their appropriate folders. | ||
- | |||
- | |||
- | |||
- | To update your gsdl installation, | ||
- | directory and then recompile the source code. For example, to update the main gsdl | ||
- | installation, | ||
- | < | ||
- | cd / | ||
- | svn update | ||
- | make clean | ||
- | ./configure | ||
- | make | ||
- | make install | ||
- | </ | ||
- | |||
- | ===== Less Complex Explanation ===== | ||
- | Compile up gnome-lib yourself and compile up GS: | ||
- | |||
- | 1. svn co http:// | ||
- | |||
- | 2. cd greenstone2 | ||
- | svn co http:// | ||
- | cd / | ||
- | |||
- | 3. ./ | ||
- | This will check out the gnome-lib src code and then | ||
- | |||
- | --- | ||
- | Get a gnome-lib binary for your OS and compile up GS: | ||
- | |||
- | 1. svn co http:// | ||
- | |||
- | 2. cd greenstone2 | ||
- | svn co http:// | ||
- | cd / | ||
- | |||
- | 3. check out gnome-lib minimal for your OS from | ||
- | http:// | ||
- | into your greenstone2-home/ | ||
- | |||
- | 4. cd ext/ | ||
- | | ||
- | | ||
- | cd / | ||
- | |||
- | 5. ./configure --enable-apache-httpd | ||
- | |||
- | 6. make | ||
- | |||
- | 5. make install | ||
- | </ | ||
- | </ |
en/developer/linux_source_install.1479422629.txt.gz · Last modified: 2016/11/17 22:43 by anupama