'형상관리'에 해당되는 글 123건

  1. 2012.02.22 openssl-1.0.0g를 Win32 환경에서 VC6로 컴파일 정리
  2. 2012.02.14 CentOS 6.2 설치후 IP를 못받아오는 현상
  3. 2011.11.22 read 명령어 echo 끄기
  4. 2011.09.20 CentOS 5.5 Tomcat 6 설치
  5. 2011.09.19 CentOS 5.5 kdevelop 설치
  6. 2011.09.19 CentOS 5.5 한글 설정
  7. 2011.09.19 CentOS 5.5 나눔글꼴 설치 1
  8. 2011.06.28 /dev/null 퍼미션 문제로 인한 PostgreSQL 설치 문제 해결 사례
  9. 2011.05.30 Redmine 설치
  10. 2011.05.03 Dia의 Windows에서 한글 입력 오류 해결 방법
  11. 2011.03.23 안드로이드 이클립스 프로젝트에 X 표시(에러) 발생시 확인 사항 8
  12. 2011.01.17 BlackBerry 이클립스 호환 JDK 버전
  13. 2011.01.17 BlackBerry, 이클립스에서 프로젝트를 새로 import 했을 때 "Error!: Invalid class file: Incorrect classfile version" 에러 발생시 해결방법
  14. 2010.11.19 솔라리스 파일시스템 타입 보는 방법
  15. 2010.10.27 엔터프라이즈 클라우드 컴퓨팅을 구성하는 4개의 이용 모델
  16. 2010.02.12 What is Ajax?
  17. 2009.12.24 PostgreSQL 설치 시 Secondary Service 에러
  18. 2009.12.17 What's up with those "floating-point assist fault" messages? - Linux on Itanium
  19. 2009.12.16 OS별 cdrom 마운트하는 방법
  20. 2009.12.13 Ubuntu 9.10 sun-java5-jdk 설치
  21. 2009.11.12 2000통의 폭탄 메일을 받다.
  22. 2009.10.27 PostgreSQL UNIX/Linux 수동 설치
  23. 2009.10.23 본 쉘 프로그래밍에서 실행파일의 절대경로 구하기 4
  24. 2009.10.22 본 쉘 프로그래밍에서 printf 명령어
  25. 2009.08.28 스킨 본문 너비를 늘려 사용하기
  26. 2009.06.18 PostgreSQL에서의 full text index, tsearch2
  27. 2009.06.04 find 명령어를 이용한 특수문자를 포함하는 파일이름 찾기
  28. 2009.03.01 리눅스 USB 마운트
  29. 2009.02.15 리눅스(RHAS 4.0) S-ATA하드를 IDE로 인식시켜 설치하기
  30. 2008.10.28 Building the Solaris Kernel in 73 Easy Steps
openssl을 Windows XP 32bits환경에서 VC6로 컴파일할 일이 생겨 작업 후 정리를 하고자 한다.

먼저 openssl 소스를 http://www.openssl.org에서 다운로드 받는다.
내가 받은 버전은 openssl-1.0.0g 이다.

다음으로 Configure에 사용할 ActivePerl을 http://www.activestate.com/activeperl/downloads에서 다운로드 받은 후 설치한다.
내가 받은 버전은 5.14.2.1402이며, 설치시 설치 옵션에 Path 환경 변수 등록이 체크 되어 있는지 확인하여 설치한다.

다음으로 nasm을 다운로드 받는다. nasm을 사용안해도 되는 것 같지만, 속도를 위해 다운로드 받는다.
http://nasm.sourceforge.net/에서 다운받았으면, 적당한 경로에 압축을 해제한 후 Path 환경변수에 경로를 등록한다.
내가 받은 버전은 nasm-2.09.10-win32.zip 이다.

모두 다운로드 받았으면, openssl 소스를 적당한 곳에 압축해제한 후 명령프롬프트를 이용해 아래 순서대로 실행한다.

>perl Configure VC-WIN32 --prefix=c:\openssl-1.0.0g -DOPENSSL_USE_IPV6=0
>ms\do_nasm
>nmake -f ms\ntdll.mak
>nmake -f ms\ntdll.mak test
>nmake -f ms\ntdll.mak install

configure시 prefix 경로를 c:\openssl-1.0.0g로 설정하였으므로 해당 경로에 설치된다.
그리고 -DOPENSSL_USE_IPV6=0 옵션을 주지 않으면, nmake시 아래와 같은 에러가 발생하는데,

> .\apps\s_cb.c(731) : error C2027: use of undefined type 'in6_addr'
>         .\apps\s_cb.c(731) : see declaration of 'in6_addr'

이는 http://www.mail-archive.com/openssl-dev@openssl.org/msg29240.html 내용을 참고해보면,
VC6는 아직 IPv6를 제대로 지원하지 않아 발생하는 문제로 VC 2003 이상을 사용하여 컴파일 하거나
위와 같이 옵션을 주어 IPv6를 사용하지 않으면 된다.
Posted by dcmru
,

CentOS 6.2 i386을 설치하는 중간에 네트워크 설정을 하였으나 설치 완료 후 인터넷이 되지 않는다.

X-window에 로그인하여 System->Preferences->Network에서 네트워크 설정을 또 하였다.

그래도 네트워크 설정이 정상적으로 적용되지 않는다.

터미널에서 system-config-network를 실행하여 네트워크를 재설정한 후

# /etc/init.d/network restart 를 하였지만 에러만 발생하여 eth0이 시작되지 않고, IP가 설정되지 않았다.

# netstat -ant 를 실행해 보면 Port 리슨은 잘되고 있다.

# ifconfig 를 실행해보면 결과에서 eth0에 inet addr 라인이 없다.

CentOS의 네트워크 설정은 /etc/sysconfig/network 파일에 아래 정보들이 설정될 수 있다.

NETWORKING=yes
HOSTNAME=호스트네임
GATEWAYDEV=게이트웨이 장치명
GATEWAY=게이트 웨이 IP

다음으로 /etc/sysconfig/network-scripts/ifcfg-eth0 파일에는 아래 정보들이 설정될 수 있다.

ONBOOT=yes
IPADDR=아이피
GATEWAY=게이트웨이
DNS1=dns1
DNS2=dns2
NETMASK=서브넷마스크

기타 /etc/hosts 파일도 추가 설정

원인은 NetworkManager라는 네트워크 설정 기능이 추가된 듯 한데, network와 충돌이 발생하는 것으로 보인다.
아래 순서대로 실행하여 NetworkManagere을 off하고 network를 사용하도록 설정해준 후 문제를 해결할 수 있었다.

# service NetworkManager stop        <= NetworkManager 정지
# chkconfig NetworkManager off        <= 부팅시 NetworkManager 실행되지 않도록 설정
# chkconfig network on                     <= 부팅시 network 실행되도록 설정
# system-config-network                  <= IP, 게이트웨이, DNS, 서브넷마스크 등 설정
# service network restart                   <= network 재시작

'형상관리 > 리눅스' 카테고리의 다른 글

Ubuntu 12.04 XRDP에서 PATH 설정  (0) 2013.08.22
CentOS 5.8에 kdesvn 설치  (0) 2012.04.23
CentOS 5.5 Tomcat 6 설치  (0) 2011.09.20
CentOS 5.5 kdevelop 설치  (0) 2011.09.19
CentOS 5.5 한글 설정  (0) 2011.09.19
Posted by dcmru
,
쉘 스크립트에서 read 명령어를 이용하여 값을 입력 받을 때 비밀번호를 입력 받을 때 처럼 화면 출력을 끄는 방법

1. stty 명령어 이용

#!/bin/sh

stty -echo
read RVAL
stty echo

echo $RVAL

exit 0

2. read 명령어에 -s 옵션 사용하여 사이런트 모드로 입력, -r 옵션은 역슬래시(\)를 이스케이프로 받아들이지 않는다.
   (리눅스에서는 확인하였고, 솔라리스에서는 -s 옵션이 없으므로 확인 필요)

read -s RVAL
Posted by dcmru
,

# yum install yum-priorities

# rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

# cd /etc/yum.repos.d/
# wget http://jpackage.org/jpackage50.repo

# yum install java

# yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps

# service tomcat6 start

참고: http://www.how2centos.com/installing-tomcat-6-on-centos-5-5-tutorial/


또는 수동으로 설치하는 방법은


http://www.oracle.com/technetwork/java/javase/downloads/index.html 여기서 JDK 또는 JRE를 받은 후

JAVA_HOME, CLASSPASS, PATH 환경 변수를 설정하고,

http://tomcat.apache.org/download-60.cgi 여기서 Tomcat를 다운 받아 압축을 푼 후 bin의 실행 스크립트를 실행하면 된다.

'형상관리 > 리눅스' 카테고리의 다른 글

CentOS 5.8에 kdesvn 설치  (0) 2012.04.23
CentOS 6.2 설치후 IP를 못받아오는 현상  (0) 2012.02.14
CentOS 5.5 kdevelop 설치  (0) 2011.09.19
CentOS 5.5 한글 설정  (0) 2011.09.19
CentOS 5.5 나눔글꼴 설치  (1) 2011.09.19
Posted by dcmru
,
"프로그램->소프트웨어 추가/삭제"를 실행한 후 찾기에서 kdevelop을 검색한 후 설치한다.

또는

# yum install kdevelop

으로 설치 가능하다.

kdevelop에서 한글 입력에 문제가 있거나 키 입력이 안되는 문제가 발생한다면, 다음 패키지를 설치한다.

http://dcmru.tistory.com/2510999를 따라 먼저 설치 및 설정 한 후 아래 패키지를 설치한다.

# yum install scim-bridge scim-bridge-gtk scim-qtimm

kdevelop 사용시 기존에 생성되어 있는 소스와 Makefile을 사용하려면,

kdevelop 실행 후 "프로젝트->Import Existing Project..."을 실행 한 후 소스가 있는 디렉터리를 지정한 후

Project type을 "Generic C Application (Custom Makefiles)"로 해준다.

참고: http://wiki.kldp.org/wiki.php/KDevelop
Posted by dcmru
,

# yum install kde-i18n-Korean

# yum install fonts-korean

# yum install scim-hangul

# vi /etc/sysconfig/i18n
LANG="ko_KR.eucKR"
SUPPORTED="en_US.UTF-8:en_US:en:ko_KR.eucKR:ko_KR:ko"
SYSFONT="latarcyrheb-sun16"

# vi /etc/profile
export LESSCHARSET=utf-8

설정 후 재부팅

만약 UTF-8로 사용하려면, 아래와 같이 설정한다.

# vi /etc/sysconfig/i18n
LANG="ko_KR.UTF-8"
SUPPORTED="en_US.UTF-8:en_US:en:ko_KR.UTF-8:ko_KR.eucKR:ko_KR:ko"
SYSFONT="latarcyrheb-sun16"

ko_KR.eucKR로 사용하면, VMware 사용시 OS 부팅될 때 vmware-user가 실행이 안되어 화면 자동 조절이 안된다.
이외에 VMware Tools 설치할 때도 에러가 발생하므로, 맘편하게 ko_KR.UTF-8을 사용하기로 했다.

Posted by dcmru
,

네이버 나눔글꼴 설치

# mkdir /usr/share/fonts/nanumfont

# cd /usr/share/fonts/nanumfont

# wget http://cdn.naver.com/naver/NanumFont/fontfiles/NanumFont_TTF_ALL.zip

# unzip NanumFont_TTF_ALL.zip

# mkfontscale

# mkfontdir

# fc-cache -r

"시스템->기본 설정->글꼴"에서 설정해준다.


네이버 나눔고딕 코딩글꼴 설치

# wget http://dev.naver.com/frs/download.php/443/ttf-nanum-coding-2.0-2.noarch.rpm

# rpm -i ttf-nanum-coding-2.0-2.noarch.rpm

나눔고딕 코딩글꼴은 개발툴의 폰트 설정에 지정해준다.


사용을 하다보니 나눔고딕이 고정폭이 아니어서 고정폭을 사용하는 터미널 등에서 글자가 겹쳐보인다.
그래서 고정폭 글꼴은 CentOS 5.5에 기본으로 포함되어 있는 DejaVu LGC Sans Mono로 설정하니 한결 보기 편하다.


PS. 우분투 12.04에서도 설치 방법은 위의 "네이버 나눔글꼴 설치" 설명과 다르지 않다. /usr/share/fonts/에 복사되는 파일은 확장자가 ttf인 파일이다.

Posted by dcmru
,
UNIX/Linux 환경에서 PostgreSQL V8.3.1을 설치중 아래와 같은 메시지가 발생하면서, 설치가 되지 않는 경우가 있었다.

The program "postgres" is needed by initdb but was not found in the
same directory as "/usr/local/pgsql/bin/initdb".
Check your installation

The program "postgres" is needed by pg_ctl but was not found in the
same directory as "/usr/local/pgsql/bin/pg_ctl".
Check your installation

타 시스템과 비교중 /dev/null의 퍼미션이 변경되어 있었다.

initdb 또는 pg_ctl을 root 유저가 아닌 일반유저로 실행시 /dev/null에 쓰기 권한이 없으면, 위와 같은 메시지가 표시되었다.

그래서 /dev/null 의 퍼미션을 아래 명령어와 같이 rw-rw-rw로 변경하여 해당 문제를 해결할 수 있었다.

# chmod 666 /dev/null

퍼미션을 변경하기 전에 /dev/null의 퍼미션을 숙지하여, 발생할 수 있는 오류를 미연에 방지하는 것은 센스~

Posted by dcmru
,

Redmine 설치

형상관리/툴 2011. 5. 30. 17:55
프로젝트 관리를 SVN과 아웃룩의 일정기능을 사용하여 관리를 하다 Redmine이라는 툴을 알게 되었다.

그래서 RHEL5에 설치를 해봤고, 이를 간략하게 정리해보고자 한다.

Redmine은 프로젝트 관리와 이슈 관리를 할 수 있는 웹 애플리케이션이고, Ruby on Rails 프레임워크로 만들어졌다고 한다.

홈페이지는 http://www.redmine.org/ 이다.

먼저 여러 블로그들과 사이트들의 설치 방법을 정독한 후 실제 설치 한 결과 서드 파티 설치 버전으로 한 방에 설치하는 것이 제일 쉽고 간편해보였다.

그래서 아래 사이트에서 마음에 드는 인스톨러를 받아서 설치하면 된다.

http://www.redmine.org/projects/redmine/wiki/Download#Third-party-Redmine-bundles

BitNami Redmine Stack를 선택하였으며, 리눅스용으로 Redmine 1.1.3-1 버전을 다운 받았다.

여러 블로그 들을 봤지만 서드 파티 패키지를 설치하는데, ruby 등 먼저 선설치 주는 작업을 하는 것으로 보였다.

yum으로 ruby 등 여러가지를 설치하고 서드 파티 패키지를 설치하였지만, BitNami에서 제공하는 패키지를 설치한 결과

아래 그림과 같이 관련된 프로그램인 Apache2, MySQL, Ruby & Rails, Subversion 등 관련된 패키지들이 최신버전으로 모두 같이 설치되니 괜한 고생하지 말자.



패키지 설치시 관리자 계정과 비밀번호, 이름, 연동할 이메일 주소 등을 입력하고, 간편하게 설치는 끝났다.

기존에 사용하던 Subversion을 yum을 통하여 삭제하고, BitNami에서 설치된 Subversion과 기존 Subversion의 root 디렉터리와 연동해주었다.

방법은 BitNami 패키지가 설치된 디렉터리에서 subversion/scripts/ctl.sh 스크립트에서 svnserve에 -r 옵션으로 기존 Subversion의 root 디렉터리를 지정해주었다.

그리고 서버 부팅시 자동으로 Redmine의 실행을 위해 아래와 같은 작업을 추가하였다.

# cp /opt/redmine-1.1.3-1/ctlscript.sh /etc/rc.d/init.d/redmine
# vi /etc/rc.d/init.d/redmine                                                          <= vi로 열어 아래 내용을 파일의 상단에 추가한다.
-----------------------------------------------------------
#!/bin/sh
# chkconfig: 2345 80 30
# description: BitNami Service
# processname: bitnami-redmine
# Source funtion library
. /etc/rc.d/init.d/functions
-----------------------------------------------------------
# chkconfig --add redmine                                                           <= chkconfig 명령어로 redmine 스크립트를 등록한다.


웹브라우저로 http://<로컬IP주소>/redmine 접속하면, redmine이 실행된 화면을 볼 수 있다.



아래 주소에서 여러가지 플러그인을 받아 설치할 수도 있다.
http://www.redmine.org/plugins?page=1

Posted by dcmru
,
순서도를 간편하게 작성해보기 위해 프로그램을 찾아 보던중 Dia라는 프로그램을 설치하게 되었다.



http://live.gnome.org/Dia 에서 다운 받을 수 있다.

Dia는 GTK+로 작성 되었으며, GNU/Linux, MacOS X, Unix, Windows를 지원하며, GPL 라이선스로 배포된다.

여하튼 윈도우에 설치를 하고, 테스트 삼아 순서도를 그려보는데, 한글 입력이 되지를 않는다.

잠깐의 검색으로 http://www.gimp.kr/viewtopic.php?f=42&t=2352 에서 해결방법을 찾았다.

다른 플랫폼은 한글입력이 잘되는 것 같으며, 근본적인 문제 해결은 아니지만 Windows에서도 한글 입력을 할 수 있게 되었다.
Posted by dcmru
,
여느 때와 같이 안드로이드 애플리케이션을 이클립스에서 개발하기 위해 이클립스를 실행하자 아래 그림과 같이 X 표시가 나타났다.


보통 이럴 경우 아래의 방법으로 해결이 되었는데, 해결이 되지 않았다.

- 프로젝트 Properties의 encoding을 사용하던 UTF-8로 변경
- 프로젝트 Properties의 안드로이드 빌드 타겟 변경
- 프로젝트 Properties의 Builders와 Java Build Path에 체크 안되어 있는 것이 있나 확인
- 프로젝트 Properties의 컴파일러 버전도 1.6에서 1.5로 변경
- 프로젝트 clean하고 다시 빌드
- Android tools의 Fix Project Properties도 실행
- 프로젝트 내에서 자동으로 생성되는 항목들(R.java, gen, bin, .setting 등) 삭제하고 다시 프로젝트를 생성
- 이클립스 workspace내의 .metadata를 삭제

이틀동안 삽질 끝에 Error Log이외에 Problems가 있는 것을 확인, 이클립스내의 프로젝트의 문제 내용이 표시되는 것을 확인하였다.

 


문제의 원인은 그림에 표시된 것과 같이 Debug Certificate expired로 Debug 사인키의 사용기한이 만료된 것이었다.

보통 이클립스를 처음 실행시 디버그키가 자동적으로 생성되며, 사용기한은 기본적으로 1년이다.

이와 같은 에러가 발생을 하고, 자신의 이클립스 안드로이드 환경을 구성한지 1년이 되었다면, 위의 방법을 통해 문제 발생의 원인을 알 수 있다.

그렇다면, 문제의 해결방법은 디버그 키를 새로 생성하는 것이다.

디버그 키의 저장 경로는 Windows 7과 Vista의 경우 C:\Users\<user>\.android\debug.keystore이고,

Windows XP 이하 C:\Documents and Settings\<user>\.android\debug.keystore이다.

위의 파일을 삭제하고, 프로젝트를 새로 빌드하면, 디버그키는 자동으로 새로 생성된다.

http://developer.android.com/guide/publishing/app-signing.html

위의 링크도 한 번 확인해 보기 바란다.
Posted by dcmru
,

SQLite 암호화 기능을 사용하려고, File Signer을 사용하여 셀프 사인 후 cod 파일을 더블 클릭하면,

Signature Tool이 실행되어 사인 정보를 확인할 수 있다고, 문서에 나와있어 따라해 보았으나 키쌍을 찾을 수 없다는 에러 창이 떴다.

포럼에서 관련 에러를 찾아보니 JDK 1.5 버전을 설치하라고 하여 설치하였던 1.6을 지우고 1.5를 설치하였다.

이클립스를 실행했더니 BlackBerry에 관련된 메뉴가 하나도 안보인다.

하루 삽질을 하고 다음날 BlackBerry 다운로드 페이지를 살펴보니 JDK 1.6과 호환된다고 나와있다.

아마도 플러그인이 업데이트 되면서, 호환되는 JDK 버전도 올라간듯 하다.

그러므로 절대 JDK 1.5 버전을 설치하고, 이클립스에서 BlackBerry 플러그인을 설치하는 일이 없길 바란다.

설치한 플러그인 버전은 1.1.2.201004161203-16 이다.

그리고 앞서 에러가 발생한 Signature Tool은 수동으로 실행하여 cod 파일이 있는 곳을 찾아 열어주면 된다.

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800901/What_Is_-_Supported_versions_of_Java_for_different_BlackBerry_JDE_versions.html?nodeid=1313614&vernum=0
Posted by dcmru
,

SVN을 사용하여 기존 프로젝트를 새로 정리하고, 새로 올린 프로젝트를 체크아웃하여 이클립스에서 import 하였다.

프로젝트에 빨간 에러가 뜨길래 기존에 했던것 처럼 clean을 해봤지만 에러가 없어지지 않았다.

에러 내용은 "Error!: Invalid class file: Incorrect classfile version" 이다.

blackberryforum에 검색 결과 버그란다. 헤결방법은 컴파일러 버전을 1.4로 바꾸라는 내용이었다.

"프로젝트 속성->Java Compiler->Enable project specific settings 체크->Compiler compliance level: 1.4" 로 변경해주고,

에뮬레이터를 실행해보니 에러가 사라졌다.

이클립스는 3.5 갈릴레오 버전이고, JDK는 1.6.0_23 버전이다.

Posted by dcmru
,

root 유저로 아래 명령어를 실행하면 마운트된 파일 시스템의 타입을 볼 수 있다.

# devnm /usr
/dev/dsk/c1t0d0s3 /usr
# fstyp /dev/dsk/c1t0d0s3
ufs

이외에 /etc/vfstab 파일에서도 확인할 수 있다.

'형상관리 > 유닉스' 카테고리의 다른 글

OS별 cdrom 마운트하는 방법  (0) 2009.12.16
Building the Solaris Kernel in 73 Easy Steps  (0) 2008.10.28
Posted by dcmru
,
KISTI에서 서비스하고 있는 미리안의 메일링 리스트를 구독하고 있는데, 클라우드에 대한 개념을 이해하기에 좋은 글이 있어 가져와 본다.



클라우드 컴퓨팅(이하, 클라우드)이 일반적으로 인지되면서 기업에서도 클라우드 도입을 검토하기 시작하는 기업이 증가하고 있다. 그렇지만, 클라우드의 정의가 애매하고 기업 유저측의 혼란을 부르고 있다. 여기에서는 기업의 클라우드 도입을 위한 이용 모델을 중심으로 그 내용을 정리하고자 한다.

미국의 NIST(미국 국립 표준 기술 연구소 : National Institute of Standards and Technology)가 공표한 클라우드 정의는, 5개의 특성, 3개의 서비스 모델, 4개의 이용 모델로 구성되어 있다. NIST의 정의는 클라우드를 정리하는데 있어서의 출발점이 된다.

5개의 특성(Essential Characteristics)

 - 온디멘드 베이스의 셀프서비스(On-demand Self-service)
 - 광역 네트워크 액세스(Broad Network Access)
 - 로케이션에 의존하지 않는 자원 풀(Resource Pooling)
 - 신속한 확장성(Rapid elasticity)
 - 측정 가능한 서비스(Measured Service)

3개의 서비스 모델(Service Model)

 - SaaS(Software as a Service)
 - PaaS(Platform as a Service)
 - IaaS(Infrastructure as a Service)

4개의 이용 모델(Deployment Models)

 - 프라이빗 클라우드(Private Cloud)
 - 커뮤니티 클라우드(Community Cloud)
 - 퍼블릭 클라우드(Public Cloud)
 - 하이브리드 클라우드(Hybrid Cloud)

 이하, 클라우드의 4개 이용 모델에 대해 설명한다.

ㅇ 프라이빗 클라우드란

프라이빗 클라우드는 가상화, 표준화, 자동화 등 클라우드 기술을 활용하여 고객 또는 제공 사업자측의 데이터 센터에 자사 전용의 환경을 구축하는 것으로 컴퓨터 자원을 유저가 유연하게 이용하는 시스템이다. 프라이빗 클라우드는 기업의 파이어 월(fire wall)내에 구축되는 형태다. 프라이빗 클라우드를 크게 나누면, 프라이빗 SaaS, 프라이빗 클라우드 기반(PaaS, IaaS)의 층으로 분류된다. 특히, 프라이빗 클라우드로 논의의 중심이 되는 것이 프라이빗 클라우드 기반이다.

기업이 프라이빗 클라우드에 이행(migration)하는 경우의 스텝 예로는,

 - 데이터 센터에 데이터를 집약하여 스케일 메리트에 의한 효율화를 도모
 - 데이터 센터 중심의 시큐리티 네트워크 구성
 - 플랫폼, 프로세스, 그리고 인터페이스의 표준화를 진행
 - 서버나 스토리지의 통합, 가상화에 의해 하드웨어 가동률과 운용 효율을 높임
 - 서버상에 자사의 업무 시스템을 구축하여 Web 브라우저를 베이스로 한 환경

등의 항목을 들 수 있다.

프라이빗 클라우드로의 이행은 검토해야 할 사항이 많아, 중장기적인 로드맵을 정하여 단계적으로 진행할 필요가 있다.

프라이빗 클라우드의 메리트는 가상화나 자동화 등의 클라우드 관련 기술의 활용으로 퍼포먼스와 코스트가 최적화되어 커스터마이즈의 유연성이 높다는 것이다. 또, 자사에 운용 방향이나 서비스레벨 계약(SLA)에 대한 컨트롤이 생긴다. 한편, 프라이빗 클라우드의 디메리트는 퍼블릭 클라우드와 비교했을 경우, 초기 도입 코스트가 비싸고, 구축에도 시간이 걸리는 것이다. 또, 기업 유저의 규모가 작으면 스케일 메리트의 혜택이 적다.

ㅇ 커뮤니티 클라우드란

커뮤니티 클라우드는 공통의 목적을 가지는 특정 기업간 형성되는 “커뮤니티”가 데이터 센터에서 공동 운용되는 시스템이다. 프라이빗 클라우드와 퍼블릭 클라우드와의 중간적인 형태로, 프라이빗 클라우드와 같이 어느 정도의 유연성과 코스트 삭감을 기대할 수 있으며, 퍼블릭 클라우드와 같이 시큐리티의 문제를 해소한다.

커뮤니티 클라우드는 공통 플랫폼으로도 사용할 수 있어, 업계용 클라우드나 그룹 클라우드, 그리고 전자 정부나 전자 자치체, 교육이나 의료 등 공공 분야에서의 이용도 기대되고 있다. 커뮤니티 클라우드의 이용예로는, 소재?부품의 조달?하청 거래부터 유통?재고?판매, 유지나 리사이클에 이르기까지 밸류 체인 전체의 최적화를 실현하는 공통 플랫폼으로 활용을 생각할 수 있다.

또, 정부는 2010년 5월에 공표한 신IT전략 등에서 공공 분야 클라우드의 활용을 적극적으로 추진한다고 하고 있다. 그 때문에 공공 분야에서 효율적인 이용을 실현하기 위한 공통 플랫폼으로서 커뮤니티 클라우드의 전개가 주목받는다.

ㅇ 퍼블릭 클라우드란

퍼블릭 클라우드란, 기업의 파이어 월(fire wall)의 외측에 구축되는 형태로, 공중의 인터넷망을 통해 불특정 다수의 기업이나 개인 유저에게 제공되는 클라우드 서비스이다. 기업 유저의 이용 형태는 클라우드의 최대 특징인 “보유”에서 “이용”으로 바뀌어, 서비스로서 이용할 수 있다. 기존, 클라우드라고 하면 퍼블릭 클라우드를 가리키는 것이 일반적이었지만, 프라이빗 클라우드의 형태가 나타나면서 퍼블릭 클라우드와 프라이빗 클라우드로 크게 두 개로 분류하는 것이 많다.

SaaS의 서비스 모델은 전자 메일이나 그룹웨어 등 정보계가 중심이 되고 있다. 특히, 요즈음은 SpamMail등 시큐리티 대책으로 운용?가동 코스트가 걸려 있어 전자 메일을 퍼블릭 클라우드로 이용하는 사례를 많이 볼 수 있다. 일부 기업 유저에서는 기간계의 어플리케이션을 퍼블릭 클라우드로 이용하는 케이스도 나와 있다.

퍼블릭 클라우드로 특히 시장의 성장이 예상되고 있는 것이 IaaS나 PaaS의 서비스 모델이다. 코스트의 저가격화나 API 제공에 의한 유저 등 격렬한 쉐어 싸움이 전개되고 있다.

퍼블릭 클라우드의 메리트는 단기간 고기능의 서비스를 다양한 디바이스로 이용할 수 있는 것이다. 또, 저비용으로 이용할 수 있어 운용 관리의 부담이 적다. 이용에 따라 과금되는 종량제 과금이 일반적이고, 이용 빈도에 따라 유연하고 신속한 컴퓨터 자원의 추가나 삭제가 가능하다.

한편, 퍼블릭 클라우드는 시큐리티나 서비스 품질, 그리고 사외에 데이터 보관 등에 불안을 느끼는 기업 유저는 많다. 또, 자사에 의한 서비스 콘트롤을 할 수 없는 점도 크다. 퍼블릭 클라우드의 도입 실적이 증가해 코스트 삭감 효과나 업무 프로세스 개선 등의 효과를 확인할 수 있게 되면, 이러한 불안이 해소되고 도입이 진행될 가능성을 생각할 수 있다. 또, 다수의 외국계 클라우드 서비스 사업자가 일본의 데이터 센터 경유로 서비스를 제공할 수 있어 지연 등 서비스 품질이나 시큐리티의 불안 등도 점차 해소될 가능성이 있다.

ㅇ 하이브리드 클라우드란

하이브리드 클라우드는 지금까지 설명한 프라이빗 클라우드, 커뮤니티 클라우드, 그리고 퍼블릭 클라우드 등을 활용하는 시스템/서비스이다. 기업 유저는 기간계 시스템을 프라이빗 클라우드로 운용, 정보계 시스템은 퍼블릭 클라우드로 이용하는 경우가 많다. 각각 개별적으로 제공되는 이른바 싱글 클라우드의 형태이다. 기업 유저의 클라우드 도입이 진행됨에 따라, 개개의 클라우드의 제휴 요구는 높아져, 하이브리드 클라우드를 실현하기 위한 인터페이스의 표준화나 관리 플랫폼 등의 기대가 높아질 것으로 예상된다.

ㅇ 엔터프라이즈 분야에서 클라우드 이용

다양한 조사기관의 시장 조사 데이터에 의하면, 퍼블릭 클라우드보다 프라이빗 클라우드의 시장규모가 크다고 예상되고 있다(참고 : “일본 프라이빗 클라우드 시장 예측”, IDC Japan). 기업 유저는 클라우드의 도입 실적이나 동향을 주시하면서 중장기적인 시점에서 로드맵을 정하여 어떠한 이용 모델을 이용하는지, 자사의 정보 시스템 정보 자산과 경비의 포트폴리오를 검토해야 할 것이다.

원문 : http://headlines.yahoo.co.jp/hl?a=20100920-00000025-zdn_tt-sci
번역 : http://mirian.kisti.re.kr

'형상관리' 카테고리의 다른 글

