Friday, January 19, 2007

Log Instalasi Postgis

Posting ini merupakan bagian ke 4. Untuk lebih jelasnya lihat 3 posting sebelum ini.
Instalasi Postgis membutuhkan beberapa paket source yaitu :
> proj4 : htttp://www.remotesensing.org/proj/
> geos : http://geos.refractions.net
>postgis : http://www.postgis.org/

1. Ekstrak, compiling, installing paket source untuk postgis(proj dan geos).
[root@localhost package_install_frsource]# tar -xvzf proj-4.5.0.tar.gz
.
.
proj-4.5.0/jniwrap/org/proj4/LatLong.java
proj-4.5.0/jniwrap/org/proj4/Others.java
proj-4.5.0/jniwrap/org/proj4/Proj4Factory.java
proj-4.5.0/jniwrap/org/proj4/Proj4.java
proj-4.5.0/jniwrap/org/proj4/ProjectionData.java
proj-4.5.0/jniwrap/org/proj4/Projections.java
[root@localhost package_install_frsource]#
[root@localhost package_install_frsource]# cd proj-4.5.0
[root@localhost proj-4.5.0]# ./configure
.
.
config.status: creating jniwrap/org/Makefile
config.status: creating jniwrap/org/proj4/Makefile
config.status: creating src/proj_config.h
config.status: executing depfiles commands
[root@localhost proj-4.5.0]#
[root@localhost proj-4.5.0]# make
.
.
make[2]: Entering directory `/usr/local/package_install_frsource/proj-4.5.0/jniwrap'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/usr/local/package_install_frsource/proj-4.5.0/jniwrap'
make[1]: Leaving directory `/usr/local/package_install_frsource/proj-4.5.0/jniwrap'
make[1]: Entering directory `/usr/local/package_install_frsource/proj-4.5.0'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/usr/local/package_install_frsource/proj-4.5.0'
[root@localhost proj-4.5.0]#
[root@localhost proj-4.5.0]# make install
.
.
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/usr/local/package_install_frsource/proj-4.5.0'
make[1]: Leaving directory `/usr/local/package_install_frsource/proj-4.5.0'
[root@localhost proj-4.5.0]#
[root@localhost proj-4.5.0]# cd ..
[root@localhost package_install_frsource]# bunzip2 geos-2.2.3.tar.bz2
[root@localhost package_install_frsource]# tar -xvf geos-2.2.3.tar
.
.
geos-2.2.3/VisualStudio/
geos-2.2.3/VisualStudio/Makefile.am
geos-2.2.3/VisualStudio/Makefile.in
geos-2.2.3/VisualStudio/GEOS.sln
geos-2.2.3/VisualStudio/GEOS.vcproj
[root@localhost package_install_frsource]#
[root@localhost package_install_frsource]# cd geos-2.2.3
[root@localhost geos-2.2.3]# ./configure
.
.
config.status: creating VisualStudio/Makefile
config.status: creating source/capi/geos_c.h
config.status: creating source/headers/config.h
config.status: creating source/headers/geos/platform.h
config.status: executing depfiles commands
[root@localhost geos-2.2.3]#
[root@localhost geos-2.2.3]# make
.
.
creating example
make[1]: Leaving directory `/usr/local/package_install_frsource/geos-2.2.3/doc'
Making all in VisualStudio
make[1]: Entering directory `/usr/local/package_install_frsource/geos-2.2.3/VisualStudio'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/local/package_install_frsource/geos-2.2.3/VisualStudio'
make[1]: Entering directory `/usr/local/package_install_frsource/geos-2.2.3'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/usr/local/package_install_frsource/geos-2.2.3'
[root@localhost geos-2.2.3]#
[root@localhost geos-2.2.3]# make install
.
.
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/usr/local/package_install_frsource/geos-2.2.3'
make[1]: Leaving directory `/usr/local/package_install_frsource/geos-2.2.3'
[root@localhost geos-2.2.3]#
[root@localhost geos-2.2.3]# cd ..

2. Ekstrak postgis dan pindahkan postgis ke postgresql-8.1.3/contrib/.
[root@localhost package_install_frsource]# tar -xvzf postgis-1.1.6.tar.gz
.
.
postgis-1.1.6/topology/README
postgis-1.1.6/install-sh
postgis-1.1.6/geos_version.sh
postgis-1.1.6/autogen.sh
postgis-1.1.6/Makefile
[root@localhost package_install_frsource]#
[root@localhost package_install_frsource]# ll
total 35500
drwxrwxrwx 8 509 users 4096 Dec 30 15:41 geos-2.2.3
-rw-r--r-- 1 root root 4085760 Nov 18 16:58 geos-2.2.3.tar
drwxr-xr-x 12 hkhotimah hkhotimah 4096 Dec 30 13:35 httpd-2.2.3
-rw-r--r-- 1 root root 6342475 Nov 18 08:31 httpd-2.2.3.tar.gz
drwxr-xr-x 18 1002 1002 4096 Dec 30 14:41 php-5.2.0
-rw-r--r-- 1 root root 8583491 Nov 18 10:31 php-5.2.0.tar.gz
drwxr-xr-x 10 529 users 4096 Nov 7 00:43 postgis-1.1.6
-rw-r--r-- 1 root root 2039011 Nov 18 11:05 postgis-1.1.6.tar.gz
drwxrwxrwx 6 avahi avahi 4096 Dec 30 13:51 postgresql-8.1.4
-rw-r--r-- 1 root root 14548395 Nov 18 11:32 postgresql-8.1.4.tar.gz
drwxrwxrwx 6 postgres users 4096 Dec 30 15:34 proj-4.5.0
-rw-r--r-- 1 root root 655450 Nov 18 11:02 proj-4.5.0.tar.gz
[root@localhost package_install_frsource]# mv postgis-1.1.6 postgresql-8.1.4/contrib/
[root@localhost package_install_frsource]# ll postgresql-8.1.4/contrib/ | grep postgis
drwxr-xr-x 10 529 users 4096 Nov 7 00:43 postgis-1.1.6

