재익님의 아래 7.1 버젼 글보니 여전히 수고하시는군요.
재익님의 게시글 보고 저도 뭔가 도움이 되고자
한자 적습니다. 다들 도움이 되시길 ..
주의 : 완벽함 내용이 아님..
1/1. OpenSSL 설치
다음은 openssl 설치 후 localhost 에서
테스트 결과를 정리한 내용입니다.
openssl 은 www.openssl.org에서 다운받는다.
$ tar zxvf openssl/0.9.6.tar.gz
$ cd ./openssl/0.9.6
$ ./config
$ make
$ make test
$ make install
1/2. PostgreSQL 7.1 Snapshot버젼 설치
$ tar zxvf postgresql_7.1_snapshot.tar.gz
$ cd ./postgresql_7.1_snapshot
$ ./configure //enable/multibyte //enable/locale //with/tcl //with/perl \
//with/openssl=/usr/local/ssl
$ make
$ make check
$ make install
/ /etc/ld.so.conf에 /usr/local/pgsql/lib 추가 후 ldconfig 실행
/ /etc/profile에 PGDATA,PGLIB,MANPATH,PATH등을 추가한다.
$ chown /R postgres:postgres /usr/local/pgsql
$ su / postgres
$ initdb /E EUC_KR
1/3. SSL설정
/$PGDATA/postgresql.conf 에 ssl=true 를 추가한다.
$ openssl req /new /text /out cert.req
$ openssl rsa /in privkey.pem /out cert.pem
$ openssl req /x509 /in cert.req /text /key cert.pem /out cert.cert
$ cp cert.pem $PGDATA/server.key
$ cp cert.cert $PGDATA/server.crt
1/4. 실행
$ vi PGDATA/pg_hba.conf 수정
hostssl all 127.0.0.1 net_mask trust
hostssl all your_ip net_mask trust
$ pg_ctl /o "/i"
$ psql /h localhost template1
...
SSL enabled connection. ..
template1=# \q
$
$ psql /h your_ip template1
...
SSL enabled connection. ..
template1=# \q
$
2/1. syslog example
PostgreSQL configure 에서
$ ./configure ... \
//enable/syslog
$ make
$ make install
$ vi /etc/syslog.conf
.warn;*.err /var/log/syslog
$ touch /var/log/syslog
$ chmod 600 /var/log/syslog
중간 생략
$ cd $PGDATA/
$ vi postgresql.conf
log_connections=on
syslog=2 #range 0/2
$ su / postgres
$ pg_ctl start
...
or
$ pg_ctl /l /usr/local/pgsql/data/pg_log start
참고로 /etc/syslog.conf에 *.=info; *.=notice;*.=debug등을 추가하면
엄청난 양의 데이타들이 저장된다. 다음은 예이다.
.warn;*.err;*.=info;*.=notice;*.=debug /var/log/syslog
참조 : PostgreSQL 7.1 개발 버젼문서 admin 참조
3.$PGDATA/postgresql.org
# 다음은 $PGDATA/postgresql.conf의 내용입니다.
# 예전의 $PGDATA/postmaster.opts.default 파일을 대체하는
# 파일로 추측되며 확장판인 듯 싶네요.
#
#
# PostgreSQL configuration file
# /////////////////////////////
#
# This file consists of lines of the form
#
# name = value
#
# (The `=' is optional.) White space is collapsed, comments are
# introduced by `#' anywhere on a line. The complete list of option
# names and allowed values can be found in the PostgreSQL
# documentation. Examples are:
#log_connections = on
#fsync = off
#max_connections = 64
# Any option can also be given as a command line switch to the
# postmaster, e.g., 'postmaster /c log_connections=on'. Some options
# can be set at run/time with the 'SET' SQL command.
#========================================================================
#
# Connection Parameters
#
#tcpip_socket = false # /i 를 의미
#ssl = false
#max_connections = 32 # 1/1024 ,, /N 을 의미
#port = 5432
tcpip_socket = true # 예전의 /i 옵션인듯..
ssl = true # configure 설정때 openssl 이 설정되어
# 있어야 합니다.
max_connections = 64 # 1/1024 ,,예전의 /N 옵션입니다.
port = 5432
#hostname_lookup = false
#show_source_port = false
#unix_socket_directory = ''
#unix_socket_group = ''
#unix_socket_permissions = 0777
#virtual_host = ''
#krb_server_keyfile = ''
#
# Performance
#
#sort_mem = 512 # postgres 의 Sorting 버퍼 옵션입니다.
#shared_buffers = 2*max_connections # min 16
#fsync = true # 예전의 /F 옵션이며 false 를 주어야
#..fsync() 가 disable됩니다.
sort_mem = 1024
shared_buffers = 256
fsync = false
#
# Optimizer Parameters
#
#enable_seqscan = true
#enable_indexscan = true
#enable_tidscan = true
#enable_sort = true
#enable_nestloop = true
#enable_mergejoin = true
#enable_hashjoin = true
#ksqo = false
#geqo = true
#effective_cache_size = 1000 # default in 8k pages
#random_page_cost = 4
#cpu_tuple_cost = 0.01
#cpu_index_tuple_cost = 0.001
#cpu_operator_cost = 0.0025
#geqo_selection_bias = 2.0 # range 1.5/2.0
#
# GEQO Optimizer Parameters
#
#geqo_threshold = 11
#geqo_pool_size = 0 #default based in tables, range 128/1024
#geqo_effort = 1
#geqo_generations = 0
#geqo_random_seed = /1 # auto/compute seed
#
# Inheritance
#
#sql_inheritance = true
#
# Deadlock
#
#deadlock_timeout = 1000
#
# Expression Depth Limitation
#
#max_expr_depth = 10000 # min 10
#
# Write/ahead log (WAL)
# DB recorvery 관련 부분인것 같습니다.
# 이것 외에 따로 rserv 패키지가 있죠.
# contrib 디렉토리에 ..
# 저도 아직 이부분에 구체적으로 잘 모릅니다.
#
#wal_buffers = 8 # min 4
#wal_files = 0 # range 0/64
#wal_sync_method = fsync # fsync or fdatasync or open_sync or open_datasync
# Note: default wal_sync_method varies across platforms
#wal_debug = 0 # range 0/16
#commit_delay = 0 # range 0/100000
#commit_siblings = 5 # range 1/1000
#checkpoint_segments = 3 # in logfile segments (16MB each), min 1
#checkpoint_timeout = 300 # in seconds, range 30/3600
# Debug display
#
#silent_mode = false
#log_connections = false
#log_timestamp = false
#log_pid = false
log_connections = true
log_timestamp = true
log_pid = true
#debug_level = 0 # range 0/16
#debug_print_query = false
#debug_print_parse = false
#debug_print_rewritten = false
#debug_print_plan = false
#debug_pretty_print = false
#ifdef USE_ASSERT_CHECKING
#debug_assertions = true
#endif
#
# Syslog
# 시스템의 syslog를 사용하는 부분임다.
#
# ./configure 할 때 syslog 기 설정되어야 합니다.
#
#ifdef ENABLE_SYSLOG
#syslog = 0 # range 0/2
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'
#endif
#ifdef ENABLE_SYSLOG
syslog = 1 # range 0/2
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'
#endif
#
# Statistics
#
#show_parser_stats = false
#show_planner_stats = false
#show_executor_stats = false
#show_query_stats = false
#ifdef BTREE_BUILD_STATS
#show_btree_build_stats = false
#endif
#
# Lock Tracing
#
#trace_notify = false
#ifdef LOCK_DEBUG
#trace_locks = false
#trace_userlocks = false
#trace_spinlocks = false
#debug_deadlocks = false
#trace_lock_oidmin = 16384
#trace_lock_table = 0
#endif
//끝 //
도움이 되시길 ..
|