各社VPSサーバの比較と設定方法をわかりやすく説明します。初期費用、月額料金、最低利用期間、無料トライアル・返金制度の有り無し、サーバ設置場所、メモリー、HDD、OSなどの比較ができます。

VPS設定のつぼ さくらインターネット データベース(PostgreSQL)

(1)PostgreSQLをインストール
[root@vps ~]# yum -y install postgresql-server
(2)データベースを初期化
postgresユーザーにsuして、データベースを初期化してください。
初期化中パスワード入力があります。

[root@vps ~]# su – postgres
-bash-3.2$ initdb -W -E EUC_JP –no-locale
The files belonging to this database system will be owned by user “postgres”.
This user must also own the server process.

The database cluster will be initialized with locale C.

fixing permissions on existing directory /var/lib/pgsql/data … ok
creating directory /var/lib/pgsql/data/global … ok
creating directory /var/lib/pgsql/data/pg_xlog … ok
creating directory /var/lib/pgsql/data/pg_xlog/archive_status … ok
creating directory /var/lib/pgsql/data/pg_clog … ok
creating directory /var/lib/pgsql/data/pg_subtrans … ok
creating directory /var/lib/pgsql/data/pg_twophase … ok
creating directory /var/lib/pgsql/data/pg_multixact/members … ok
creating directory /var/lib/pgsql/data/pg_multixact/offsets … ok
creating directory /var/lib/pgsql/data/base … ok
creating directory /var/lib/pgsql/data/base/1 … ok
creating directory /var/lib/pgsql/data/pg_tblspc … ok
selecting default max_connections … 100
selecting default shared_buffers … 1000
creating configuration files … ok
creating template1 database in /var/lib/pgsql/data/base/1 … ok
initializing pg_authid … ok
Enter new superuser password: ←パスワード入力
Enter it again:  ←パスワード再入力
etting password … ok
enabling unlimited row size for system tables … ok
initializing dependencies … ok
creating system views … ok
loading pg_description … ok
creating conversions … ok
setting privileges on built-in objects … ok
creating information schema … ok
vacuuming database template1 … ok
copying template1 to template0 … ok
copying template1 to postgres … ok

WARNING: enabling “trust” authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

postmaster -D /var/lib/pgsql/data
or
pg_ctl -D /var/lib/pgsql/data -l logfile start
-bash-3.2$ exit

(3)PostgreSQL起動
[root@vps ~]# /etc/rc.d/init.d/postgresql start
Starting postgresql service: [ OK ]
(4)PostgreSQL自動起動設定
[root@vps ~]# chkconfig postgresql on