Concurrent Programming in Erlang  (1) 2012.05.02
프로그래머를 위한 글꼴 참고  (0) 2012.04.26
웹 프로그래밍 언어 비교  (1) 2008.03.04
css/em  (0) 2007.07.14
영문 수학 용어 정리  (4) 2006.06.20
Posted by dcmru
,

What is Ajax?

형상관리/웹 2010. 2. 12. 01:57

Ajax is a way of developing Web applications that combines:
  - XHTML and CSS standards based presentation
  - Interaction with the page through the DOM
  - Data interchange with XML and XSLT
  - Asynchronous data retrieval with XMLHttpRequest
  - JavaScript to tie it all together

원문 : http://webdesign.about.com/od/ajax/a/aa101705.htm

'형상관리 > ' 카테고리의 다른 글

스킨 본문 너비를 늘려 사용하기  (0) 2009.08.28
embed 태크 활용.  (0) 2005.10.15
ASP로 만들어본 학사행정정보 시스템  (0) 2005.10.14
Posted by dcmru
,

PostgreSQL을 Windows 2008 R2에서 설치 시에 Initialise database cluster 설정 창에서 Next 버튼 클릭 시 아래와 같은 메세지가 나타나면서 설치가 진행되지 않았다.



에러 내용을 보면, 데이터베이스를 초기화하는데 Secondary Logon service가 필요하다는 내용이다.

이 때에는 윈도우 서비스 관리자를 열어 Secondary Logon service를 시작 시켜주고, 설치를 진행하면 된다.



다른 버전의 윈도우는 자동 시작으로 설정이 되어 있었는데, Windows 2008 R2는 시작유형이 수동으로 되어 있었다.

설치 시에만 필요하므로 시작 유형을 자동으로 설정하지 않아도 된다.

윈도우 재시작을 해보니 PostgreSQL 구동이 이상없이 잘되는 것을 확인하였다.


Posted by dcmru
,

리눅스 ia64 플랫폼에서 PostgreSQL을 구동하다 보니 /var/log/messages 파일에 floating-point assist fault 메시지가 계속 쌓여 문제를 해결해보고자 한다.

해결 방법은 아래와 같이 컴파일 시에 -ffast-math 옵션을 주고 컴파일하거나 dmesg 명령어로 syslog의 floating-point assist 메시지를 끄는 것이다.

dmseg로 메시지 기능을 끄면 다른 에러도 쌓이지 않을 수 있으니 컴파일 시 -ffast-math 옵션을 주는 것이 좋을 것 같다.

출처 : http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801?ciid=62080055abe021100055abe02110275d6e10RCRD

When working at the Linux console or looking through the kernel's log file in /var/log/messages, you may encounter messages of the form:

 test-fpsr(1416): floating-point assist fault at ip 40000000000005d2
This message means that program "test-fpsr" with process id 1416 performed a floating-point operation that required software assistance. On Itanium, this usually happens when operating on IEEE denormals (numbers that cannot be represented in normalized form).

Again, just like for unaligned accesses, these operations are emulated in the kernel, so there is nothing to worry from a correctness point of view. However, emulating these operations takes time and can slow down a program significantly. Since most programs don't need full IEEE-compliance, Itanium Linux provides a function to turn on "flush-to-zero" mode in the processor, which avoids generating IEEE denormals as a result of ordinary floating-point calculations. This mode can be turned on using the following code fragment:

 #include <fenv.h>
    :
 fesetenv (FE_NONIEEE_ENV);
    :
Alternatively, compiler option -ffast-math can be used when linking the final program to achieve the same effect. For example:

 gcc -ffast-math test.o -o test
would build program "test" with flush-to-zero mode turned on.

Note: It is also possible to completely turn off the floating-point assist messages. To do this, simply issue the command

  $ dmesg -n4
as "root".

'형상관리 > 리눅스' 카테고리의 다른 글

CentOS 5.5 한글 설정  (0) 2011.09.19
CentOS 5.5 나눔글꼴 설치  (1) 2011.09.19
리눅스 USB 마운트  (0) 2009.03.01
리눅스(RHAS 4.0) S-ATA하드를 IDE로 인식시켜 설치하기  (0) 2009.02.15
telnet troubleshooting  (0) 2008.04.02
Posted by dcmru
,

OS별로 cdrom을 마운트하는 방법이 틀려, 자주 사용하지 않으면, 잊어먹을 때가 많다. 아래의 방법을 참조하여 cdrom을 마운트 하면 된다.

직접 확인 못한 OS도 있지만 대부분 아래의 방법으로 시도하면, cdrom을 마운트 할 수 있다. 확인을 한 OS는 AIX, HP-UX, Linux, Solaris이다.

언마운트는 umount 명령어로 하면 된다.

When you use volume management software, the CD-ROM is mounted automatically when the disk is inserted into the drive
 
If you are not using volume management software, mount the CD-ROM manually:
 
1. Place the CD-ROM in the CD-ROM drive.
2. Log in as the root user and create a CD-ROM mount point directory accessible by all users:
# mkdir /cdrom
# chmod 777 /cdrom
 
3. Mount the CD-ROM drive on the mount point directory and then exit the root account:
# mount options device_name /cdrom
# exit
Examples of mount commands and additional mounting instructions for different UNIX platforms are given below.
 

- Sun SPARC Solaris
# mount -r -F hsfs /dev/dsk/c0t06d0s2 /cdrom

 
- Solaris Intel
# mount -F hsfs -r /dev/dsk/c0t06d0s2 /cdrom
 
Note: On Solaris (Sun SPARC and Intel), if you are using Volume manager, the CD-ROM is mounted automatically. The mount point is usually /cdrom

 
- HP-UX 첫번째 방법
# nohup /usr/sbin/pfs_mountd &
# nohup /usr/sbin/pfsd &
# /usr/sbin/pfs_mount -t rrip -x unix /dev/dsk/c5t2d0 /SD_CDROM

언마운트
#/usr/sbin/pfs_umount /cdrom


- HP-UX 두번째 방법 : hp 홈페이지 참조
148947: 설치 CD는 Rock Ridge 형식을 사용하며 HP-UX 시스템에서는 mount 명령으로 올바르게 마운트할 수 없습니다.
설명: mount 명령이나 SAM을 사용하여 HP-UX에서 IBM Tivoli Enterprise Console 3.8 CD 설치 이미지를 마운트하는 경우, 모든 파일 이름은 ;1 문자열로 끝납니다. HP-UX는 mount 명령으로 Rock Ridge 형식을 지원하지 않습니다. 몇몇 경우에서는 CD-ROM 디렉토리의 마운트 해제를 위해 pfs_umount 명령이 필요할 수 있습니다.
조치: mount 명령 또는 SAM을 사용하여 IBM Tivoli Enterprise Console, 버전 3.8 설치 이미지 CD를 이미 마운트한 경우, CD-ROM은 시작하기 전에 umount 명령으로 마운트가 해제되어야 합니다.
pfs_mountd 및 pfsd 프로세스 모두가 실행 중인지 확인하십시오. 실행 중이 아니면, 다음 명령으로 두 가지 프로세스 모두를 시작하십시오.

pfs_mountd &
pfsd &

다음 명령으로 CD-ROM을 마운트하십시오.
/usr/sbin/pfs_mount /dev/dsk/CD_device mounting_point

파일 이름이 ;1 문자열 이외의 것으로 끝나는 것이 없는지 확인하십시오.
설치를 완료한 후, umount 명령으로 CD-ROM의 마운트를 해제할 수 있습니다.

HP-UX 11 또는 HP-UX 11i를 사용 중인 경우, 표준 mount 명령을 사용하는 Rock Ridge 형식 지원을 사용하기 위해 HP-UX 패치를 다운로드할 수 있습니다. 추가 정보는 Hewlett 고객 지원부에 문의하십시오.


- IBM AIX : 아래 명령어 이외에 smit로 마운트 할 수도 있다.
# mount -r -v cdrfs /dev/cd0 /cdrom

 
- Intel Linux
# mount -t iso9660 /dev/cdrom /cdrom

 
- Compaq Tru64 UNIX, Digital UNIX
# mount -t cdfs -r -o nodefperm,noversion,rrip /dev/rz4c /cdrom

 
Additional UNIX Systems
Example mount commands are given for additional UNIX operating systems below.

 
- DG AviiON Intel_Based Systems
# /etc/mount -t cdrom `/dev/pdsk/device_name’ /cdrom

 
- Hitachi 3050RX/3500 HI-UX/WE2
# mount /dev/cd14 /users/oracle/cdrom -t cdfs -o ro -R

 
- IBM NUMA-Q Dynix/PTX (formerly Sequent)
# /etc/mount -r -F cdfs /dev/dsk/cd1 /cdrom

 
- IBM RS/6000 SP Node
To mount a CD-ROM onto an RS/6000 SP node, perform the following:
1. Mount the CD-ROM on the control workstation:
cws# mkdir -p /cdrom
cws# mount -r -v cdrfs /dev/cd0 /cdrom

2. Make it exportable via NFS:
cws# mknfsexp -d /cdrom -t ro -N

3. Export the CD-ROM:
cws# exportfs -v -I -o ro /cdrom

4. Login to the node and mount the CD-ROM:
node# mkdir -p /nfs/cws/cdrom
node# mount CWS:/cdrom /nfs/cws/cdrom

 
- Fujitsu UXP/DS
# mount -F cdfs /dev/cd0 /CDROM

 
- NCR SVR4 UNIX
# /etc/mount -F cdfs -r -o reo ncrn,dperm=555 fperm=555 /dev/cdrom/cdrom1 cdrom

 
- NEC UX/4800
# mount -r -F cdfs device_name /cdrom

 
- SCO Unixware
# mount -F cdfs /dev/cdrom/c0b0t4l0 /cdrom

 
- Siemens Nixdorf/Siemens Pyramid
# mount -r -F hs /dev/ios0/sdisk0060 /cdrom

 
- Silicon Graphics IRIX
# mount -t iso9660 -o ro /dev/cdrom /cdrom

 
- Unisys U6000
# mkdir /olink
# chmod 777 /olink
# mount -F cdfs -r /dev/sc0 /cdrom
# cdmntsuppl -c -F ugo+rx /cdrom


Other Platforms
 

- Alpha OpenVMS
$ MOUNT /OVERRIDE=INDENTIFICATION ddcn
where
ddcn is a valid CD-ROM device name.

 
- Novell Netware
Read and follow the instructions in your Getting Started for Netware guide, available at http://docs.oracle.com

 
- Caldera eServer 2.3.1
mount /dev/cdrom /mnt/cdrom

Posted by dcmru
,

Ubuntu 32bit x86에서 안드로이드 소스 컴파일 시 http://source.android.com/download 에서 확인을 해보면 아래와 같은 패키지가 필요하다.

  • Required Packages:
    • Git 1.5.4 or newer and the GNU Privacy Guard.
    • JDK 5.0, update 12 or higher.  Java 6 is not supported, because of incompatibilities with @Override.
    • flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev (optional), build-essential, zip, curl.  
$ sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
  • You might also want Valgrind, a tool that will help you find memory leaks, stack corruption, array bounds overflows, etc. 
$ sudo apt-get install valgrind
  • Intrepid (8.10) users may need a newer version of libreadline:
$ sudo apt-get install lib32readline5-dev

하지만 기본 설정에서 apt-get install sun-java5-jdk 로는 설치가 되지 않는다. sun-java6-jdk 를 설치하여 make 해보았으나 역시나 Java 6 버전으로는 컴파일이 되지 않는다.

그러므로 apt-get 으로 sun-java5-jdk 설치를 하는 방법은 다음과 같다.

1. vi 로 /etc/apt/sources.list 를 열어 아래 내용을 추가 한다.
deb http://ko.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://ko.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse

2. apt-get install sun-java5-jdk

3. update-alternatives --config java 를 실행하여 java-1.5.0-sun 번호를 선택한다.

4. /<HOME>/.bash_profile에서 JAVA_HOME 환경 변수에 /usr/lib/jvm/java-1.5.0-sun 을 설정한다.

5. source /<HOME>/.bash_profile 또는 해당 계정 재로그인 후 make를 하면 에러 없이 컴파일되는 것을 볼 수 있다.
Posted by dcmru
,

회사에서 업무를 보고 있는데, 갑자기 아웃룩 2007로 메일이 500통이나 왔다.

황당해서 내용을 살펴보니 /etc/passwd의 내용을 긁어가기 위한 코드들이 메일 제목이나 메일 아이디 등에 적혀 있었다.

html 코드들도 보이는 것을 보니 /etc/passwd의 내용을 html로 만들어 공격자에게 보내주는 것 같았다.

메일 서버를 관리를 하고 있어서 계정들의 쉘을 모두 false로 설정해 놓은 상태였고, 관리를 위한 내 계정과 root 계정만이 쉘을 사용할 수 있었다.

아마도 쉘을 사용할 수 있는 내 계정을 통해 공격을 하였다.

어떤 툴을 이용하는 것 같았는데, 웹서비스를 하고 있는 아파치의 80 포트로 접속하여 대량의 메일을 보내는 공격이었다.

1시간내에 2000통의 메일을 받으니 사양이 좋지 않은 메일 서버도 버벅이기 시작하였다.

결국에 설치되어 있는 보안 제품으로 해당 IP를 막는 설정을 하니 더이상의 메일은 오지 않았다.

공격에 사용된 IP를 whois로 검색을 해보니 서울 소재의 서버인듯 했는데, 관리를 잘안하는 서버인가보다.

공격의 경유지로 사용이나 당하고 말이다.

결국 3시간 뒤에 스팸메일이 한 통 왔는데, 메일의 폼으로 보아 공격할 때의 메일 폼과 같았다.

정말 스팸에 이용하려는 의도였는지, 아니면 또다른 악성코드를 심어 놓아 광고 속 홈페이지 접속 시 설치가 되게 하려는 의도인지는 잘 모르겠다.

나름 공격을 당했으니 신고하려고, 신고 사이트에 접속하여 해킹 사유를 적고 스팸 메일을 캡쳐하여 첨부를 한 후 전달버튼을 눌렀으나

bmp로 캡쳐하여 파일 용량이 크다는 이유로 응답없음 화면을 보여주는 황당함에 뒤로가기 버튼을 누르니 내용은 다 날아가고 없었다.

다시 쓰기 귀찮아서 취소해버리고, 더이상의 공격기미가 보이지 않아 스팸메일을 지우고 일단락 지었다.

이번 공격을 통해 정상적이지 않은 공격을 막는 방법은 많이 있으나, 이번 경우와 같이 웹서비스를 하는 80번 포트로 접속하여 어떤 취약성을 이용한

정상적인 루트로 공격을 하는 방법은 막을 수 있는 방법이 많지 않은 듯 하다.

서버는 애정어린(?) 지속적인 모니터링과 패치를 통해 관리를 해주어야 할 듯 하다.

이번 기회에 서버 업그레이드와 MTA로 sendmail 말고 qmail을 사용해봐야겠다.
Posted by dcmru
,