3. Konfigurasi postgis dengan sebelumnya masuk ke folder postgis
[root@localhost package_install_frsource]# cd postgresql-8.1.4/contrib/postgis-1.1.6/
[root@localhost postgis-1.1.6]# ./configure \
> --with-pgsql=/usr/local/pgsql/bin/pg_config
.
.
checking for pdfxmltex... /usr/bin/pdfxmltex
checking for db2pdf... /usr/bin/db2pdf
checking for jw... /usr/bin/jw
checking which template to use... linux
configure: creating ./config.status
config.status: creating Makefile.config
config.status: creating config.h

SUMMARY
-------------------------------------------------------

HOST_OS: linux-gnu

PGSQL: /usr/local/pgsql/bin/pg_config
GEOS: /usr/local/bin/geos-config (with C-API)
(ldflags: -L/usr/local/lib)
PROJ: prefix=/usr/local libdir=/usr/local/lib
ICONV: 1

PORTNAME: linux
PREFIX: /usr/local/pgsql
EPREFIX: ${prefix}
DOC: /usr/local/pgsql/doc/contrib
DATA: /usr/local/pgsql/share/contrib
MAN: /usr/local/pgsql/man
BIN: /usr/local/pgsql/bin
EXT: /usr/local/pgsql/lib (\$$libdir)
-------------------------------------------------------

4. Compiling
[root@localhost postgis-1.1.6]#
[root@localhost postgis-1.1.6]# make
.
.
gcc -g -Wall -I.. -DUSE_ICONV -DUSE_VERSION=81 -DPOSTGIS_VERSION='"1.1.6"' -c -o PQunescapeBytea.o PQunescapeBytea.c
gcc -g -Wall -I.. -DUSE_ICONV -DUSE_VERSION=81 -DPOSTGIS_VERSION='"1.1.6"' shpopen.o dbfopen.o getopt.o PQunescapeBytea.o pgsql2shp.o -L/usr/local/pgsql/lib -lpq -o pgsql2shp
make[1]: Leaving directory `/usr/local/package_install_frsource/postgresql-8.1.4/contrib/postgis-1.1.6/loader'
make -C utils
make[1]: Entering directory `/usr/local/package_install_frsource/postgresql-8.1.4/contrib/postgis-1.1.6/utils'
chmod +x postgis_restore.pl create_undef.pl postgis_proc_upgrade.pl profile_intersects.pl test_estimation.pl test_joinestimation.pl
make[1]: Leaving directory `/usr/local/package_install_frsource/postgresql-8.1.4/contrib/postgis-1.1.6/utils'
[root@localhost postgis-1.1.6]#

4. Installing
[root@localhost postgis-1.1.6]# make install
/usr/local/package_install_frsource/postgresql-8.1.4/contrib/postgis-1.1.6/install-sh -c -m 755 pgsql2shp /usr/local/pgsql/bin/pgsql2shp
/usr/local/package_install_frsource/postgresql-8.1.4/contrib/postgis-1.1.6/install-sh -c -m 755 shp2pgsql /usr/local/pgsql/bin/shp2pgsql
make[1]: Leaving directory `/usr/local/package_install_frsource/postgresql-8.1.4/contrib/postgis-1.1.6/loader'
[root@localhost postgis-1.1.6]#

5. Edit /etc/ld.co.conf
[root@localhost postgis-1.1.6]# vi /etc/ld.so.conf
===
note:tambahkan "/usr/local/lib"
=====
[root@localhost postgis-1.1.6]# ldconfig

6. Test postgis
[postgres@localhost postgis-1.1.6]$ /usr/local/pgsql/bin/createlang plpgsql test
[postgres@localhost postgis-1.1.6]$ /usr/local/pgsql/bin/psql -d test -f /usr/local/pgsql/share/contrib/lwpostgis.sql
.
.
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
CREATE FUNCTION
COMMIT
[postgres@localhost postgis-1.1.6]$
[postgres@localhost postgis-1.1.6]$ /usr/local/pgsql/bin/psql -d test -f /usr/local/pgsql/share/contrib/spatial_ref_sys.sql
.
.
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
COMMIT
VACUUM
[postgres@localhost postgis-1.1.6]$
[postgres@localhost postgis-1.1.6]$ exit

No comments: