PostgerSQL 9.1 Install on CentOS 5.x

카테고리 없음 2012. 3. 29. 13:50


본 문서는 외부에서 특정 사용자로 접속이 가능한 상태까지를 가이드 합니다. 
이후의 작업은 pgAdmin III으로 작업하는 것을 상정합니다.


[root@localhost ~]# wget http://yum.pgrpms.org/reporpms/9.1/pgdg-centos91-9.1-4.noarch.rpm
--2012-03-29 02:58:42--  http://yum.pgrpms.org/reporpms/9.1/pgdg-centos91-9.1-4.noarch.rpm
Resolving yum.pgrpms.org... failed: name resolution에서 일시적인 실패.
wget: unable to resolve host address `yum.pgrpms.org'
[root@localhost ~]# vi /etc/resolv.conf
....
search localdomain
nameserver 164.124.101.2
nameserver 203.248.252.2
....
[root@localhost ~]# wget http://yum.pgrpms.org/reporpms/9.1/pgdg-centos91-9.1-4.noarch.rpm
--2012-03-29 02:19:26--  http://yum.pgrpms.org/reporpms/9.1/pgdg-centos91-9.1-4.noarch.rpm
Resolving yum.pgrpms.org... 98.129.198.114
Connecting to yum.pgrpms.org|98.129.198.114|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4925 (4.8K) [application/x-redhat-package-manager]
Saving to: `pgdg-centos91-9.1-4.noarch.rpm.1'

100%[=========================================================================>] 4,925       26.1K/s   in 0.2s

2012-03-29 02:19:28 (26.1 KB/s) - `pgdg-centos91-9.1-4.noarch.rpm.1' saved [4925/4925]

[root@localhost ~]# rpm -i pgdg-centos91-9.1-4.noarch.rpm
경고: pgdg-centos91-9.1-4.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 442df0f8
 [root@localhost ~]# yum install postgresql91-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.daum.net
* extras: ftp.daum.net
* updates: ftp.daum.net
pgdg91                                                                                      | 2.8 kB     00:00
pgdg91/primary_db                                                                           |  79 kB     00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package postgresql91-server.x86_64 0:9.1.3-1PGDG.rhel5 set to be updated
--> Processing Dependency: postgresql91 = 9.1.3-1PGDG.rhel5 for package: postgresql91-server
--> Processing Dependency: libpq.so.5()(64bit) for package: postgresql91-server
--> Running transaction check
---> Package postgresql91.x86_64 0:9.1.3-1PGDG.rhel5 set to be updated
---> Package postgresql91-libs.x86_64 0:9.1.3-1PGDG.rhel5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================
Package                           Arch                 Version                         Repository            Size
===================================================================================================================
Installing:
postgresql91-server               x86_64               9.1.3-1PGDG.rhel5               pgdg91               5.2 M
Installing for dependencies:
postgresql91                      x86_64               9.1.3-1PGDG.rhel5               pgdg91               1.6 M
postgresql91-libs                 x86_64               9.1.3-1PGDG.rhel5               pgdg91               216 k

Transaction Summary
===================================================================================================================
Install       3 Package(s)
Upgrade       0 Package(s)

Total download size: 7.0 M
Is this ok [y/N]: Y
Downloading Packages:
(1/3): postgresql91-libs-9.1.3-1PGDG.rhel5.x86_64.rpm                                       | 216 kB     00:01
(2/3): postgresql91-9.1.3-1PGDG.rhel5.x86_64.rpm                                            | 1.6 MB     00:01
(3/3): postgresql91-server-9.1.3-1PGDG.rhel5.x86_64.rpm                                     | 5.2 MB     00:01
-------------------------------------------------------------------------------------------------------------------
Total                                                                              1.5 MB/s | 7.0 MB     00:04
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : postgresql91-libs                                                                           1/3
  Installing     : postgresql91                                                                                2/3
  Installing     : postgresql91-server                                                                         3/3

Installed:
  postgresql91-server.x86_64 0:9.1.3-1PGDG.rhel5

Dependency Installed:
  postgresql91.x86_64 0:9.1.3-1PGDG.rhel5               postgresql91-libs.x86_64 0:9.1.3-1PGDG.rhel5

Complete!
[root@localhost ~]# service postgresql-9.1 initdb
데이타베이스를 초기화함:                                   [  OK  ]
[root@localhost ~]# service postgresql-9.1 start
postgresql-9.1 서비스를 시작 중:                           [  OK  ]
[root@localhost ~]# chkconfig postgresql-9.1 on

[root@localhost ~]# cd /var/lib/pgsql/9.1/data
[root@localhost data]# ls
PG_VERSION  pg_clog        pg_log        pg_serial    pg_tblspc    postgresql.conf
base        pg_hba.conf    pg_multixact  pg_stat_tmp  pg_twophase  postmaster.opts
global      pg_ident.conf  pg_notify     pg_subtrans  pg_xlog      postmaster.pid
[root@localhost data]#
[root@localhost data]# vi postgresql.conf
....
...
# - Connection Settings -

#listen_addresses = 'localhost'         # what IP address(es) to listen on;
listen_addresses = '*'                          # what IP address(es) to listen on;
                                                                  # comma-separated list of addresses;
....
...
[root@localhost data]# vi pg_hba.conf
....
...

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
#host    all             all             127.0.0.1/32            ident
host    all             all             0.0.0.0/0                md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
...
...
[root@localhost data]# service postgresql-9.1 restart
postgresql-9.1 서비스를 중지 중:                           [  OK  ]
postgresql-9.1 서비스를 시작 중:                           [  OK  ]
[root@localhost data]# su postgres
bash-3.2$ createuser -P ls_admin
Enter password for new role:
비밀번호 확인:
Shall the new role be a superuser? (y/n) y
CREATE ROLE
bash-3.2$
bash-3.2$ dropuser ls_admin
DROP ROLE


DNS가 설정되지 않았어요! [on CentOS5.x]

카테고리 없음 2011. 9. 21. 10:59


/etc/resolv.conf 에 nameserver를 등록해주면 된다.
nameserver 주소는 알아서... ^^

[root@team4svr ~]# cd /etc/
[root@team4svr etc]# vi resolv.conf 
nameserver 164.124.101.2
nameserver 203.248.252.2



GIT 설치 [on Centos5.x]

카테고리 없음 2011. 9. 20. 18:05




1) 일단 폴더를 만들고...

[root@localhost ~]# mkdir git
[root@localhost ~]# cd git
[root@localhost git]#


2) yum으로 사전에 몇 가지를설치하고...

[root@localhost git]# yum install zlib-devel
[root@localhost git]# yum install openssl-devel 
[root@localhost git]# yum install perl
[root@localhost git]# yum install cpio
[root@localhost git]# yum install expat-devel
[root@localhost git]# yum install gettext-devel

3) curl 다운 받아 설치하고...

[root@localhost git]# wget http://curl.haxx.se/download/curl-7.18.0.tar.gz
--2011-09-16 14:30:19--  http://curl.haxx.se/download/curl-7.18.0.tar.gz
Resolving curl.haxx.se... 80.67.6.50, 2a00:1a28:1200:9::2
Connecting to curl.haxx.se|80.67.6.50|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2285430 (2.2M) [application/x-gzip]
Saving to: `curl-7.18.0.tar.gz'