개요
 업무적으로 여러 OS에서 PostgreSQL을 컴파일하여 사용하게 되면서, 정리의 필요성을 느껴 몇자 적어보려고 한다. 내용은 OS(AIX, HP-UX, Linux, Solaris, Unixware) 및 플랫폼(x86, x86_64, ia64, ppc, parisc, sparc)에 따른 PostgreSQL 설치 시 발생한 에러와 그에 대한 해결 및 configure와 make 등 옵션을 중점으로 기술한다. 소스 tar 를 풀기 전에 필요한 라이브러리(libreadline, libz 등)는 소스를 따로 받아 설치해둔다. 대부분의 소스는 configure, make, make install로 컴파일하여 설치하면 된다. OS별로 오픈소스 패키지들을 제공하는 사이트도 있으므로 OS별 에러부분의 글을 보고 설치하여도 된다. 의존성이 있는 라이브러리는 정적라이브러리를 사용하여 바이너리 안에 포함하도록 하였다. OS에 기본적으로 설치되어 있는 의존성 라이브러리는 find 로 찾아 컴파일 시 참조하지 않도록 하기위해 이름을 변경하거나 임시 디렉토리에 백업을 해둔 후 컴파일을 하였다. configure 시 기본포트를 변경하기 위해 --with-pgport=5432를 예로 기술하였으나 기술하지 않을 시 기본 포트인 5432가 사용된다. --enable-thread-safety 옵션 또한 주어야하는데, 이름에서 유추할 수 있듯이 PostgreSQL은 Muti-Thread 기반이 아닌 Prefork 방식으로서 각종 Client등에서 Muti-Thread 동작 접근 시의 안전성을 위한 것으로 각종 Cluster나 Pooler들은 Muti-Thread로 접근되어 추가를 요구한다. PostgreSQL 소스 컴파일 시 미리 PostgreSQL 을 구동하기 위한 계정과 그룹을 생성하여 소스는 /usr/local/pgsql_src 과 같이 디렉토리를 만들어 chown -R 옵션을 사용하여 하위디렉토리까지 소유자 및 소유 그룹을 PostgreSQL 계정으로 변경해둔다. tar 풀기, configure, make, make install 시 root가 아닌 PostgreSQL 전용 계정으로 su 하여 실행한다. root로는 make 자체가 실행되지 않는다. 이외에 각OS 벤더의 컴파일러를 사용하여 컴파일을 하면 컴파일이 되지만 바이너리가 구동이 되지 않는 현상이 있었다. 이때는 gcc를 설치하여 해결하였다. 그리고 make는 gmake를 사용하여야 한다.

1.
 PostgreSQL 수동
설치

1.1.  PostgreSQL 다운

먼저  http://www.postgresql.org/ftp/source/에서 최신버전의 PostgreSQL 을 적당한 장소에 다운받는다.

1.2.  기초 환경 설정
  ▪ 
postgres 그룹과 사용자를 생성한 후 비밀번호를 세팅한다. 그룹과 사용자 이름은 보안을 위해 dba와 postgres를 사용하지 않아도 된다.
    # groupadd dba
    # adduser -d /database/postgres -g dba -c "PostgreSQL Master User" -m -s /bin/bash postgres
    # passwd postgres

 
/usr/local/src/pgsql /usr/local/pgsql 디렉토리를 생성한 후 퍼미션을 바꾼다.
    # mkdir /usr/local/src/pgsql
    # chown postgres.dba /usr/local/src/pgsql
    # mkdir /usr/local/pgsql
    # chown postgres.dba /usr/local/pgsql

 
postgres 사용자로 “–“ 옵션을 주어 su 하거나 postgres 사용자로 로그인 한다.
    # su - postgres

  ▪
postgres 사용자로 다운받은 소스파일을 /usr/local/src/pgsql 디렉토리로 이동시킨 후 압축을 해제한다.
    $ mv postgresql-8.2.6.tar.gz /usr/local/src/pgsql
    $ cd /usr/local/src/pgsql
    $ tar xvfz postgresql-8.2.6.tar.gz

1.3.  PostgreSQL 설치

 
postgres 사용자로 압축을 푼 디렉토리로 이동한다.
    $ cd /usr/local/pgsql/postgresql-8.2.6

  ▪ 소스 컴파일을 위해 적당한 옵션을 주어 configure 를 실행한다. 옵션 설명은 --help 옵션을 사용하면 볼 수 있다.
    $ ./configure --prefix=/usr/local/pgsql \
                        --enable-thread-safety \
                        --enable-depend \
                        --enable-nls=ko \
                        --with-openssl \
                        --with-python \
                        --with-perl

    옵션은 다음과 같다
.

      
--prefix : 기본적으로 대부분의 소스가 ./configure make;make install을 하면 /usr/local 이나 특정위치로 설치된다. 그렇게 되면 추가 파티션 이동이나 프로그램 파일 백업 등에 에러사항이 발생한다. 이경우 유지보수,관리를 위해 prefix 를 이용해서 특정위치로 설치되게 지정해준다. PostgreSQL MakfeFile 에서는 uninstall 을 지원한다
     
--enable-integer-datetimes enable 64-bit integer date/time support : 64Bit 숫자,날짜,시간지원여부로 일반적으로는 필요하지 않다.
      --enable-nls[=LANGUAGES] : 시스템의 각종 출력 메세지에 대한 나라별 언어 지원으로 8.0 부터는 DSN PostgreSQL 에서도 한글 메세지와 에러로그를 볼 수 있다. 이 옵션은 복수 선택이 가능하며, 디폴트로 추후 선택하거나 상황에 따라 Database 별로 설정 가능하다.
        
지원 되는 NLS 종류 : http://developer.postgresql.org/~petere/nlsstatus/#t8.0-branch 
         
다중선택시 --enable-nls='ko de' 같이 설정합니다.
     
--disable-shared : PostgreSQL 컴파일 시 공유라이브러리와 함께 컴파일하지 않겠다는 부분으로 하지않으면 성능은 좀 향상될수 있으나 상황에 따라 에러가 발생하는 시스템이 많을 것으로 기본적으로 사용하지 않기를 권장한다.
      --enable-depend : 소스컴파일 시 의존성이 있는 파일이나 라이브러리에 대한 체크를 하는것으로 포함하지 않으면, 컴파일 속도는 다소 빨라지지만 현재의 주류 시스템에서는 체크를 해서 안전사용하는것도 좋은 예이다
    
--enable-thread-safety : PostgreSQL Muti-Thread 기반이 아니며, Prefork 방식으로서 각종 Client 등에서 Muti-Thread 동작 접근 시의 안전성을 위한것으로 각종 Cluster Pooler 들은 Muti-Thread 로 접근되어 추가를 요구하니 추가해준다. V8.0 부터는 디폴트값이다.
      --enable-thread-safety-force : --enable-thread-safety 를 추가 하였는데 Thread Safe Test 에서 에러가 발생하였지만 에러는 그냥 무시하고 컴파일 할 때 필요한것으로 에러가 발생하면 에러원인을 찾아 주는것니 오동작을 막을 수 있다.
     
--with-docdir=DIR
     
--without-docdir : Man Page 의 설치 관련 옵션으로 기본적으로 옵션을 주지 않으면 설치위치의 doc 디렉토리에 설치되지만 --without-docdir Man Page 설치를 하지 않거나 --with-docdir 를 사용하여 특정위치로 설치가 가능하다.
     
--with-pgport=PORTNUM : PostgreSQL의 기본 Service Port 5432 이나 만약에 외부에서 접근이 이루어지거나 하는 경우에는 변경을 해주는것이 좋다. 따로 설정파일에서도 변경이 가능하다.
     
--with-tcl
     
--with-tclconfig=DIR : Procedure Language TCL 을 사용 시 옵션추가, 따로 설치 위치는 주지 못하며, 자동 검색을 한다. 원할경우 소스수정이 이루어져야한다.
     
--with-perl : Procedure Language Perl 을 사용 시 옵션추가, 따로 설치 위치는 주지 못하며, 자동 검색을 한다. 원할경우 소스수정이 이루어져야한다.
     
--with-python : Procedure Language Python 를 사용 시 옵션추가, 따로 설치 위치는 주지 못하며, 자동 검색을 한다. 원할경우 소스수정이 이루어져야한다.
     
--with-krb4
     
--with-krb5 : Kerberos 를 통한 접속 인증 시스템 사용을 원할 때에 추가(버전에 따라 추가) 한다.
     
--with-pam : PAM(Pluggable Authentication Modules) 사용을 원할 때 추가한다.
     
--with-rendezvous : Apple Rendezvous 인증처리를 원할 때 추가한다.
     
--with-openssl : SSL 인증처리를 원할 때 추가한다.
     
--without-readline : Command History 기능을 사용하지 않을때 추가한다.
     
--without-zlib : Zlip 사용을 하지 않을 시 추가 (내부에서 압축관련 알고리즘이 필요) 한다.
     
--with-includes=DIRS : --with-openssl, --with-python 등 자동검색하는 항목이 있는데 이의경우 prefix 등으로 따로 설치하였거나 특정위치의 C Header 파일을 참조하게 하고 싶을 때 추가한다. ) --with-includes=/usr/local/ssl/include:/usr/local/python/include
     
--with-libraries=DIRS : --with-includes와 같이 Library 위치를 지정하고 싶을 때 사용한다. --with-includes, --with-libraries 로 설정하면 configure 단계에서 우선적으로 참조한다. ) --with-libraries=/usr/local/ssl/lib:/usr/local/python/lib 

  ▪
configure 가 에러없이 종료된 후 make 를 사용하여 설치한다.
    $ make; make check; make install

  ▪ 만약
root 사용자로 컴파일하여 설치하였다면, 아래 명령을 실행한다.
    # chown -R postgres:dba /usr/local/pgsql
    # cd /usr/local/pgsql
    # chown -R root lib include

1.4.  PostgreSQL 환경설정(Linux 기준)

 
root 사용자로 PostgreSQL 라이브러리의 컴파일 환경을 구성한다.
    # vi /etc/ld.so.conf
      ▫ 아래 내용을 추가한다.

/usr/local/pgsql/lib

    # ldconfig


  ▪ 또는
PostgreSQL 라이브러리를 사용한 응용프로그램의 컴파일 시점에 /usr/local/pgsql/lib LD_LIBRARY_PATH, LD_LIBPATH 등에 추가하여 사용하면 된다.
  
  ▪ root 사용자로 데이터베이스 파일이 저장될 디렉토리를 만든 후 postgres 의 소유로 바꾼다. 데이터베이스가 저장될 곳은 저장공간이 넉넉한 다른 경로에 만들어도 된다. 따로 만들지 않아도 아래에서 실행할 initdb에 -D 옵션으로 /usr/local/pgsql 경로를 주면 data 디렉토리가 만들어진다. 또는 링크로 다른 경로를 바꿔줄 수도 있고, postgresql.conf에서 다른 경로로 지정할 수도 있다.
    # /usr/local/pgsql/data
    # chown postgres.dba /usr/local/pgsql/data

 
postgres 사용자의 환경변수를 설정한다. bash, ksh, sh 쉘 사용자를 기준으로 설명한다
    # vi /home/postgres/.bash_profile
      ▫ 아래 내용을 추가한다.

PATH=$PATH:/usr/local/pgsql/bin

MANPATH=/usr/local/pgsql/man

PGLIB=/usr/local/pgsql/lib

PGDATA=/usr/local/pgsql/data

export PATH MANPATH PGLIB PGDATA

 
 
csh 쉘 사용자는 다음과 같이 환경변수를 설정한다.
    # vi /home/postgres/.cshrc
      ▫ 아래 내용을 추가한다.

setenv PATH $PATH:/usr/local/pgsql/bin

setenv MANPATH /usr/local/pgsql/man

setenv PGLIB /usr/local/pgsql/lib

setenv PGDATA /usr/local/pgsql/data

 
 
PostgreSQL 구동스크립트를 만들어 준 후 런레벨에 맞게 링크를 만들어준다. 순서는 OS 환경에 맞춰 설정한다.
    # vi /etc/rc.d/init.d/postgresql
      ▫ 아래 내용을 추가한다.

#!/bin/sh

 

# Script to start and stop PostgreSQL

 

SERVER=/usr/local/pgsql/bin/postmaster

PGCTL=/usr/local/pgsql/bin/pg_ctl

PGDATA=/usr/local/pgsql/data

OPTIONS=-i

LOGFILE=/usr/local/pgsql/data/postmaster.log

 

case "$1" in

        start)

                echo -n "Starting PostgreSQL..."

                su -l postgres -c "nohup $SERVER $OPTIONS -D $PGDATA >$LOGFILE 2>&1 &"

                ;;

        stop)

                echo -n "Stopping PostgreSQL..."

                su -l postgres -c "$PGCTL -D $PGDATA stop"

                ;;

        restart)

                echo -n "Stopping PostgreSQL..."

                su -l postgres -c "$PGCTL -D $PGDATA stop"

                echo -n "Starting PostgreSQL..."

                su -l postgres -c "nohup $SERVER $OPTIONS -D $PGDATA >$LOGFILE 2>&1 &"

                ;;

        *)

                echo "Usage : $0 {start|stop|restart}"

                exit 1

                ;;

esac

 

exit 0


      ▫ 리눅스를 기준으로 구동환경을 설정하는 방법은 다음과 같다
.
        # ln –s /etc/rc.d/init.d/postgresql /etc/rc.d/rc0.d/K25postgresql
        # ln –s /etc/rc.d/init.d/postgresql /etc/rc.d/rc1.d/K25postgresql
        # ln –s /etc/rc.d/init.d/postgresql /etc/rc.d/rc2.d/K25postgresql
        # ln –s /etc/rc.d/init.d/postgresql /etc/rc.d/rc3.d/K25postgresql
        # ln –s /etc/rc.d/init.d/postgresql /etc/rc.d/rc3.d/S25postgresql
        # ln –s /etc/rc.d/init.d/postgresql /etc/rc.d/rc5.d/K25postgresql
        # ln –s /etc/rc.d/init.d/postgresql /etc/rc.d/rc5.d/S25postgresql
        # ln –s /etc/rc.d/init.d/postgresql /etc/rc.d/rc6.d/K25postgresql

1.5.  PostgreSQL 구동

 
postgres 사용자로 로그인하여 initdb 명령어를 사용하여 데이터베이스 초기화를 한다. 인코딩을 지정해주려면 “--encoding=utf-8” 또는 “--encoding=euc-kr” 같은 옵션이 필요하고, 로케일을 지정하기 위해서는 “--locale=ko_kr” 또는 “--no-locale” 옵션 등이 필요하다.
    # initdb -E unicode --locale=ko_KR.UTF8 --lc-messages=C -A md5 -W –D /usr/local/pgsql
      ▫ 옵션 설명
        based on unicode (UTF8)
        locale: Korean unicode
        display message: english
        password encryption


      initdb
는 파일명에서도 알 수 있듯이 DB초기화 작업용 파일로 옵션은 다음과 같다.

-D : PostgreSQL 디비 생성 폴더위치로 현재 Shell에서 PGDATA로 설정한곳으로 자동으로 읽어오나 따로 설정하거나 추가적인 클러스터(디비환경)를 만들고 싶을때 지정하면 된다.

-E : PostgreSQL의 기본적인 입출력(소팅포함)관련 기본 Encoding Set을 정하는 것으로 한국의 경우는 EUC_KR로 설정할수가 있지만 EUC_KR시에는 아햏해,쑣 등은 입력이 불가능하게 되며, 메세지로 EUC_KR에서 지원되지 않는 문자셋이라고 뜨게 된다. 이런것을 미연에 방지하려면 UTF-8로 설정을 해야한다.

-A : 기본적인 인증 처리부분은 pg_hda.conf 설정 부분을 참고한다. trust (No Password),password(text) 등이다.

-U : 현재의 postgres계정이 아닌 다른 계정을 마스터 계정으로 쓸 때 사용한다.

-W : PostgreSQL은 기본적으로 마스터 계정에 대한 패스워드가 없다. 이옵션을 넣어 패스워드를 초기 설정가능하다.

--locale

--lc-collate : String sort order

--lc-ctype : Character classification (What is a letter? Its upper-case equivalent?)

--lc-messages : Language of messages

--lc-monetary : Formatting of currency amounts

--lc-numeric : Formatting of numbers

--lc-time=LOCALE : Formatting of dates and times

지역화 설정으로 기본적으로 System OS의 설정값으로 가져온다. 메세지나, 통화(), 숫자표현이나 날짜, 시간 등 각나라별(화폐표시 한국은 \ 3,000 , 미국은 $ 3,000 같은 형태) 성정을 말한다. 대부분 System OS설정기준을 기준으로 한다.


       주의
