-
Notifications
You must be signed in to change notification settings - Fork 149
Install PostgreSQL 9.1.2
The PostgreSQL database will store the users, resource metadata, and harvesting schedule information for the geoportal. You will install PostgreSQL from its source code instead of installing it from your distribution's online repositories. This requires a little more effort in the installation but greatly simplifies the management of PostgreSQL as well as this tutorial.
Change to the /usr/local/etc
directory. Download the PostgreSQL source code to this directory by entering the following:
$ sudo wget ftp://ftp.postgresql.org/pub/source/v9.1.2/postgresql-9.1.2.tar.gz
.tar.gz
file format is how most files are packaged and compressed in Linux. It is basically the Linux version of the .zip
format. Extract the .tar.gz
file by entering the following:
$ sudo tar zxvf postgresql-9.1.2.tar.gz
.tar.gz
file will automatically be extracted to a new postgresql-9.1.2
directory within the /usr/local/etc
directory.
You will now install PostgreSQL from the source code. It is a three-step process. First, you'll prepare your computer and the source code. Next, you'll compile the source code into the full program. Finally, you'll install the compiled program. Don't worry; it's a lot easier than it sounds.
Note: This may seem unnecessarily complicated. Why not use just one command? This process allows advanced users of Linux to highly customize the installation of software to their system. It epitomizes the spirit of open source software, giving users control over the software they install on their computers instead of the other way around.
Change to the new postgresql-9.1.2
directory.
$ cd /usr/local/etc/postgresql-9.1.2
$ ./configure
$ make
$ sudo make install
sudo
command is required for the last step because this step is where you're making actual changes to the operation of the computer. The ./configure
script and make
command, while required for installing software from the source onto Linux, do not actually cause any changes to the operation of the computer.
For database security and integrity, you will create the postgres
user for the PostgreSQL application. It will act like the Linux root
user but only for the PostgreSQL database. Create the user like you created the geoportal
user, but do not make it a member of the wheel
or sudo
group.
In this step, you will create the directory where all the data stored in the PostgreSQL database will be stored. You will then make the postgres
user the owner of this directory.
Change to the newly created /usr/local/pgsql
directory. This is where PostgreSQL was installed.
$ cd /usr/local/pgsql
$ sudo mkdir /usr/local/pgsql/data
postgres
user.
$ sudo chown postgres:postgres /usr/local/pgsql/data
$ sudo reboot
Log back in to your computer, reopen the terminal, and switch to the postgres
user.
$ su postgres
$ pg_ctl initdb
$ pg_ctl start
This step will prevent you from having to start up the PostgreSQL database server manually every time you reboot the machine.
First, switch back to the geoportal user.
$ su geoportal
Arch Linux and Related |
---|
First, copy the PostgreSQL startup script to the /etc/rc.d directory.
root user.
rc.conf in vi for editing.
postgresql to the daemons list.
|
Debian, Ubuntu, and Related |
---|
First, copy the PostgreSQL startup script to the /etc/init.d directory.
root user.
postgresql script to the startup sequence.
|
Fedora, CentOS, and Related |
---|
First, copy the PostgreSQL startup script to the /etc/init.d directory.
root user.
chkconfig to add the script to the startup sequence.
|
After rebooting the system, reopen the terminal and switch to the postgres
user. Change to the /etc/local/
directory and enter the following:
$ pg_ctl status
Next Step: Install Apache Tomcat 6
<<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>>