100%[=========================================================================>] 2,285,430    454K/s   in 4.9s

2011-09-16 14:30:26 (454 KB/s) - `curl-7.18.0.tar.gz' saved [2285430/2285430]

[root@localhost git]# tar xvfz curl-7.18.0.tar.gz
[root@localhost git]# cd curl-7.18.0
[root@localhost git]# ./configure
......
[root@localhost git]# make
......
[root@localhost git]# make install 


4) 라이브러리 폴더를 등록해서 설치해 주고...

[root@localhost git]# vi /etc/ld.so.conf
include ld.so.conf.d/*.conf
include /usr/local/iconv

/usr/local/lib <---- 이거 추가
~
~
~
[root@localhost git]# ldconfig


5) 이제 GIT를 받아 설치한다.

[root@localhost git]# wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz
--2011-09-16 14:40:48--  http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz
Resolving www.codemonkey.org.uk... 213.5.94.17, 2a03:9800:10:5::2
Connecting to www.codemonkey.org.uk|213.5.94.17|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz [following]
--2011-09-16 14:40:50--  http://codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz
Resolving codemonkey.org.uk... 213.5.94.17, 2a03:9800:10:5::2
Reusing existing connection to www.codemonkey.org.uk:80.
HTTP request sent, awaiting response... 200 OK
Length: 3391525 (3.2M) [application/x-gzip]
Saving to: `git-latest.tar.gz'

100%[=========================================================================>] 3,391,525    805K/s   in 4.1s

2011-09-16 14:40:55 (805 KB/s) - `git-latest.tar.gz' saved [3391525/3391525]

[root@localhost git]# tar xvfz git-latest.tar.gz
[root@localhost git]# cd git-2011-09-07/
[root@localhost git-2011-09-07]#
[root@localhost git-2011-09-07]# autoconf
[root@localhost git-2011-09-07]# ./configure --with-curl=/usr/local
[root@localhost git-2011-09-07]# make; make install