Linuxサーバ奮戦記 --- PostgreSQL 8.2.x --- 19Jan2008 >>TOP PostgresSQL 8.2.x インストール ソースの入手先: http://www.postgresql.jp/ マニュアル: PostgreSQL 8.2.6 現時点で postgresql-8.2.6.tar.gz である。 # tar zxvf postgresql-8.2.6.tar.gz # cd postgresql-8.2.6 # ./configure # gmake # gmake install # useradd postgres # mkdir /usr/local/pgsql/data # chown postgres:postgres /usr/local/pgsql/data # su - postgres $ vi ~/.bashrc 以下の行を追加 export PATH=$PATH:/usr/local/pgsql/bin export PGLIB=/usr/local/pgsql/lib export LD_LIBRARY_PATH=/usr/local/pgsql/lib 書込み後,設定ファイルを有効にする。 $ source ~/.bashrc データベースの初期化 $initdb -D /usr/local/pgsql/data --encoding=EUC_JP サーバの起動 $ pg_ctl start -D /usr/local/pgsql/data ![]() # cd /usr/local/src/postgresql-8.2.6/contrib/start-scripts # cp linux /etc/rc.d/init.d/postgresql # chmod 755 /etc/rc.d/init.d/postgresql # chkconfig postgresql on 以下の様にユーザを設定すればとりあえず,URLでアクセスできるようになる。 $createuser -d nobody メモ: Apache2 の httpd.conf の User,Groupに合わせる。 (Apache2.2.x からは daemon になっているが,以前のバージョンから引き続き運用していることもあり nobody にしている) --- httpd.conf --- ・・・・・ User nobody Group nobody ・・・・・ ![]()
![]() sampledb が登録されているとすると,これをバップアップするには以下の様にする。 例:sampledbをsampledb.bkとしてバップアップする。
![]() データベースが残っている場合うまくいかない可能性があるので,一度削除してから入れ直す。
![]() 例:6時間毎に sampledb をユーザディレクトリ user1 に出力する。 まずは,crontab の設定に以下のコマンド入力。
入力モード(i)で以下の内容を入力。ESC後Shift+ZZで書込み終了。
|