:
여기서 주의 해야 하는것은 한글 환경으로 셋팅이된 OS의 경우 COLLATE ko_KR.eucKR로 자동으로 잡히게 된다. 이 경우 한글 정렬이나 like연산시 index를 검색하지않고 full scan하는 문제가 있으며, glibc의 한글관련 문제로 아직은 패치가되지 않은 상태로 collate C Type로 잡아 주어야 한다. 현재로써는 위와 같은 방법으로 해야 한글환경에서 정상적인 작동이 가능하다. 최신 버전에는 개선이 되었는지 확인하지 못하였다.

 
▪ 외부에서 접속이 가능하게 하기위해 pg_hba.conf 를 수정한다. PostgreSQL 데몬이 구동중이라면 데몬을 재시작 할 필요는 없다.
    # vi /usr/local/pgsql/data/pg_hba.conf
      ▫ 아래 내용을 추가한다.

host    all         all         192.168.0.0/24        password

 
 
▪ 서버의 IP LISTEN 할 수 있게 IP Port 를 설정한다. listen_address='*'로 설정하면, 서버의 IP가 여러개일 때 모든 IP로 listen을 한다. PostgreSQL 데몬이 구동중이라면 데몬을 재시작해야한다. 기본 포트번호는 5432 이다.
    # vi /usr/local/pgsql/data/postgresql.conf
      ▫ 아래 내용을 변경한다.

listen_addresses = '192.168.0.97'

port = 5432


    
# /etc/rc.d/init.d/postgresql restart


  ▪
PostgreSQL 데몬이 구동중이지 않다면 데몬을 구동시킨다.
    # /etc/rc.d/init.d/postgresql start

 
 
▪ 데몬 확인
    # ps x

PID TTY STAT TIME COMMAND

20667 pts/2 S 0:00 -bash

27928 pts/2 S 0:00 /usr/local/pgsql/bin/postmaster

27930 pts/2 S 0:00 postgres: writer process

27931 pts/2 S 0:00 postgres: stats buffer process

27932 pts/2 S 0:00 postgres: stats collector process

      PostgreSQL의 감시 데몬 프로세스인 “postmaster” , 몇개의 postgres 프로세스가 기동하고 있는 것이 알 것이다. “stats buffer process””stats collector process” , PostgreSQL 7.2이후로 추가된, 퍼포먼스 정보 수집을 위한 프로세스이고, “writer” 는 지금 버젼으로 추가된 신기능으로, 더티 페이지를 조금씩 디스크에 써내, 디스크 액세스에 의한 지연을 가능한 한 평준화하는 책임을 다한다.

 
1.6.  
데이터베이스와 사용자 생성
 
  ▪
createuser 명령어를 사용하여 사용자를 생성한다. postgres는 임의의 이름이다. 아래와 같이 명령어를 이용할 수도 있고, psql로 DB에 접속하여 SQL문으로도 만들 수 있다.
    $ createuser --pwprompt --encrypted --no-adduser --no-createdb postgres


       옵션은 다음과 같다
.

-a, --adduser : 유저생성권한 부여함

-A, --no-adduser : 유저생성권한 부여않함

-d, --createdb : 디비생성권한 부여함

-D, --no-createdb : 디비생성권한 부여않함

-P, --pwprompt : 신규 패스워드 질문 프롬프트 띄우기

-E, --encrypted : 패스워드 암호화 (디폴트)

-N, --unencrypted : 패스워드 비암호화

-i, --sysid=SYSID : 내부 SysID (자동 부여되므로 불필요)

 

원격에 서버접속이나 상황에 따라쓰는 connection 옵션

-h, --host=HOSTNAME : 서버 HostName또는 IP , local은 불필요

-p, --port=PORT : 서버 Port

-U, --username=USERNAME : 접속 유저명(유저생성권한이 있어야함)

-W, --password : 접속 패스워명

 
 
createdb 명령어를 사용하여 데이터베이스를 생성한다. 마지막 데이터베이스명은 임의의 이름이다. 아래와 같이 명령어를 이용할 수도 있고, psql로 DB에 접속하여 SQL문으로도 만들 수 있다.
    $ createdb --encoding=UNICODE --owner=postgres testdb

 

옵션은 다음과 같다.

-D, --tablespace=TABLESPACE : 실제적인 데이터베이스의 저장 폴더(파티션)를 지정한 TableSpace 명을 지정하는것으로 Default PGDATA 디렉토리가 된다.

-E, --encoding=ENCODING : 데이터베이스의 인코딩으로 inidb 시의 ENCODING 에 대해보면 되고, 기본으로는 initdb 때 사용한 Encoding 을 따른다.

-O, --owner=OWNER : 데이터베이스의 Owner , 이 데이터베이스의 Master User

-T, --template=TEMPLATE : 템플릿 데이터베이스 선택, 즉 데이터베이스 생성 시 기본적으로 복사할 각종 자료를 만들어둔 데이터베이스를 지정하면 된다.

 

원격의 서버접속이나 상황에 따라쓰는 connection 옵션

-h, --host=HOSTNAME : 서버 HostName 또는 IP , local 은 불필요

-p, --port=PORT : 서버 Port

-U, --username=USERNAME : 접속 유저명(유저생성권한이 있어야함)
      
-W, --password : 접속 패스워명



2. Red Hat Linux release 7.2 (Enigma) 
  Redhat 계열 x86 플랫폼에 적용가능하며, x86 플랫폼의 상위버전에서 사용할 수 있다. 하위 버전에서 컴파일하여 상위 버전과 같이 쓰기 위해 Redhat 7.2에서 컴파일을 하였으며, 아래와 같은 에러들이 발생했었으며, 컴파일한 바이너리로 RHEL 5까지 사용가능함을 확인하였다.

configure를 실행하기 전에 LD_LIBRARY_PATH에 /usr/local/lib를 추가한다. export LD_LIBRARY_PATH=/usr/local/lib

libreadline 5.2 소스 컴파일하여 설치.
libz 1.2.3 소스 컴파일하여 설치.
libtermcap.a 는 디폴트로 설치되어 있는것 사용

./configure --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --enable-nls=ko --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib

2.1 8.2.6 소스에서는 아래 make 에러 발생

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -fno-strict-aliasing -pthread  -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -fpic -shared -Wl,-soname,libpq.so.5 -Wl,--version-script=exports.list  fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o fe-lobj.o fe-protocol2.o fe-protocol3.o pqexpbuffer.o pqsignal.o fe-secure.o md5.o ip.o wchar.o encnames.o noblock.o pgstrcasecmp.o thread.o strlcpy.o  -L../../../src/port -lssl -lcrypto -lcrypt -lpthread -Wl,-rpath,'/usr/local/redpgsql/lib' -o libpq.so.5.0
/usr/bin/ld:exports.list:1: parse error in VERSION script
collect2: ld returned 1 exit status
make[3]: *** [libpq.so.5.0] Error 1
make[3]: Leaving directory `/home/dckim/postgresql-8.2.6/src/interfaces/libpq'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/dckim/postgresql-8.2.6/src/interfaces'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/dckim/postgresql-8.2.6/src'
make: *** [all] Error 2

에러 해결을 위해 /home/dckim/postgresql-8.2.6/src/interfaces/libpq/Makefile 에서 아래와 같이 수정

#ifeq ($(PORTNAME), linux)
#$(shlib): exports.list

#exports.list: exports.txt
#       echo '{ global:' >$@
#       $(AWK) '/^[^#]/ {printf "%s;\n",$$1}' $< >>$@
#       echo ' local: *; };' >>$@

#exported_symbols_list = -Wl,--version-script=exports.list
#endif

2.2 소스 8.3.1에서도 8.2.6 소스와 같은 아래 에러 발생 

echo '{ global:' >exports.list
gawk '/^[^#]/ {printf "%s;\n",$1}' exports.txt >>exports.list
echo ' local: *; };' >>exports.list
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -fno-strict-aliasing -pthread  -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -fpic -shared -Wl,-soname,libpgtypes.so.3 -Wl,--version-script=exports.list  numeric.o datetime.o common.o dt_common.o timestamp.o interval.o pgstrcasecmp.o   -L../../../../src/port -L/usr/local/lib -lm -Wl,-rpath,'/usr/local/secpgsql/lib' -o libpgtypes.so.3.0
/usr/bin/ld:exports.list:1: parse error in VERSION script
collect2: ld returned 1 exit status
make[4]: *** [libpgtypes.so.3.0] Error 1
make[4]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/interfaces/ecpg/pgtypeslib'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/interfaces/ecpg'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/interfaces'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src'
make: *** [all] Error 2

에러 해결을 위해 /usr/local/pgsql_src/postgresql-8.3.1/src/interfaces/ecpg/pgtypeslib/Makefile 에서 아래와 같이 수정

#ifeq ($(PORTNAME), linux)
#$(shlib): exports.list

#exports.list: exports.txt
#       echo '{ global:' >$@
#       $(AWK) '/^[^#]/ {printf "%s;\n",$$1}' $< >>$@
#       echo ' local: *; };' >>$@

#exported_symbols_list = -Wl,--version-script=exports.list
#endif

2.3 소스 8.3.1에서 아래 에러 발생 

echo '{ global:' >exports.list
gawk '/^[^#]/ {printf "%s;\n",$1}' exports.txt >>exports.list
echo ' local: *; };' >>exports.list
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -fno-strict-aliasing -pthread  -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -fpic -shared -Wl,-soname,libecpg.so.6 -Wl,--version-script=exports.list  execute.o typename.o descriptor.o data.o error.o prepare.o memory.o connect.o misc.o path.o pgstrcasecmp.o strlcpy.o thread.o -L../pgtypeslib -L../../../../src/interfaces/libpq -L../../../../src/port -L/usr/local/lib -lpgtypes -lpq -lm -lpthread -Wl,-rpath,'/usr/local/secpgsql/lib' -o libecpg.so.6.0
/usr/bin/ld:exports.list:1: parse error in VERSION script
collect2: ld returned 1 exit status
make[4]: *** [libecpg.so.6.0] Error 1
make[4]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/interfaces/ecpg/ecpglib'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/interfaces/ecpg'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/interfaces'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src'
make: *** [all] Error 2

에러 해결을 위해 /usr/local/pgsql_src/postgresql-8.3.1/src/interfaces/ecpg/ecpglib/Makefile 에서 수정

#ifeq ($(PORTNAME), linux)
#$(shlib): exports.list

#exports.list: exports.txt
#       echo '{ global:' >$@
#       $(AWK) '/^[^#]/ {printf "%s;\n",$$1}' $< >>$@
#       echo ' local: *; };' >>$@

#exported_symbols_list = -Wl,--version-script=exports.list
#endif

2.4 소스 8.3.1에서 아래 에러 발생 

echo '{ global:' >exports.list
gawk '/^[^#]/ {printf "%s;\n",$1}' exports.txt >>exports.list
echo ' local: *; };' >>exports.list
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -fno-strict-aliasing -pthread  -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -fpic -shared -Wl,-soname,libecpg_compat.so.3 -Wl,--version-script=exports.list  informix.o  -L../ecpglib -L../pgtypeslib -L../../../../src/interfaces/libpq -L../../../../src/port -L/usr/local/lib -lecpg -lpgtypes -lpq -lm -lpthread -Wl,-rpath,'/usr/local/secpgsql/lib' -o libecpg_compat.so.3.0
/usr/bin/ld:exports.list:1: parse error in VERSION script
collect2: ld returned 1 exit status
make[4]: *** [libecpg_compat.so.3.0] Error 1
make[4]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/interfaces/ecpg/compatlib'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/interfaces/ecpg'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/interfaces'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src'
make: *** [all] Error 2

에러 해결을 위해 /usr/local/pgsql_src/postgresql-8.3.1/src/interfaces/ecpg/compatlib/Makefile 에서 수정

#ifeq ($(PORTNAME), linux)
#$(shlib): exports.list

#exports.list: exports.txt
#       echo '{ global:' >$@
#       $(AWK) '/^[^#]/ {printf "%s;\n",$$1}' $< >>$@
#       echo ' local: *; };' >>$@

#exported_symbols_list = -Wl,--version-script=exports.list
#endif


3.  RHAS 4.0  : x86_64

/usr/include 의 readline, zconf.h, zlib.h 백업 후 패키지함. 패키지 후 복원
/usr/lib 의 libreadline.so.4, libreadline.so.4.3, libz.a, libz.so, libz.so.1, libz.so.1.2.1.2 백업 후 패키지 후 복원

libreadline 5.2 소스 설치함.
libz 1.2.3 소스 설치함.
libtermcap.so 는 /lib64/libtermcap.so 사용함.

export LD_LIBRARY_PATH=/usr/local/lib

./configure --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --enable-nls=ko --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib


4. RHAS 4.0 : ia64

[root@AS40 pgsql_src]# ls -al /usr/lib/libtermcap.*
-rw-r--r--  1 root root 25804 Jun 16  2004 /usr/lib/libtermcap.a
lrwxrwxrwx  1 root root    29 May  9  2007 /usr/lib/libtermcap.so -> ../../lib/libtermcap.so.2.0.8
[root@AS40 pgsql_src]# ls -al /usr/lib/libreadline*
-rw-r--r--  1 root root 613340 Sep  3  2004 /usr/lib/libreadline.a
lrwxrwxrwx  1 root root     18 May  9  2007 /usr/lib/libreadline.so -> libreadline.so.4.3
lrwxrwxrwx  1 root root     18 May  9  2007 /usr/lib/libreadline.so.4 -> libreadline.so.4.3
-rwxr-xr-x  1 root root 400032 Sep  3  2004 /usr/lib/libreadline.so.4.3
[root@AS40 pgsql_src]# ls -al /usr/lib/libz.*
-rwxr-xr-x  1 root root 158838 Sep 13  2004 /usr/lib/libz.a
lrwxrwxrwx  1 root root     15 May  9  2007 /usr/lib/libz.so -> libz.so.1.2.1.2
lrwxrwxrwx  1 root root     15 May  9  2007 /usr/lib/libz.so.1 -> libz.so.1.2.1.2
-rwxr-xr-x  1 root root 135256 Sep 13  2004 /usr/lib/libz.so.1.2.1.2

/usr/include 의 readline, zconf.h, zlib.h, zutil.h 파일 백업 후 패키지 후 복원
/usr/lib 의 libreadline.so, libreadline.so.4, libreadline.so.4.3, libtermcap.so, libz.a, libz.so, libz.so.1, libz.so.1.2.1.2 파일 백업 후 패키지 후 복원

libreadline 5.2 소스 커파일 설치 : /usr/local/lib 의 libreadline.so  libreadline.so.5  libreadline.so.5.2 백업 후 패키지 후 복원
zlib 1.2.3 소스컴파일 설치 : 정적라이브러리만 설치됨.

./configure --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --enable-nls=ko --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib


5. AIX 4.3.3
  AIX의 의존성 패키지는 아래 사이트에서 다운받을 수 있다.
http://www.bullfreeware.com
http://www-03.ibm.com/systems/power/software/aix/linux/index.html


readline 5.2 소스설치
GNU make 설치
bison : 패키지 버전이 낮아 삭제함.
flex
xlc 를 사용하여 컴파일한 바이너리로는 구동이 되지 않아 gcc  3.3 설치하여 컴파일함
PostgreSQL 유저의 디렉토리를 만든후 tar 푼 후 PATH(cc 및 /usr/local/bin 추가)에 root 와 같게 환경설정
zlib 1.1.4 로 새로 설치함. 동적 라이브러리는 패키지시 리네임한 후 패키지함.
readline 5.2 로 소스설치함. 패키지 한 후 삭제함.
libtermcap.a 설치안되어 있고, 패키지 없어서 설치안함.(패키지가 알아서 /usr/lib/libcurses.a 로 사용함.)

export PATH=$PATH:/usr/local/bin:/usr/vac/bin
PATH=/informix/IDS/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb://bin:/usr/bin/X11:/sbin:/usr/vac/bin:.:/usr/local/bin
export LD_LIBRARY_PATH=$LD_LIBRARY:/usr/local/lib

./configure CC=gcc --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib


6. AIX 5.1

export PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java130/jre/bin:/usr/java130/bin:/usr/vac/bin:/usr/local/bin
export LD_LIBRARY_PATH=/usr/local/lib

xlc 사용
GNU make
flex
bison : 패키지 버전이 낮아 삭제함.
readline 5.2 소스컴파일 설치(정적라이브러리 사용)
zlib 1.2.3 소스컴파일 설치 후 패키지 후 삭제함.

./configure CC=cc --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib


7. AIX 5.2

gcc 사용(설치되어 있었음)
gettext-0.10.40-8.aix5.2.ppc.rpm
bison-1.875-3.aix5.1.ppc.rpm
gzip-1.2.4a-10.aix5.2.ppc.rpm
flex-2.5.4a-6.aix4.3.ppc.rpm
zlib-1.2.3-4.aix5.2.ppc.rpm ; 설치하였는데, rpm 명령어에 의존적이라 삭제안됨. 패키지 만들 때 /opt/freeware/lib/libz.a 를 참조하지 않게 리네임 하여 백업 후 패키지함.
readline 5.2소스컴파일 설치(정적라이브러리 사용)
zlib 1.2.3 소스컴파일 설치(정적라이브러리 사용)

/usr/lib 의 libz.a -> ../../opt/freeware/lib/libz.a 백업 후 패키지 후 복원

export PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java131/jre/bin:/usr/java131/bin:/usr/vac/bin:/usr/local/bin
export LD_LIBRARY_PATH=/usr/local/lib

./configure CC=gcc --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib


8. AIX 5.3

xlc 사용
make-3.80-1.aix5.1.ppc.rpm
bison-1.875-3.aix5.1.ppc.rpm
gettext-0.10.40-8.aix5.2.ppc.rpm
flex-2.5.4a-6.aix4.3.ppc.rpm
zlib 1.2.3 소스컴파일 설치 후 패키지 한 후 삭제함. /opt/freeware/lib/libz.a 리네임 후 패키지한 후 복구.
readline 5.2 소스컴파일 설치 후 패키지 한 후 삭제함.

/opt/freeware/bin 의 명령어들이 모두 /usr/bin 에 링크가 되어 있음.

export PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin:/usr/java131/jre/bin:/usr/java131/bin:/usr/vac/bin:/usr/local/bin
export LD_LIBRARY_PATH=/usr/local/lib

./configure CC=cc --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib

5300-03 미만 버전은 /usr/include/sys/socket.h 의  _SS_MAXSIZE 를 1280 으로 고친 후 컴파일해야함. 수정하지 않을 시 PostgreSQL 구동이 안된다. AIX 버그이다.


9. AIX 6.1

xlc 사용
make-3.80-1.aix5.1.ppc.rpm
bison-1.875-3.aix5.1.ppc.rpm
gettext-0.10.40-8.aix5.2.ppc.rpm
flex-2.5.4a-6.aix4.3.ppc.rpm
zlib 1.2.3 소스컴파일 설치 후 패키지 한 후 삭제함. /opt/freeware/lib/libz.a 리네임 후 패키지한 후 복구.
readline 5.2 소스컴파일 설치 후 패키지 한 후 삭제함.

/opt/freeware/bin 의 명령어들이 모두 /usr/bin 에 링크가 되어 있음.

export PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java5/jre/bin:/usr/java5/bin:/usr/vac/bin
export LD_LIBRARY_PATH=/usr/local/lib

./configure CC=cc --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib


10. HP-UX 11.00  
  HP-UX 의존성 패키지는 http://hpux.cs.utah.edu 에서 다운 받을 수 있었는데, 링크 확인겸 재방문을 해보니 시스템 고장으로 지금은 다운을 받을 수가 없다고 한다.

/usr/local/libtermcap.a : 정적라이브러리
gettext-0.14.1-sd-11.00.depot : 설치되어 있었음
make-3.80-sd-11.00.depot : 패키지 설치
libiconv-1.9.2-sd-11.00.depot : 설치되어 있었음
snprintf-2.2-src-11.11.tar : 소스설치
readline-5.2.tar  : 소스설치

export PATH=$PATH:/usr/local/bin
export LD_LIBRARY_PATH=/usr/local/lib

./configure CC=cc CFLAGS=+DAportable --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib


11. HP-UX 11.11  

/usr/local/libtermcap.a : 정적라이브러리
/usr/local/lib 의 libreadline.sl 과 libz.sl 리네임 후 패키지 함.
bison-2.3-hppa-11.11.depot
flex-2.5.35-hppa-11.11.depot
gettext-0.17-hppa-11.11.depot
libiconv-1.12-hppa-11.11.depot
make-3.81-hppa-11.11.depot
readline-5.2-hppa-11.11.depot
zlib-1.2.3-hppa-11.11.depot

export PATH=$PATH:/usr/local/bin
export LD_LIBRARY_PATH=/usr/local/lib

./configure CC=cc CFLAGS=+DAportable LDFLAGS="-L/usr/lib -lpthread" --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib


12. HP-UX 11.23 ia64 

libtermcap은 정적라이브러리로 패키지함.
/usr/local/lib/hpux32 밑의 libtermcap.so, libreadline.so, libz.so 리네임 후 패키지함.
readline-5.2-ia64-11.23.depot.gz 설치

export PATH=$PATH:/usr/local/bin
export LD_LIBRARY_PATH=/usr/local/lib/hpux32

12.1 configure 시 아래 에러 발생

ld: (Warning) Unsatisfied symbol "__divdi3" in file /usr/lib/hpux32/libncurses.so
ld: (Warning) Unsatisfied symbol "__divdf3" in file /usr/lib/hpux32/libncurses.so
ld: (Warning) Unsatisfied symbol "__moddi3" in file /usr/lib/hpux32/libncurses.so

/usr/lib/hpux32/dld.so: Unable to find library 'libintl.so'

gettext 최신버전으로 재설치

12.2 gcc 실행 시 아래 에러 발생

[u@h W]$gcc
/usr/lib/hpux32/dld.so: Unsatisfied code symbol 'pthread_create' in load module '/usr/local/lib/hpux32/libintl.so'.
Killed
3 warnings.

ld: (Warning) Potential unresolved symbol "__divdi3":
shared library reference is resolved to non-exported
definition in file "/opt/hp-gcc-4.1.2/lib/gcc/ia64-hp-hpux11.23/4.1.2/libgcc.a[__divdi3.o]".
ld: (Warning) Potential unresolved symbol "__divdf3":
shared library reference is resolved to non-exported
definition in file "/opt/hp-gcc-4.1.2/lib/gcc/ia64-hp-hpux11.23/4.1.2/libgcc.a[__divdf3.o]".
ld: (Warning) Potential unresolved symbol "__moddi3":
shared library reference is resolved to non-exported
definition in file "/opt/hp-gcc-4.1.2/lib/gcc/ia64-hp-hpux11.23/4.1.2/libgcc.a[__moddi3.o]".
3 warnings.

gcc-ia64-4.1.2.depot.gz 설치로 해결

12.3 make 시 아래 에러 발생

gmake[5]: Entering directory `/usr/local/pgsql_src/postgresql-8.2.6/src/interfaces/ecpg/test/connect'
sed -e 's,@TEMP_PORT@,511106,g' \
  test1.pgc.in >test1.pgc
