Skip to content

Set Up Systemwide Environment Variables

Marten Hogeweg edited this page Dec 14, 2012 · 1 revision

Environment variables tell the computer where to find commands either entered by you in the console or requested by an application. The variables that you're about to set will be used by Java, Apache Tomcat, and PostgreSQL to talk to each other and by you to set up an manage the PostgreSQL database.

First, because different versions of Linux install Java differently, you need to identify how your system identifies the Java 6 JDK.

List Contents of /usr/lib/jvm Directory

Change to the jvm directory by entering the following:

$ cd /usr/lib/jvm
List the contents of the directory by entering the following:
$ ls -l
If the ls -l command returns more items than can be listed on the console screen, enter the following to be able to scroll through the results with the arrow keys.
$ ls -l | less
You can exit this mode by pressing the Q key.

Identify the Java 6 JDK Result

The Java 6 JDK will be listed as jre-openjdk, java-6-openjdk, or something similar.

Write down the result for future reference.

Set the Environment Variables

Now you will edit the /etc/bashrc or the /etc/bash.bashrc file. They are basically the same files; the naming convention just changes based on the distribution of Linux that you're using.

Change to the /etc directory and list its contents. Identify which of the two files you're going to edit. There should only be one of these files. If you have both, edit the /etc/bash file; if you have neither one, edit the /etc/profile file.

Open the file for editing in vi.

$ sudo vi /etc/<file name>
Note: Be very careful when editing this file! Do not delete or tamper with any of the information contained wthin.

Add the below lines to the end of the file:

export JAVA_HOME=/usr/lib/jvm/<results identified above>
export JRE_HOME=/usr/lib/jvm/<results identified above>
export LD_LIBRARY_PATH=/usr/local/pgsql/lib
export PGDATA=/usr/local/pgsql/data
export PATH=$PATH:/usr/local/pgsql/bin
export CATALINA_HOME=/usr/local/tomcat6
export CATALINA_BASE=/usr/local/tomcat6

Save changes and exit vi.


Next Step: Install PostgreSQL 9.1.2


<<How to Set Up an Esri Geoportal Server on Linux | Perform Preinstallation Computer Setup | Set Up Systemwide Environment Variables | Install PostgreSQL 9.1.2 | Install Apache Tomcat 6 | Install Esri Geoportal Server | Configure geoportal User and Schema in the PostgreSQL Database | Deploy the Geoportal Web Application | Configure the gpt.xml File | Install the JDBC .jar Files | Log In to the Geoportal | Register ArcGIS for Server with the Geoportal>>
Clone this wiki locally