1_postgis(2.2.1) のインストール # yum install gcc # gcc v 組み込み spec を使用しています COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64redhatlinux/4.8.5/ltowrapper ターゲット : x86_64redhatlinux configure 設定 :../configure prefix=/usr mandir=/usr/share/man infodir=/usr/share/info withbugurl=http://bugzilla.redhat.com/bugzilla enablebootstrap enableshared enablethreads=posix enablechecking=release 1 gccのインストール withsystemzlib enable cxa_atexit disablelibunwindexceptions enablegnuunique object enablelinkerbuildid withlinkerhashstyle=gnu enablelanguages=c,c++,objc,objc+ +,java,fortran,ada,go,lto enableplugin enableinitfiniarray disablelibgcj withisl=/builddir/build/build/gcc4.8.520150702/objx86_64redhatlinux/islinstall withcloog=/builddir/build/build/gcc4.8.520150702/objx86_64redhatlinux/clooginstall enablegnuindirectfunction withtune=generic witharch_32=x8664 build=x86_64redhatlinux スレッドモデル : posix gcc バージョン 4.8.5 20150623 (Red Hat 4.8.54) (GCC) 2 makeのインストール 3 zlibのインストール 4 readlineのインストール 5 libxml2のインストール 6 tarのインストール # yum install make # make v GNU Make 3.82 Built for x86_64redhatlinuxgnu Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. # yum install zlib zlibdevel # yum list zlib zlibdevel zlib.x86_64 1.2.715.el7 zlibdevel.x86_64 1.2.715.el7 # yum install readline readlinedevel # yum list readlin readlinedevel readlinedevel.x86_64 6.29.el7 # yum install libxml2 libxml2devel # yum list libxml2 libxml2devel libxml2.x86_64 2.9.16.el7_2.2 @updates libxml2devel.x86_64 2.9.16.el7_2.2 @updates # yum install tar # tar version tar (GNU tar) 1.26 Copyright (C) 2011 Free Software Foundation, Inc. 使用許諾 GPLv3+: GNU GPL version 3 またはそれ以降 <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. [ 参考訳 ] これはフリーソフトウェアです. 変更と再配布は自由です. 法律で認められる範囲で 無保証 です. 作者 : John Gilmore, Jay Fenlason. ページ 1
1_postgis(2.2.1) のインストール 7 perlのインストール 8 PerlExtUtilsEmbedのインストール 9 gccc++ のインストール # yum install perl # perl v This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64linuxthreadmulti (with 29 registered patches, see perl V for more detail) Copyright 19872012, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. # yum install perlextutilsembed # yum list perlextutilsembed perlextutilsembed.noarch 1.30286.el7 # yum y install gccc++ # yum y list gccc++ gccc++.x86_64 4.8.54.el7 10 DocBookのインストール # yum install docbookdtds.noarch # yum list docbookdtds.noarch docbookdtds.noarch 11 PostgreSQL(9.5.1) のインストール 別シート 1_PostgreSQL(9.5.1) のインストール を参照し インストールを実施する 12 geos(3.5.0) のインストール 別シート 2_geos(3.5.0) のインストール を参照し インストールを実施する 別シート 3_gdal(2.0.2) のインストール を参照し インストールを実施する 13 gdal(2.0.2) のインストール 1.051.el6 14 proj(4.9.2) のインストール 別シート 4_proj(4.9.2) のインストール を参照し インストールを実施する 15 PoistGISソースディレクトリの作成 # mkdir /usr/local/src/postgis2.2.1 # chown : /usr/local/src/postgis2.2.1 # ls l /usr/local/src drwxrxrx. 2 6 3 月 14 16:12 postgis2.2.1 16 postgis2.2.1.tar.gz の取得 # cd /usr/local/src/ # wget http://download.osgeo.org/postgis/source/postgis2.2.1.tar.gz # ls l /usr/local/src drwxrxrx. 2 6 3 月 14 16:12 postgis2.2.1 rwrr. 1 10069889 1 月 6 13:41 /usr/local/src/postgis2.2.1.tar.gz 17 postgis2.2.1.tar.gz の展開 $ cd /usr/local/src/ $ tar zxvf postgis2.2.1.tar.gz $ ls l /usr/local/src/ drwxrxrx. 15 4096 1 月 6 12:53 postgis2.2.1 rwrr. 1 10069889 1 月 6 13:41 postgis2.2.1.tar.gz 18 configureスクリプトの実行 $ cd /usr/local/src/postgis2.2.1/ $./configure withpgconfig=/usr/local/pgsql/bin/pg_config withgeosconfig=/opt/geo/bin/geosconfig withprojdir=/opt/geo withgdalconfig=/opt/geo/bin/gdalconfig エラーが表示されないこと 19 コンパイルの実行 $ gmake エラーが表示されないこと ページ 2
1_postgis(2.2.1) のインストール $ gmake check エラーが表示されないこと 20 コンパイルのチェック 21 インストール # cd /usr/local/src/postgis2.2.1 # gmake install エラーが表示されないこと 終了 ページ 3
2_PostgreSQL(9.5.1) のインストール # useradd # su # passwd $ 1 PostgreSQLの管理者ユーザの作成 [ 新規パスワードを入力 ] プロンプトが $ に変更されていることを確認 # su 2 PostgreSQLのソースディレクトリの作成 # mkdir /usr/local/src/ql9.5.1 # chown : /usr/local/src/ql9.5.1 $ ls l /usr/local/src/ drwxrxrx. 2 6 3 月 11 18:46 ql9.5.1 3 ql9.5.1.tar.gz の入手 # cd /usr/local/src/ # wget http://ftp.ql.org/pub/source/v9.5.1/ql9.5.1.tar.gz # ls l /usr/local/src/ drwxrxrx. 2 6 3 月 11 19:20 ql9.5.1 rwrr. 1 24039303 2 月 9 06:28 ql9.5.1.tar.gz 4 ql9.5.1.tar.gz の展開 $ cd /usr/local/src $ tar zxvf ql9.5.1.tar.gz $ ls l /usr/local/src/ql9.5.1 5 configureスクリプトの実行 6 コンパイルの実行 7 コンパイルのチェック $ cd /usr/local/src/ql9.5.1/ $./configure withlibxml withperl $ gmake world PostgreSQL, contrib, and documentation successfully made. Ready to install. $ gmake check ============== shutting down postmaster ============== ============== removing temporary instance ============== ======================= All 157 tests passed. ======================= エラーが表示されないこと エラーが表示されないこと エラーが表示されないこと 8 インストール # cd /usr/local/src/ql9.5.1/ # gmake installworld PostgreSQL, contrib, and documentation installation complete. # ls l /usr/local/ drwxrxrx. 6 52 3 月 11 19:36 pgsql 9 インストールディレクトリの権限変更 # chown : R /usr/local/pgsql/ # ls l /usr/local/ drwxrxrx. 6 52 3 月 11 19:36 pgsql $ vi ~/.bash_profile ( 太文字の値を追加 ) 10 環境設定 (~/.bash_profile) の修正 環境設定 (~/._profile) の作 11 成 # User specific environment and startup programs if [ f ~/._profile ]; then. ~/._profile fi PATH=$PATH:$HOME/bin export PATH $ vi ~/._profile ( 下記を入力 ) export PATH export PATH=/usr/local/pgsql/bin:$PATH export MANPATH=/usr/local/pgsql/share/man:$PATH export LD_LIBRARY_PATH=/usr/local/pgsql/lib:$LD_LIBRARY_PATH export PGDATA=/home//data 12 環境設定 (~/.bash_profile) の再読み込み 13 データベース格納ディレクトリの作成 $ source ~/.bash_profile $ echo $PGDATA /home//data $ mkdir /home//data/ # ls l /home/ drwxrwxrx 2 4096 3 月 14 18:39 2016 data ページ 4
14 データベースクラスタの作成 15 ログ出力先ディレクトリの作成 2_PostgreSQL(9.5.1) のインストール $ initdb E UTF8 pgdata=/home//data/ nolocale The files belonging to this database system will be owned by user "". This user must also own the server process. The database cluster will be initialized with locale "C". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /home//data... ok WARNING: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option A, or authlocal and authhost, the next time you run initdb. Success. You can now start the database server using: D /home//data/ or pg_ctl D /home//data/ l logfile start $ ls l $PGDATA rw. 1 4 3 月 11 19:47 PG_VERSION drwx. 5 38 3 月 11 19:47 base drwx. 2 4096 3 月 11 19:47 global drwx. 2 17 3 月 11 19:47 pg_clog drwx. 2 6 3 月 11 19:47 pg_commit_ts drwx. 2 6 3 月 11 19:47 pg_dynshmem rw. 1 4468 3 月 11 19:47 pg_hba.conf rw. 1 1636 3 月 11 19:47 pg_ident.conf drwx. 4 37 3 月 11 19:47 pg_logical drwx. 4 34 3 月 11 19:47 pg_multixact drwx. 2 17 3 月 11 19:47 pg_notify drwx. 2 6 3 月 11 19:47 pg_replslot drwx. 2 6 3 月 11 19:47 pg_serial drwx. 2 6 3 月 11 19:47 pg_snapshots drwx. 2 6 3 月 11 19:47 pg_stat drwx. 2 6 3 月 11 19:47 pg_stat_tmp drwx. 2 17 3 月 11 19:47 pg_subtrans drwx. 2 6 3 月 11 19:47 pg_tblspc drwx. 2 6 3 月 11 19:47 pg_twophase drwx. 3 58 3 月 11 19:47 pg_xlog rw. 1 88 3 月 11 19:47 ql.auto.conf rw. 1 21677 3 月 11 19:47 ql.conf $ mkdir /home//data/pg_log $ ls la /home//data/pg_log drwxrwxrx. 2 6 3 月 11 19:49. drwx. 20 4096 3 月 11 19:49.. 16 PostgreSQLの設定ファイルの変更 (ql.conf) $ vi /home//data/ql.conf ( 以下の値に変更 ) #logging_collector = off #listen_addresses = 'localhost' #log_line_prefix = '' #log_autovacuum_min_duration = 1 Logging_collector = on listen_addresses = '0.0.0.0' log_line_prefix = '[%m][%d][%u][%e][%p] ' log_autovacuum_min_duration = 0 パラメータは必要に応じて適宜修正する事 17 PostgreSQLの設定ファイルの変更 (pg_hba.conf) $ vi /home//data/pg_hba.conf host all all 127.0.0.1/32 trust host all all [ 接続許可 IP アドレス ]/32 trust $ pg_ctl start server starting $ pg_ctl status pg_ctl: server is running (PID: 31513) /usr/local/pgsql/bin/ "D" "/home//data" 18 PostgreSQLの起動 $ ls l /home//data/pg_log/ rw. 1 815 3 月 11 20:03 ql201603 11_200327.log 19 起動スクリプトの修正 $ vi /usr/local/src/ql9.5.1/contrib/startscripts/linux 以下を編集 PGDATA="/usr/local/pgsql/data" PGDATA="/home//data" $ grep ^PGDATA < /usr/local/src/ql9.5.1/contrib/startscripts/linux PGDATA="/home//data" 20 起動スクリプトの設置 # cd /usr/local/src/ql9.5.1/contrib/startscripts/ # cp p linux ql # chown : ql # chmod 755 ql # cp p ql /etc/init.d/ # ls l /etc/init.d/ql rwxrxrx. 1 3640 3 月 11 20:15 /etc/init.d/ql 21 起動スクリプトの登録 # chkconfig add ql # chkconfig list ql ql 0:off 1:off 2:on 3:on 4:on 5:on 6:off # /etc/init.d/ql status pg_ctl: server is running (PID: 31513) /usr/local/pgsql/bin/ "D" "/home//data 22 終了 ページ 5
1 GEOSソースディレクトリの作成 3_geos(3.5.0) のインストール # mkdir /usr/local/src/geos3.5.0 # chown : /usr/local/src/geos3.5.0 # ls l /usr/local/src/ drwxrxrx. 2 63 3 月 11 20:35 geos3.5.0 2 geos3.5.0.tar.bz2 の取得 # cd /usr/local/src/ # wget http://download.osgeo.org/geos/geos3.5.0.tar.bz2 # ls l /usr/local/src/ drwxrxrx. 2 63 3 月 11 20:35 geos3.5.0 rwrr. 1 1949397 8 月 17 2015 geos3.5.0.tar.bz2 3 geos3.5.0.tar.bz2 の展開 $ cd /usr/local/src/ $ tar jxvf geos3.5.0.tar.bz2 # ls l /usr/local/src/ drwxrxrx. 2 63 3 月 11 20:35 geos3.5.0 rwrr. 1 1949397 8 月 17 2015 geos3.5.0.tar.bz2 4 configureスクリプトの実行 5 コンパイルの実行 6 コンパイルのチェック 7 インストール $ cd /usr/local/src/geos3.5.0/ $./configure prefix=/opt/geo $ make $ make check # cd /usr/local/src/geos3.5.0/ # make install エラーが表示されないこと エラーが表示されないこと エラーが表示されないこと エラーが表示されないこと $ vi /home//.bash_profile ( 太文字の値を追加 ) # User specific environment and startup programs $ source /home//.bash_profile $ echo $GEO /opt/geo 8 環境設定 (~/.bash_profile) の修正 if [ f ~/._profile ]; then. ~/._profile fi GEO=/opt/geo PATH=$PATH:$GEO/bin:$HOME/bin export PATH $ vi /home//.bash_profile ( 太文字の値を追加 ) # User specific environment and startup programs $ source /home/l/.bash_profile $ echo $LD_LIBRARY_PATH /opt/geo/lib 9 LD_LIBRARY_PATHを登録する if [ f ~/._profile ]; then. ~/._profile fi GEO=/opt/geo PATH=$PATH:$GEO/bin:$HOME/bin export LD_LIBRARY_PATH=/opt/geo/lib export PATH 10 ライブラリを登録する # echo /opt/geo/lib > /etc/ld.so.conf.d/geo.conf # ldconfig 終了 ページ 6
1 GDALのソースディレクトリ作成 4_gdal(2.0.2) のインストール # mkdir /usr/local/src/gdal2.0.2 # chown : /usr/local/src/gdal2.0.2 # ls l /usr/local/src drwxrxrx. 2 6 3 月 14 15:24 gdal2.0.2 2 gdal2.0.2.tar.gz の取得 # cd /usr/local/src/ # wget http://download.osgeo.org/gdal/2.0.2/gdal2.0.2.tar.gz # ls l /usr/local/src drwxrxrx. 2 6 3 月 14 15:24 gdal2.0.2 rwrr. 1 11643726 1 月 27 00:28 /usr/local/src/gdal2.0.2.tar.gz 3 gdal2.0.2.tar.gz の展開 $ cd /usr/local/src/ $ tar zxvf gdal2.0.2.tar.gz $ ls l /usr/local/src/ drwxrxrx. 19 4096 1 月 27 00:21 gdal2.0.2 rwrr. 1 11643726 1 月 27 00:28 gdal2.0.2.tar.gz 4 configureスクリプトの実行 5 コンパイルの実行 6 インストール $ cd /usr/local/src/gdal2.0.2/ $./configure prefix=/opt/geo $ make # cd /usr/local/src/gdal2.0.2/ # make install エラーが表示されないこと エラーが表示されないこと エラーが表示されないこと 7 終了 ページ 7
1 PROJ.4ソースディレクトリの作成 5_proj(4.9.2) のインストール # mkdir /usr/local/src/proj4.9.2 # chown : /usr/local/src/proj4.9.2 # ls la /usr/local/src drwxrxrx 2 4096 3 月 14 19:21 2016 proj4.9.2 2 proj4.9.2.tar.gz の取得 # cd /usr/local/src # wget http://download.osgeo.org/proj/proj4.9.2.tar.gz # ls l /usr/local/src drwxrxrx 2 4096 3 月 14 19:21 2016 proj4.9.2 rwrr. 1 874816 9 月 11 2015 /usr/local/src/proj4.9.2.tar.gz 3 proj4.9.2.tar.gz の展開 $ cd /usr/local/src/ $ tar zxvf proj4.9.2.tar.gz $ ls l /usr/local/src/ drwxrwxrx. 8 4096 9 月 11 2015 proj4.9.2 rwrr. 1 874816 9 月 11 2015 proj4.9.2.tar.gz 4 configureスクリプトの実行 5 コンパイルの実行 6 コンパイルのチェック 7 インストール $ cd /usr/local/src/proj4.9.2/ $./configure prefix=/opt/geo $ make $ make check # cd /usr/local/src/proj4.9.2/ # make install エラーが表示されないこと エラーが表示されないこと エラーが表示されないこと エラーが表示されないこと 8 終了 ページ 8