../../preproc/ecpg -I./../../include -o test1.c -I. test1.pgc
/usr/lib/hpux32/dld.so: Unable to find library 'libreadline.so'.
gmake[5]: *** [test1.c] Killed
gmake[5]: Leaving directory `/usr/local/pgsql_src/postgresql-8.2.6/src/interfaces/ecpg/test/connect'
gmake[4]: *** [all] Error 2
gmake[4]: Leaving directory `/usr/local/pgsql_src/postgresql-8.2.6/src/interfaces/ecpg/test'
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory `/usr/local/pgsql_src/postgresql-8.2.6/src/interfaces/ecpg'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/usr/local/pgsql_src/postgresql-8.2.6/src/interfaces'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/usr/local/pgsql_src/postgresql-8.2.6/src'
gmake: *** [all] Error 2

export LD_LIBRARY_PATH=/usr/local/lib/hpux32 로 해결, configure 하기전에 export 해야한다.

./configure CC=gcc LDFLAGS="-L/usr/lib -lpthread" --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib/hpux32


13. HP-UX 11.31 ia64 

libtermcap 정적라이브러리로 재패키지함.
readline-5.2-ia64-11.31.depot.gz
zlib-1.2.3-ia64-11.31.depot.gz
termcap-1.3.1-ia64-11.31.depot
bison-2.3-ia64-11.31.depot
flex-2.5.33-ia64-11.31.depot
gcc-4.1.2-ia64-11.31.depot

export PATH=$PATH:/usr/local/bin
export LD_LIBRARY_PATH=/usr/local/lib/hpux32

13.1 initdb 실행 시 아래 에러 발생

$ initdb -E UTF-8 --no-locale -A trust -W -D /usr/local/pgsql/data
/usr/lib/hpux32/dld.so: Unable to find library 'libtermcap.so'.   

export LD_LIBRARY_PATH=/usr/local/lib/hpux32 로 해결, 기본적으로 OS에 포함되는 라이브러리로 보임며, configure 하기전에 export도 해야함.

./configure CC=gcc LDFLAGS="-L/usr/lib -lpthread" --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib/hpux32


14. HP-UX 11.31 PA-RISC

/usr/lib/libtermcap.a 가 기본으로 있고, /usr/local/lib/hpux32 에도 있으나 /usr/lib 의 정적라이브러리가 사용됨.
make-3.81-hppa-11.31.depot : 설치되어 있었음
gcc-4.2.1-hppa-11.31.depot : 설치되어 있었음
gettext-0.16.1-hppa-11.31.depot : 설치되어 있었음
readline-5.2-hppa-11.31.depot
bison-2.3-hppa-11.31.depot
libiconv-1.11-hppa-11.31.depot : 설치되어 있었음
termcap-1.3.1-hppa-11.31.depot : 설치되어 있었음
flex-2.5.35-hppa-11.31.depot
zlib-1.2.3-hppa-11.31.depot

export PATH=$PATH:/usr/local/bin
export LD_LIBRARY_PATH=/usr/local/lib

14.1 make 시 에러 발생

gcc V4.1.2 설치로 컴파일 에러 해결 : cc로 컴파일 시 알 수 없는 에러 발생, 에러내용 백업해두지 않았음

./configure CC=gcc --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib


15. HP-UX 11.23 PA-RISC

/usr/lib/libtermcap.a 가 기본으로 있음.
bison-2.3-hppa-11.23.depot
flex-2.5.35-hppa-11.23.depot
readline-5.2-hppa-11.23.depot

export PATH=$PATH:/usr/local/bin
export LD_LIBRARY_PATH=/usr/local/lib

./configure CC=gcc --prefix=/usr/local/secpgsql --enable-thread-safety --enable-depend --with-pgport=11106 --with-includes=/usr/local/include --with-libraries=/usr/local/lib

15.1 PostgreSQL V8.3.1 소스를 gcc V4.2.2로 컴파일 시 에러 발생

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv -Wno-error -pthread  -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS -I../include -I../../../../src/interfaces/ecpg/include -I. -DMAJOR_VERSION=4 -DMINOR_VERSION=4 -DPATCHLEVEL=0 -I../../../../src/include -D_XOPEN_SOURCE_EXTENDED  -I/usr/local/include  -c -o preproc.o preproc.c -MMD -MP -MF .deps/preproc.Po
pgc.c:3862: warning: 'yy_flex_realloc' defined but not used
y.tab.c: In function 'base_yyparse':
y.tab.c:32385: internal compiler error: in delete_output_reload, at reload1.c:7932
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
gmake[4]: *** [preproc.o] Error 1
gmake[4]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/interfaces/ecpg/preproc'
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/interfaces/ecpg'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/interfaces'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src'
gmake: *** [all] Error 2

15.2 cc로 컴파일 시 아래 에러 발생

./configure CC=cc --prefix=/usr/local/secpgsql --enable-thread-safety --enable-depend --with-pgport=11106 --with-includes=/usr/local/include --with-libraries=/usr/local/lib

cc -Ae +O2 -I../../../../src/include -D_XOPEN_SOURCE_EXTENDED  -I/usr/local/include  -c -o elog.o elog.c
cc: error 1405: "/opt/ansic/lbin/ccom" terminated abnormally with signal 11.
gmake[4]: *** [elog.o] Error 9
gmake[4]: *** Deleting file `elog.o'
gmake[4]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/backend/utils/error'
gmake[3]: *** [error-recursive] Error 2
gmake[3]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/backend/utils'
gmake[2]: *** [utils-recursive] Error 2
gmake[2]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/backend'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src'
gmake: *** [all] Error 2

14.2, 14.2 gcc 4.1.2로 설치하여 해결


16. Solaris 6 sparc

솔라리스 의존성 패키지는 http://www.sunfreeware.com 에서 다운받을 수 있다.

gettext-0.14.1-sol26-sparc-local
readline-5.2-sol26-sparc-local
termcap-1.3-sol26-sparc-local
zlib-1.2.3-sol26-sparc-local : 버전이 낮아 재설치
make-3.81-sol26-sparc-local

setenv PATH /bin:/usr/bin:/opt/SUNWspro/SC5.0/bin:/usr/local/bin:/usr/local/sbin:/usr/ccs/bin:/usr/ucb:/usr/sbin:/etc:.
setenv LD_LIBRARY_PATH /usr/lib:/usr/local/lib

Makefile.global 파일의 LIBS 에 -lnsl 추가해야 컴파일 된다.

16.1 make 무한루프

find ./소스디렉토리 -print | xargs touch 로 소스 디렉토리 시간 맞춰준다.

16.2 initdb 실행 시 아래 에러 발생

./initdb -E UTF-8 --no-locale -A trust -W -D /usr/local/secpgsql/data
The files belonging to this database system will be owned by user "secdb".
This user must also own the server process.

The database cluster will be initialized with locale C.

creating directory /usr/local/secpgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 10
selecting default shared_buffers/max_fsm_pages ... 400kB/20000
creating configuration files ... ok
creating template1 database in /usr/local/secpgsql/data/base/1 ... FATAL:  could not create shared memory segment: Invalid argument
DETAIL:  Failed system call was shmget(key=1, size=1662976, 03600).
HINT:  This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter.  You can either reduce the request size or reconfigure the kernel with larger SHMMAX.  To reduce the request size (currently 1662976 bytes), reduce PostgreSQL's shared_buffers parameter (currently 50) and/or its max_connections parameter (currently 10).
        If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
        The PostgreSQL documentation contains more information about shared memory configuration.
child process exited with exit code 1
initdb: removing data directory "/usr/local/secpgsql/data"

아래와 같이 /etc/system 파일에 공유메모리 설정을 해주어야함. 설정변경 후 서버 재부팅해야 적용됨. Solaris 6, 7, 8은 /etc/system 설정해주어야 initdb 실행됨.

Solaris
At least in version 2.6, the default maximum size of a shared memory segments is too low for PostgreSQL.
The relevant settings can be changed in /etc/system, for example:

set shmsys:shminfo_shmmax=0x2000000
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=256
set shmsys:shminfo_shmseg=256
set semsys:seminfo_semmap=256
set semsys:seminfo_semmni=512
set semsys:seminfo_semmns=512
set semsys:seminfo_semmsl=32

You need to reboot for the changes to take effect.
See also http://sunsite.uakom.sk/sunworldonline/swol-09-1997/swol-09-insidesolaris.html for information
on shared memory under Solaris.

/etc/system 을 /etc/system.orig 로 백업해둠.

setenv PATH "/usr/local/secpgsql/bin:$PATH"
setenv LD_LIBRARY_PATH "/usr/local/secpgsql/lib:$LD_LIBRARY_PATH"

/etc/system 설정 변경 후 initdb 시 내용

selecting default max_connections ... 100
selecting default shared_buffers/max_fsm_pages ... 24MB/153600

