2005-06-16(木)

Fedora Core3 でサーバ構築 (その3)

その2からの続き。アップするの忘れてたw」w」w」。

(7)PerlはFedoraのインストール時に一緒にインストールしたので、次にPostgreSQLのインストール。postgreSQL公式サイトからダウンロードして、/usr/local/srcに保存。

先に、postgresユーザーを作成。
# useradd postgres

で、PostgreSQLの展開と/usr/local/pgsqlの作成とオーナーの変更。
# cd /usr/local/src/
# tar -zxvf postgresql-8.0.2.tar.gz
# chown -R postgres.postgres /usr/local/src/postgresql-8.0.2/
# mkdir /usr/local/pgsql
# chown -R postgres.postgres /usr/local/pgsql/

/etc/profile に↓を追加する。

export PATH=$PATH:$HOME=/bin:/usr/local/pgsql/bin
export POSTGRES_HOME=/usr/local/pgsql
export PGLIB=$POSTGRES_HOME/lib
export PGDATA=$POSTGRES_HOME/data
export MANPATH="$MANPATH":POSTGRES_HOME/man
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":"$PGLIB"

postgresユーザーにてインストール&起動。
# su - postgres
$ cd /usr/local/src/postgresql-8.0.2/
$ ./configure
$ make all
$ make check
$ make install
$ initdb --encoding=EUC_JP --no-locale
$ pg_ctl -w start
$ psql -l

で、ユーザーとDB作成。
$ createuser xxxxxx
$ su - xxxxxx
$ createdb xxxxxx

自動起動の設定。/etc/rc.d/rc.localに↓を追記。

su - postgres -c "/usr/local/pgsql/bin/pg_ctl start -D /usr/local/pgsql/data"

あと、DBIとDBD::Pgもインストール。
# cd /usr/local/src/
# tar -zxvf DBI-1.48.tar.gz
# cd DBI-1.48
# perl Makefile.PL
# make
# make test
# make install

# tar -zxvf DBD-Pg-1.41.tar.gz
# cd DBD-Pg-1.41/
# perl Makefile.PL
# make
# make test
# make install

DB、DBI、DBD::Pgの動きを確認。

以上で全て終了。

at 16:50 | Work | Comments[0] | Trackbacks[0]

コメント
コメントする









Cookieに保存する?




   
トラックバック
このエントリーのトラックバックURL:
http://n-function.com/cgi/mt/mt-tb.cgi/256