./configure CC=cc LDFLAGS="-L/usr/lib -lpthread -lnsl" --prefix=/usr/local/pgsql --enable-depend --enable-thread-safety --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib


17. Solaris 7 sparc

expat-2.0.1-sol7-sparc-local
gettext-0.14.1-sol7-sparc-local
make-3.81-sol7-sparc-local
readline-5.2-sol7-sparc-local

/usr/lib/libtermcap.so* 를 리네임. 패키지 후 복구함.

setenv PATH /bin:/usr/bin:/opt/SUNWspro/bin:/opt/SUNWspro/SC5.0/bin:/usr/ccs/bin:/usr/local/sbin:/usr/local/bin:/usr/local/webtob/bin:/usr/ucb:/usr/sbin:/etc:.
setenv LD_LIBRARY_PATH /usr/lib:/usr/local/lib

./configure CC=cc LDFLAGS="-L/usr/lib -lpthread -lnsl" --prefix=/usr/local/secpgsql --enable-depend --enable-thread-safety --with-pgport=11106 --with-includes=/usr/local/include --with-libraries=/usr/local/lib

17.1 configure 시에 thread safe 에러가 나는데, --with-libraries=/usr/local/lib 추가해줌

make[3]: Leaving directory `/usr/local/pgsql_src/postgresql-8.2.6/src/timezone'
cc -Xa -v -DSUNOS4_CC -O -L../../src/port -L/usr/local/lib -Wl,-R'/usr/local/secpgsql/lib'  access/SUBSYS.o bootstrap/SUBSYS.o catalog/SUBSYS.o parser/SUBSYS.o commands/SUBSYS.o executor/SUBSYS.o lib/SUBSYS.o libpq/SUBSYS.o main/SUBSYS.o nodes/SUBSYS.o optimizer/SUBSYS.o port/SUBSYS.o postmaster/SUBSYS.o regex/SUBSYS.o rewrite/SUBSYS.o storage/SUBSYS.o tcop/SUBSYS.o utils/SUBSYS.o ../../src/timezone/SUBSYS.o ../../src/port/libpgport_srv.a -lrt -lsocket -ldl -lm -o postgres
Undefined                       first referenced
 symbol                             in file
gethostbyname                       ../../src/port/libpgport_srv.a(getaddrinfo_srv.o)  (symbol belongs to implicit dependency /usr/lib/libnsl.so.1)
h_errno                             ../../src/port/libpgport_srv.a(getaddrinfo_srv.o)  (symbol belongs to implicit dependency /usr/lib/libnsl.so.1)
inet_ntoa                           ../../src/port/libpgport_srv.a(getaddrinfo_srv.o)  (symbol belongs to implicit dependency /usr/lib/libnsl.so.1)
ld: fatal: Symbol referencing errors. No output written to postgres
make[2]: *** [postgres] Error 1
make[2]: Leaving directory `/usr/local/pgsql_src/postgresql-8.2.6/src/backend'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/pgsql_src/postgresql-8.2.6/src'
make: *** [all] Error 2  

해결을 위해 Makefile.global 파일에 -lnsl 추가 : LIBS = -lz -lreadline -ltermcap -lrt -lsocket -ldl -lm -lnsl

./initdb -E UTF-8 --no-locale -A trust -W -D /usr/local/secpgsql/data
The files belonging to this database system will be owned by user "secdb".
This user must also own the server process.

The database cluster will be initialized with locale C.

creating directory /usr/local/secpgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 10
selecting default shared_buffers/max_fsm_pages ... 400kB/20000
creating configuration files ... ok
creating template1 database in /usr/local/secpgsql/data/base/1 ... FATAL:  could not create shared memory segment: Invalid argument
DETAIL:  Failed system call was shmget(key=1, size=1662976, 03600).
HINT:  This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter.  You can either reduce the request size or reconfigure the kernel with larger SHMMAX.  To reduce the request size (currently 1662976 bytes), reduce PostgreSQL's shared_buffers parameter (currently 50) and/or its max_connections parameter (currently 10).
        If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
        The PostgreSQL documentation contains more information about shared memory configuration.
child process exited with exit code 1
initdb: removing data directory "/usr/local/secpgsql/data"


/etc/system 에 아래내용추가 후 리부팅

set shmsys:shminfo_shmmax=0x2000000
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=256
set shmsys:shminfo_shmseg=256
set semsys:seminfo_semmap=256
set semsys:seminfo_semmni=512
set semsys:seminfo_semmns=512
set semsys:seminfo_semmsl=32


18. Solaris 8 sparc

/usr/lib/libtermcap.so, /usr/lib/libtermcap.so.1 이 기본으로 있음.(리네임 후 패키지 후 복구)
/usr/lib 의 libtermcap.so, libtermcap.so.1, libz.so, libz.so.1, libz.so.1.tar 백업 후 패키지 후 복구
/usr/include 의 zconf.h  zlib.h 백업 후 패키지 후 복구
expat-2.0.1-sol8-sparc-local
gettext-0.14.1-sol8-sparc-local
zlib-1.2.3-sol8-sparc-local : 동적라이브러리는 리네임 후 사용함.
readline-5.2-sol8-sparc-local : 동적라이브러리는 리네임 후 사용함.
termcap-1.3-sol8-sparc-local : 정적라이브러리만 설치됨.

setenv PATH /bin:/usr/bin:/data/SS11/SUNWspro/bin/:/DATA/Crash_Scat/SUNWscat/bin:/usr/ccs/bin:/usr/ucb:/usr/sbin:/etc:/usr/local/bin:/data/informix:/bin
setenv LD_LIBRARY_PATH /usr/lib:/usr/local/lib

./configure CC=cc --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib


19. Solaris 9 sparc

autoconf-2.62-sol9-sparc-local
gettext-0.14.1-sol9-sparc-local
make-3.81-sol9-sparc-local
readline-5.2-sol9-sparc-local
bison-2.3-sol9-sparc-local
libiconv-1.11-sol9-sparc-local
zlib-1.2.3-sol9-sparc-local
expat-2.0.1-sol9-sparc-local
libintl-3.4.0-sol9-sparc-local
flex-2.5.35-sol9-sparc-local
m4-1.4.10-sol9-sparc-local

/usr/lib 의 libtermcap.so, libtermcap.so.1, libz.so, libz.so.1 백업 후 패키지 후 복구, /usr/lib/libtermcap.a 가 있음
/usr/include 의 zconf.h  zlib.h 백업 후 패키지 후 복구
/usr/local/lib 의 libreadline.so, libreadline.so.4, libreadline.so.5, libz.so, libz.so.1, libz.so.1.2.3 백업 후 패키지 후 복구

setenv PATH /bin:/usr/bin:/DATA/SUNWspro/bin:/opt/SUNWscat/bin:/usr/ccs/bin:/usr/ucb:/usr/sbin:/etc:/usr/local/bin
setenv LD_LIBRARY_PATH /usr/lib:/usr/local/lib

./configure CC=cc --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib

/etc/system 기본 내용으로 실행됨. (별다른 설정이 없음.)

initdb 시 내용: 기본설정으로 pgsql 구동됨.
selecting default max_connections ... 40
selecting default shared_buffers/max_fsm_pages ... 5600kB/20000


20. Solaris 10 sparc

expat-2.0.1-sol10-sparc-local
readline-5.2-sol10-sparc-local
zlib-1.2.3-sol10-sparc-local

/usr/lib 의 libz.so, libz.so.1 백업 후 패키지 후 복원
/usr/include 의 zlib.h, zconf.h 백업 후 패키지 후 복원
/usr/lib/libtermcap.so 와 libtermcap.so.1 이 있고, libtermcap.a 는 없음.(명령어 실행 시 물고올라감. libcurses.so.1 =>  /usr/lib/libcurses.so.1)

setenv LD_LIBRARY_PATH /usr/lib:/usr/local/lib
setenv PATH /bin:/usr/bin:/opt/SUNWspro/SC5.0/bin:/usr/ccs/bin:/usr/ucb:/usr/sbin:/etc:/usr/local/bin

./configure CC=cc --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib

initdb 시 내용

selecting default max_connections ... 100
selecting default shared_buffers/max_fsm_pages ... 32MB/204800


21. Solaris 10, Solaris 9 x86

setenv PATH /usr/local/bin:/bin:/usr/bin:/usr/sfw/bin:/usr/ccs/bin:/usr/sbin:/opt/SUNWscat/bin
setenv LD_LIBRARY_PATH /usr/local/lib:/usr/lib:/usr/local/pgsql/lib:/usr/local/lib/secpgsql

./configure CC=cc LDFLAGS="-L/usr/lib -lpthread" --prefix=/usr/local/pgsql --enable-depend --enable-thread-safety --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib


22. Solaris 5 sparc

autoconf-2.62-sol25-sparc-local
bison-2.3-sol25-sparc-local
expat-2.0.1-sol25-sparc-local
flex-2.5.35-sol25-sparc-local
gettext-0.14.1-sol25-sparc-local
libintl-3.4.0-sol25-sparc-local
m4-1.4.10-sol25-sparc-local
make-3.81-sol25-sparc-local
readline-5.2     : 정적라이브러리로 소스 컴파일하여 설치함
snprintf-2.2-sol25-sparc-local
termcap-1.3-sol25-sparc-local   : 정적라이브러리로 설치됨
zlib-1.2.3     : 정적라이브러리로 소스 컴파일하여 설치함.
zlib-1.2.3-sol25-sparc-local   : 위의 소스 컴파일 설치한 것 삭제하고 본 패키지 설치함.(vsnprinf 못찾음 -lsnprintf 추가)

libgcc      : 설치되어 있는것 사용
libiconv     : 설치되어 있는것 사용

setenv PATH /bin:/usr/bin:/opt/SUNWspro/SC5.0/bin:/usr/local/bin:/usr/ccs/bin:/usr/ucb:/usr/sbin:/etc:.
setenv LD_LIBRARY_PATH /usr/lib:/usr/local/lib

./configure CC=cc --prefix=/usr/local/pgsql --enable-depend --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib

22.1 Makefile.global 에서 LIBS 에 -lnsl 추가해야 컴파일됨.

22.2 make 무한루프

touch 로 소스시간 맞춰줌.

22.3 initdb 실행 시 에러 발생

creating template1 database in /usr/local/secpgsql/data/base/1 ... FATAL:  could not create shared memory segment: Invalid argument
DETAIL:  Failed system call was shmget(key=1, size=1794048, 03600).
HINT:  This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter.  You can either reduce the request size or reconfigure the kernel with larger SHMMAX.  To reduce the request size (currently 1794048 bytes), reduce PostgreSQL's shared_buffers parameter (currently 50) and/or its max_connections parameter (currently 13).
        If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
        The PostgreSQL documentation contains more information about shared memory configuration.
child process exited with exit code 1
initdb: removing contents of data directory "/usr/local/secpgsql/data"

/etc/system 에 아래내용추가 후 리부팅

set shmsys:shminfo_shmmax=0x2000000
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=256
set shmsys:shminfo_shmseg=256
set semsys:seminfo_semmap=256
set semsys:seminfo_semmni=512
set semsys:seminfo_semmns=512
set semsys:seminfo_semmsl=32


./configure CC=cc LDFLAGS="-L/usr/lib -lpthread -lnsl -L/usr/local/lib -lsnprintf" --prefix=/usr/local/pgsql --enable-depend --enable-thread-safety --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib

22.4 make 시 에러 발생

cc -Xa -v -DSUNOS4_CC -O pg_dump.o common.o pg_dump_sort.o pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o pg_backup_files.o pg_backup_null.o pg_backup_tar.o dumputils.o  ../../../src/backend/parser/keywords.o -L../../../src/port -lpgport -L../../../src/interfaces/libpq -lpq -L../../../src/port -L/usr/lib -lpthread -lnsl  -L/usr/local/lib -Wl,-R'/usr/local/secpgsql/lib' -lpgport -lz -lreadline -ltermcap -lposix4 -lsocket -ldl -lm  -o pg_dump
Undefined                       first referenced
 symbol                             in file
vsnprintf                           /usr/local/lib/libz.a(gzio.o)
ld: fatal: Symbol referencing errors. No output written to pg_dump
make[3]: *** [pg_dump] Error 1
make[3]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/bin/pg_dump'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src/bin'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/pgsql_src/postgresql-8.3.1/src'
make: *** [all] Error 2

configure에 옵션의 LDFLAGS에 -lsnprintf 추가하여 해결


23. Unixware 7.1.2 x86

readline 5.2 소스 설치
zlib 1.2.3 소스설치

export PATH=$PATH:/usr/local/bin
export LD_LIBRARY_PATH=/usr/local/lib

./configure CC=cc LDFLAGS="-D_EFTSAFE" --prefix=/usr/local/pgsql --enable-thread-safety --enable-depend --with-pgport=5432 --with-includes=/usr/local/include --with-libraries=/usr/local/lib

23.1 아래내용 소스 수정하여 컴파일

src/test/thread/thread_test.c 82라인 sigwait "#if 0"로 주석처리함.
/usr/include/signal.h 파일의 sigwait(,); 함수 아규먼트 두 개인 함수만 define 해서 컴파일함.

23.2 initdb 에러 내용

$ ./initdb -E UTF-8 --no-locale -A trust -W -D /usr/local/secpgsql/data
The files belonging to this database system will be owned by user "secdb".
This user must also own the server process.

The database cluster will be initialized with locale C.
The default text search configuration will be set to "english".

creating directory /usr/local/secpgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 10
selecting default shared_buffers/max_fsm_pages ... 400kB/20000
creating configuration files ... ok
creating template1 database in /usr/local/secpgsql/data/base/1 ... FATAL:  could not create shared memory segment: Invalid argument
DETAIL:  Failed system call was shmget(key=1, size=1777664, 03600).
HINT:  This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter.  You can either reduce the request size or reconfigure the kernel with larger SHMMAX.  To reduce the request size (currently 1777664 bytes), reduce PostgreSQL's shared_buffers parameter (currently 50) and/or its max_connections parameter (currently 13).
        If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
        The PostgreSQL documentation contains more information about shared memory configuration.
child process exited with exit code 1
initdb: removing data directory "/usr/local/secpgsql/data"

해결을 위해 커널 파라미터 값 변경하여 적용, 재부팅해야됨

# /etc/conf/bin/idtune -g SHMMAX
524288  524288  131072  2147483647
# /etc/conf/bin/idtune SHMMAX 536870912
# /etc/conf/bin/idbuild -B
UX:idbuild: INFO:
        The unix kernel will be rebuilt now.
        This will take some time. Please wait.

UX:idbuild: INFO: The unix kernel has been rebuilt.

# /etc/conf/bin/idtune SHMMIN 1
#reboot

# /etc/conf/bin/idtune -g SHMMIN
1       1       1       1
# /etc/conf/bin/idtune -g SHMMNI
200     100     10      1000
# /etc/conf/bin/idtune -g SHMSEG
15      6       6       15
# /etc/conf/bin/idtune -g SHMALL
512     512     256     2048

커널 파라미터 값

# uname -a
UnixWare u713 5 7.1.3 i386 x86at SCO UNIX_SVR5

# /etc/conf/bin/idtune -g SHMMAX
134217728       134217728       131072  2147483647

# /etc/conf/bin/idtune -g SHMMIN
1       1       1       1

./initdb -E UTF-8 --no-locale -A trust -W -D /usr/local/pgsql/data

서버 재부팅 시 꼭 init 6 레벨로 재부팅 해야 커널파라미터 변경값 적용됨. : shutdown -y -g0 -i6


24. 결론
  이상으로 정리를 마친다. 오픈소스 DBMS가 상용 DBMS에 비해 상용 시장에서 외면을 당하고 있는 실정이나 조금만 관심을 기울이고 노력을 한다면 저렴한 비용과 그 이상의 성능을 발휘할 수 있다. 얼마전 기사에서 어떤 업체가 사용하고 있던 상용 DBMS를 PostgreSQL로 마이그레이션을 한다고 한다. 상용 DBMS의 대부분의 환경을 보면 고가의 장비에서 구동된다. 이에 비해 오픈 소스 DBMS의 경우 구입 가격이나 유지보수 비용이 안든다는 이유로 중소규모의 사용환경에서 많이 사용된다. 하지만 동급의 환경에서 최적화될 경우 상용 DBMS보다 좋은 결과물을 보여주기도 한다. 물론 꾸준한 관리와 노력이 필요하다. 추후 시간이 된다면, libpq를 이용한 간단한 프로그래밍이나 MS Windows 플랫폼상의 패키지 만드는 것과 설치에 대해서 살펴보고자 한다.

25. 기타

  http://www.postgresql.org/docs/current/static/installation-platform-notes.html

Posted by dcmru
,
스크립트를 실행할 때 현재 실행한 스크립트의 절대경로를 구해야 하는 경우가 있다.

절대경로를 구하는 명령어가 있는것 같지만 OS 국한적으로 그런 명령어를 가지고 있지않은 OS 또한 있다.

내가 만든 방법은 아래와 같다.
#!/bin/sh
EXEC_FILE="$0"
BASE_NAME=`basename "$EXEC_FILE"`
if [ "$EXEC_FILE" = "./$BASE_NAME" ] || [ "$EXEC_FILE" = "$BASE_NAME" ]; then
        FULL_PATH=`pwd`
else
        FULL_PATH=`echo "$EXEC_FILE" | sed 's/'"${BASE_NAME}"'$//'`
        cd "$FULL_PATH"                 > /dev/null 2>&1
        FULL_PATH=`pwd`
fi

설명을 하자면,

먼저 스크립트를 실행한 이름으로 base name을 구하고,

./으로 실행한 스크립트 또는 이름으로 실행한 스크립트이면, 실행위치에서 pwd로 절대경로를 구했고,

상대경로로 실행하거나 경로에 링크가 걸려있다면, 실행 경로의 끝에 위치한 스크립트 이름만 제거하고,
 
그경로로 이동한 후 pwd로 절대경로를 구한 것이다.

FULL_PATH 변수를 찍어 보면 절대경로가 들어가 있는것을 볼 수 있다.

쉽게 만들지는 못했지만, 예전에 kldp에 질의도 하고해서 만든 결과로 정리 차원에서 글을 써본다.
Posted by dcmru
,

본 쉘 프로그래밍을 할 때 화면에 문자를 표시해야할 때가 많다.
이럴 땐 echo 명령어보다 printf 명령어를 이용해서 표시하면, OS간의 옵션이 다른 echo 명령어보다 일관성이 있게 화면에 표시가 가능하다.
사용법은 --help 옵션을 입력하거나 man 페이지를 보면 나오지만 간단한 사용법은 C언어의 printf 함수와 비슷하다.
예를 들면, 아래와 같이 사용하면 된다. 명령어 다음에 스페이스로 한칸을 띄우고, 쌍따옴표로 묶은 중간에 타이핑을 하면된다.

printf "This is test.\n"

변수를 출력해야한다면, 문자열 중간에 $변수명을 넣어주면된다.
A="apple"
printf "The value is $A.\n"

화면에 출력되는 값는 "The value is apple." 이 된다.
Posted by dcmru
,


스킨의 본문 너비를 넓게 수정하여 사용하는 블로거들을 보고 나도 바꿔 사용했으면 했으나 html은 알아도 관련된 css 부분은 잘몰라 선뜻 스킨을 수정할 수가 없었다. 그러다 맘을 잡고 검색을 시작해 보니 관련글이 나왔다. ^^ 해당 주소을 참고로 하여 굵직한 부분을 적용하고, 나머지 위치 같은 경우는 style.css에 아래와 같이 적용하였다.

container의 width를 알맞게 조정하고, content의 width와 .aticle의 width을 같이 조정해준다. 본 스킨에서는 container는 content와 sidebar를 포함하고 있는 테이블이라 생각하면 된다.

/* 블로그 레이아웃 */
#container {
		width:/*@post-width:200=*/ 98% /*@*/;
		border:1px solid #bbb;
		margin:30px auto; 
		padding:10px;  
		background-color:#fff;
}

#header {
		padding:/*@title-height:-44=padding-top:*/ 11px /*@*/ 10px 0 20px;
		background-color:/*@title-background-color=*/ #7870ab /*@*/;
		margin-bottom:8px;
		/*@title-background-image=background-image:;*/ background-image: none; /*@*/
		/*@title-background-image-position=background-position:;*/ background-position: left top; /*@*/
		/*@title-background-image-repeat=background-repeat:;*/ background-repeat: no-repeat; /*@*/
}

#content {
		float:left;
		width:/*@post-width=*/ 86% /*@*/;
		overflow:hidden;

}

#sidebar {
		float:right;
		/*width:190px;*/
		width:12%;
}

#footer {
		clear:both;
		padding:20px 0 0 0;
		width:86%;
}


.article의 width로 본문글의 너비를 설정한다. 위의 content의 width만 변경하면, 본문 외각의 너비가 설정이되며, 실제 글의 너비는 아래 부분과 같이 적용해 준다.
.article                 { width:/*@post-width:-40=*/ 98% /*@*/; margin:5px 5px 0 5px; overflow:hidden; /*@post-body-color=color:;*/ color: ; /*@*/ /*@post-body-font-family=font-family:;*/ font-family: inherit; /*@*/ /*@post-body-font-size=font-size:;*/ font-size: inherit; /*@*/}


'형상관리 > ' 카테고리의 다른 글

What is Ajax?  (0) 2010.02.12
embed 태크 활용.  (0) 2005.10.15
ASP로 만들어본 학사행정정보 시스템  (0) 2005.10.14
Posted by dcmru
,

현재 PostgreSQL을 사용중인데, like '%XX'%' 를 사용하여 검색을 하니 데이타가 많이 쌓일 경우 속도가 너무 느리게 나온다. 그래서 검색중에 DSN에서 찾은 것이 full text index인 tsearch2이다. full text index 는 쉽게 게시판에서 검색을 할 때 글 내용 검색으로 생각하면 될 것 같다. DBMS별로 해당기능들이 있는것 같으며, PostgreSQL에는 tsearch2를 쓸 수 있다. 아직 한글 검색기능이 없어 해당 기능을 구현하려는 분들의 노고가 보였다.

DSN을 참고로 문의 글까지 올려가며,http://database.sarang.net/?inc=read&aid=5125&criteria=pgsql&subcrit=&id=&limit=20&keyword=tsearch&page=2

http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/tsearch2-guide.html 와 같이 참고를 하면서, 테스트를 하였다.

하지만 원래 검색보다 쿼리플랜을 통해 보면, 속도가 더 느리게 나온다. 설정을 잘못한것인가? 일단 언어에 최적화 되어 있는것 같은데, 기본인 simple로 설정해서 사용하였다. 단어별로 vector 형식으로 저장을 하고, gist 인덱스를 사용했다. 무엇이 잘못되었을까? 일단 테이블 두 개를 조인을 하였다. 그제서야 속도 차이가 반대로 나온다. 하지만 만족스럽지 않다. 실 데이타도 인덱스 때문에 크기가 두 배로 늘어난 상태이고, 장점을 못찾겠다. tsvector 형태의 컬럼을 쿼리해보면, y로 끝나는 단어는 i로 변경되어 저장되어 있다. 그리고 예외 단어라고 이해한 기능으로 의문사와 같은 형태의 단어는 저장이 되지 않는다. 계속 테스트 해봐야겠지만, 자주 쓰는 쿼리 결과는 캐시에 저장이 되는지, 1초 이내의 빠른 속도를 보이기도 한다. 하지만 다른 단어를 검색하면, 다시 느려지는 속도를 보면서, 튜닝의 길은 멀구나를 느꼈다.

최적화가 될 때까지 튜닝을 해봐야겠다. 도움주실분? ^^
Posted by dcmru
,
find 명령어를 이용하여 파일이름에 특수문자가 있으면, 찾아주는 방법이다.

find . -name '*[+{;"\=?~()<>&*|$ ]*' -print

위의 명령어를 실행하면, [] 사이에 있는 문자를 포함하는 파일들을 찾아준다.
간단하게 공백만 들어가있는 파일이름은 아래 옵션으로 실행하면 된다.

find . -name "* *" -print

예전에 리눅스 서버에 해킹을 당한적이 있다.
어느 순간 ls -al 로 디렉토리를 보는중 이상한 파일이름이 있음을 알아차렸다.
"\" 로 시작하는 파일이름이었는데, 무심코 보면 숨김파일 같다.
특수문자를 포함하는 파일을 찾았으면, 간단하게 삭제까지 할 수 있다.
"|" 파이프로 출력을 리다이렉션 한 후 xargs 를 이용하여 "xargs rm -f {}" 하면 된다.

find . -name '*[+{;"\=?~()<>&*|$ ]*' -print | xargs rm -f {}

만약에 정말 숨김파일을 찾고자 한다면, "." 으로 시작하는 파일을 찾으면 된다.

find . -name ".*" -print
Posted by dcmru
,


USB Flash Disk 의 기본 화일시스템은 대부분 vfat 를 사용하며, USB Flash Disk 는 커널에 의해서 SCSI 장치를 이용해서

접근 대부분 /dev/sd* , 하나의 USB Flash Drive 라면 아마도  /dev/sda1 을 사용한다.


- 마운트

# mkdir /mnt/usb

# mount -t vfat /dev/sda1 /mnt/usb


- 확인 : USB 가 사용하는 장치명을 확인하고 싶다면, dmesg 또는 fdisk -l 을 통해서 아래와 같이 확인할 수 있다.

 # fdisk -l                                                                        

Disk /dev/sda: 256 MB, 256900608 bytes

16 heads, 32 sectors/track, 979 cylinders

Units = cylinders of 512 * 512 = 262144 bytes

Device Boot    Start       End    Blocks   Id  System

/dev/sda1             1       979    250574+   6  FAT16


- 언마운트

# umount /mnt/usb


- USB 드라이브에서 한글 깨짐 현상 복구

# mount -t vfat -o iocharset=cp949 /dev/sda1 /mnt/usb

Posted by dcmru
,
RHAS 4.0 을 최신형 메인보드를 탑재한 데스크탑에 설치하려고 했더니 S-ATA 하드가 인식되지 않는다.

S-ATA 드라이브를 올려서 설치할 수 있겠지만 드라이브를 지원하는 경우는 많지 않을것이라 생각된다.

RHAS 4.0 Update7 부터는 S-ATA 드라이브를 포함하고 있어서 S-ATA 하드에 설치가 된다.

하지만 하위버전을 사용해야하기 때문에 S-ATA 를 IDE 로 인식시켜서 설치할 수가 있다.

CD로 부팅한 후 설치 옵션을 입력하는 화면에서 아래와 같은 명령으로 실행하게 되면,

boot : linux pci= nommconf all-generic-ide

S-ATA가 IDE로 인식되어 설치가 진행된다.

파티션 설정 화면에서도 sda가 아닌 hda로 잡혀있는 모습을 볼 수 있다.
Posted by dcmru
,

오픈솔라리스의 커널을 빌드해서 올리는 작업.

Everyone and their grandmother builds Linux kernels. Many people build BSD, and some brave men even compile the OS X kernel every now and then. Why not compile your own Solaris kernel for a change?

There is lots of documentation scattered out there, many pieces, incomplete, outdated and over-generalized tutorials. This will walk you through installing Solaris, adding all components required for building, and actually compiling a kernel in 73 easy steps.

I won’t give you any options, because options make everything more complicated. We’re installing Solaris on a dedicated machine, the versions of the build system and the target kernel/system will match and we’re targeting x86/x64 only.

  1. Get a physical computer with maybe a GB of RAM and significantly more than 10 GB of disk space. VMware and VirtualBox seem to have issues with current builds (b97-b99).
  2. Navigate to http://opensolaris.org/os/downloads/
  3. Download the latest build of OpenSolaris Express Community Edition (Nevada). You can’t compile a kernel on any other Solaris distribution. Get Nevada. If you want to run a specific build, hack the URL and replace the build number; older builds are available, but not linked to.
  4. burn DVD
  5. boot DVD
  6. GRUB: “Solaris Express”
  7. select “Solaris Interactive”
  8. make your language perference
  9. choose Networked
  10. DHCP yes
  11. IPv6 no
  12. Kerberos no
  13. Name Service: none
  14. NFS domain derived by the system
  15. choose your time zone
  16. enter your root password
  17. reboot yes, eject yes
  18. media CD/DVD
  19. accept the license
  20. custom install
  21. no localizations
  22. no additional products
  23. Entire Group, Default (~7 GB)
  24. select your install HD - remember that this is a dedicated disk that will be wiped!
  25. accept a single Solaris MBR partition with all the space
  26. modify the layout: remove /export/home and allocate all to “/”, keep swap
  27. wait
  28. the system will reboot. remove the DVD
  29. wait a long time again - the GUI login screen will show up eventually, don’t log in on the console
  30. log in as root
  31. (b99 will hang after a short “About Gnome” screen, hit Ctrl+Alt+Backspace to kill the X-Server and log in again)
  32. Administration -> Users and Groups, Add User
  33. log out
  34. log in as user
  35. find out what compiler you need: http://www.opensolaris.org/os/downloads/on/ says you need Sun Studio 11 up to b99, and Sun Studio 12 starting with b100.
  36. click on the linked Sun Studio
  37. it might say “Chinese-Simplified” as language, but the file is correct.
  38. don’t use the download manager, just click on the file and choose “Save File”
  39. Navigate to http://dlc.sun.com/osol/on/downloads/
  40. choose your build of your installed system (don’t say “current”, that’s newer!)
  41. download “ON Source”: on-src.tar.bz2
  42. download “ON Specific Build Tools (i386)”: SUNWonbld.i386.tar.bz2
  43. download “ON Binary-Only Components (debug, i386): on-closed-bins.i386.tar.bz2
  44. All Applications -> Accessories -> Terminal
  45. fix the prompt:
    echo "export PS1='\h:\W \u\$ '" >> .bashrc
  46. add onbld to the PATH:
    echo "PATH=/opt/onbld/bin:\$PATH" >> .bashrc
  47. close the window and start a new terminal, or ssh into the machine; you can get your IP with
    /usr/sbin/ifconfig -a
  48. su
  49. bash
  50. cd /opt
  51. bzip2 -cd /export/home/username/Desktop/sunstudio*.tar.bz2 | tar xf -
  52. cd /export/home/username/Desktop
  53. bzip2 -cd SUNWonbld*.tar.bz2 | tar xf -
  54. pkgadd -d onbld SUNWonbld
  55. y
  56. close Terminal window, open a new one
  57. mkdir work
  58. cd work
  59. bzip2 -cd ~/Desktop/on-closed-bins*.tar.bz2 | tar xf -
  60. bzip2 -cd ~/Desktop/on-src*.tar.bz2 | tar xf -
  61. cd usr/src/tools
  62. mkdir proto
  63. ln -s /opt proto
  64. cd ../../..
  65. cp usr/src/tools/env/opensolaris.sh .
  66. vi opensolaris.sh
  67. set GATE to “work” (base directory name)
  68. set CODEMGR_WS to “/export/home/username/$GATE” (full path)
  69. set STAFFER to your username
  70. set VERSION to “$STAFFER” to have your name in the kernel version
  71. bldenv ./opensolaris.sh
  72. cd usr/src/uts
  73. dmake all

(If it complains with “illegal option -m64″, your compiler is too old. Get Sun Studio 12. If anything fails, read the README from the download page for updates on the build you’re using.)

Now if we only knew what to do with that kernel!

출처 : http://www.pagetable.com/?p=44

 

'형상관리 > 유닉스' 카테고리의 다른 글

솔라리스 파일시스템 타입 보는 방법  (0) 2010.11.19
OS별 cdrom 마운트하는 방법  (0) 2009.12.16
Posted by dcmru
,