1. 사용환경
OS : Redhat linux 6.2 (2.2.14-5.0), other Linux , UNIX ,FreeBSD, etc
Database : MySQL 3.22.30 이상
Webserver : Apache 1.3.x 이상
PHP : 4.0.0 이상
Perl : 5.0 이상 ( 단지 install에만 사용, 수동 설치시 불필요 )
2. 디렉토리 구조
설치가 끝이 나면 다음과 같은 구조의 디렉토리가 생성되게 됩니다.
절대경로는 설치시 지정하는 경로에 따라 다르게 됩니다.
/---------htdocs
| |---bin => 프로그램 파일들
| |
| |---tle => 디자인 셋 파일들
| |
| |---img => 이미지 파일들
| |
| |---lib => 라이브러리
|
|-----conf => 환경설정
| |
| |---language => 언어팩
|
---- DB_information => db table 정보
bin : netmania mail의 중요한 실행스크립트 파일들이 들어있습니다. 이 곳의 파일들을 임의로 수정하실 때는 비정상적으로 동작할 수 있습니다.
tle : netmania mail의 인터페이스와 관련된 파일들이 들어있습니다. 이 곳의 파일들에도 많은 스크립트들이 포함되어 있기 때문에 수정시에는 주의하셔야 합니다.
img : netmania mail에서 사용되는 그래픽 파일들이 들어있습니다.
lib : netmania mail이 사용하는 중요한 라이브러리들이 들어있으며 이 곳의 파일들도 임의로 수정시에는 비정상적으로 동작할 수 있습니다.
conf : netmania mail의 환경설정 관련 파일들이 들어있습니다.
language : netmania mail의 언어팩이 들어있습니다. 해당되는 언어의 팩을 이곳에 설치하신 후 conf에서 언어관련 설정을 바꾸시면 해당 언어로 서비스 되게 됩니다. 이곳에는 각종 메세지들을 담은 파일들과 메뉴에 사용된 각종 그래픽 파일들이 포함되어 있습니다.
DB_information : netmania mail이 사용하는 중요한 db 정보가 들어있습니다.
3. 준비
netmania mail을 사용하기 위해서는 Apache, pop3 server, smtp server(sendmail,qmail..etc), MySQL 이 설치 되어 있어야 합니다.
이미 Apache, pop3 server, smtp server, MySQL 이 설치되어 있는 경우 4장으로 넘어가세요.
다음에 소개되어있는 설치 과정은 Redhat 6.2 기반에서의 설치과정입니다.
3.1 MySQL 설치
MySQL 은 RedHat 6.2 에서 기본적으로 제공하고 있지 않기 때문에 http://www.mysql.com 에서
down 받아 설치 해야 합니다.
설치는 Source Compile, RPM 설치 두 가지 방법이 있습니다.
3.1.1 Source Compile
http://www.mysql.com/downloads/ 에서 최신 안정버전을 다운로드 받으세요.
다음 예제는 mysql 버전 3.22.32 버전을 설치하는 것으로 합니다.
참고) 프로그램 설치시 모두 root 권한으로 작업을 해야 합니다.
shell 에서 다음 같은 명령어로 압축된 배포판의 압축을 풀어줍니다.
shell> tar zxvf mysql-3.22.32.tar.gz
압축이 풀렸으면 생성된 디렉토리로 이동합니다.
shell> cd mysql-3.22.32
이제는 설정을 해주게 됩니다.
shell> ./configure --prefix=/usr/local/mysql \
--with-charset=euc_kr
여기에서 charset을 euc_kr로 하지 않게되면 한글로 되어 있는 data 를 sort 시에 정확한 sort 값을 얻지 못하게 됩니다.
\(역슬래시)는 옵션을 넣다 보니 길어질 경우 다음줄에서 이어서 쓸 경우 역슬래시를 이용하면 됩니다.
--prefix 옵션은 설치할 디렉토리를 지정하는 옵션입니다. default 값은 /usr/local 입니다.
--prefix, --with-charset 옵션 이외에 다양한 옵션이 있습니다. 다른 옵션에 대한 정보를 원할때는
다음과 같이 --help 옵션을 하면 다양한 옵션을 볼 수 있습니다.
shell> ./configure --help
configure 가 끝이 나면 make 과정으로 넘어 갑니다. make 과정은 souce를 compile 하는 과정으로 만약 make 도중 오류가 발생하여 다시 make 할 경우엔
make clean 으로 object 파일을 삭제하시고 다시 시도해 보세요.
shell> make clean
shell> make
이제 설치를 합니다.
shell> make install
MySQL 이 설치되어 있는 디렉토리로 이동합니다.
shell> cd /usr/local/mysql/bin
MySQL의 데이터를 관리할 기본적인 테이블 6개를 생성시킵니다.
shell > ./mysql_install_db
MySQL share 디렉토리로 이동해서 mysql.server 파일을 수정합니다.
shell> cd /usr/local/mysql/share/mysql
shell> vi mysql.server
safe_mysql이 실행되는 라인(78 line)에 --language=korean 옵션을 추가합니다. 이 옵션을 추가하면 에러 메세지가 한글로 나오게 됩니다.
$bindir/safe_mysqld --user=$mysql_daemon_user --pid-file=$pid_file --datadir=$datadir --language=korean &
mysql.server 파일 실행권한을 변경합니다.
shell> chmod 755 mysql.server
linux 가 부팅하면서 실행되게 하려면 mysql.server 를 /etc/rc.d/init.d/mysqld 로 copy 하고 다음과 같이 합니다.
shell> cp mysql.server /etc/rc.d/init.d/mysqld
shell> cd /etc/rc.d/rc3.d
shell> ln -s /etc/rc.d/init.d/mysqld S85mysqld
설치 작업이 끝이 났습니다. 이젠 mysql을 실행해 보겠습니다.
shell> /etc/rc.d/init.d/mysqld start
그리고 나서 mysql의 root password 를 바꿔보겠습니다. 예를 들면 새로 만들 password 가 netmania 일 경우
다음과 같이 하면 됩니다.
shell> /usr/local/mysql/mysqladmin -u root password 'netmania'
3.1.2 RPM 설치
http://www.mysql.com에서 최신안정버전을 다운로드 받습니다.
홈페이지에 보면 여러개의 rpm이 있는데, 그중에서
Binary RPM containing the server for i386 machines.
Binary RPM containing client programs for i386 machines.
Binary RPM containing include files and libraries for development for i386 machines
이 세 가지를 다운로드 하세요.
그런 후
다음과 같은 rpm 명령어로 설치한다.
shell> rpm -Uvh MySQL-3.22.21-1.i386.rpm
shell> rpm -Uvh MySQL-client-3.22.21-1.i386.rpm
shell> rpm -Uvh MySQL-devel-3.22.21-1.i386.rpm
3.2 apache & php
apache 프로그램은 http://www.apache.org/ 에서 가장 최신버전을 다운 받습니다.
php 프로그램은 http://www.php.net/downloads.php 에서 가장 최신버전을 다운 받습니다.
다음과 같은 명령어로 apache, php 프로그램의 압축과 tar를 풉니다.
shell> tar xvfz apache_1.3.14.tar.gz
shell> tar xvfz php-4.0.4.tar.gz
먼저 apache소스 디렉토리에서 configure 를 실행시킵니다.
shell> cd apache_1.3.14
shell> ./configure
3.2.1 php 설치
압축이 풀린 php 배포판 디렉토리로 이동합니다.
shell> cd ..
shell> cd php-4.0.4
다음과 같은 옵션으로 configure 를 실행하고 설치 합니다.
shell> ./configure --with-mysql=/usr/local/mysql --with-apache=../apache_1.3.14 \
--enable-track-vars --with-config-file-path=/usr/local/apache/conf \
--with-mod-charset --with-language=korean --with-charset=euc_kr \
--disable-debug --with-xml --enable-magic-quotes
shell> make
shell> make install
3.2.2 apache 설치
다음과 같이 apache 배포판 디렉토리로 이동하여 다시 다음 옵션을 주고 configure를 해줍니다.
shell> cd ../apache_1.3.14
shell> ./configure --prefix=/usr/local/apache \
--activate-module=src/modules/php4/libphp4.a
--prefix 는 apache가 설치되는 디렉토리를 지정하는 옵션입니다.
이제 apache를 컴파일 하고 설치 합니다.
shell> make
shell> make install
이제 php.ini-dist 파일을 /usr/local/apache/conf 에 이름을 변경하여 복사합니다.
shell> cp ../php-4.0.4/php.ini-dist /usr/local/apache/conf/php.ini
이제는 Apache의 환경설정 파일인 httpd.conf 에서 php가 동작하게끔 수정해야 합니다.
httpd.conf 파일을 vi 같은 에디터에서 열고
#AddType application/x-httpd-php .php
이렇게 주석처리 되어 있는 부분을 다음과 같이 수정합니다.
AddType application/x-httpd-php .php .php3 .inc .lib .ph
그리고 저장하고 편집기를 빠져나옵니다.
이제는 linux 가 부팅하면서 자동으로 apache 를 동작하게 변경하도록 합니다.
shell> cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
shell> cd /etc/rc.d/rc3.d
shell> ln -s /etc/rc.d/init.d/httpd S85httpd
apache 설치의 모든 과정이 끝이 났습니다. 이제 apache를 작동해 보도록 하죠.
shell> /etc/rc.d/init.d/httpd start
3.3 pop3 server
pop3 server 는 redhat6.2 버전에는 이미 깔려 있을겁니다.
vi 같은 편집기로 /etc/inetd.conf 를 열어보시면 다음과 같이 주석 처리 되어 있을겁니다.
#pop-2 stream tcp nowait root /usr/sbin/tcpd ipop2d
#pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d
#imap stream tcp nowait root /usr/sbin/tcpd imapd
그러면 주석처리 되어 있는 부분을 다음과 같이 풀어줍니다.
#pop-2 stream tcp nowait root /usr/sbin/tcpd ipop2d
pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d
#imap stream tcp nowait root /usr/sbin/tcpd imapd
저장하고 나와서 inetd를 다음과 같이 restart 시켜주세요.
shell> /etc/rc.d/init.d/inetd restart
그러면 pop3 가 제대로 작동하는지 알아보도록 하겠습니다. 다음과 같이 shell 에서 telnet 으로 110 번 포트에 접속을 시도해 봅니다.
shell> telnet localhost 110
화면에 다음과 같이 나오면 Pop3 server가 정상적으로 동작하고 있다고 볼 수 있습니다.
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
+OK POP3 localhost v7.64 server ready
이 상태에서
user "일반사용자 계정"
라고 치고 엔터를 쳐봅니다.
그리고,
pass "계정 패스워드"
라고 치고 엔터를 칩니다.
만약 제대로 설정이 되어 있다면 다음과 유사한 내용이 화면에 출력될겁니다.
Connected to localhost (127.0.0.1).
Escape character is '^]'.
+OK POP3 localhost v7.64 server ready
user userid
+OK User name accepted, password please
pass userpassword
+OK Mailbox open, 0 messages
위와 같은 메시지가 나오면 Pop3 서버가 정상적으로 동작하는 겁니다.
이제는 quit 라고 쳐서 접속을 끊습니다.
quit
+OK Sayonara
Connection closed by foreign host.
만약 이렇게 되지 않을경우나 pop3 server를 재설치 할경우 http://www.eudora.com/qpopper/ 에서
qpopper 최신 버전을 다운 받아서 설치하실 수 있습니다.
3.3.1 qpoper
다음과 같이 다운로드 받은 파일의 압축을 풀고 해당 디렉토리로 이동합니다.
shell> tar xvfz qpopper3.1.2.tar.gz
shell> cd qpopper3.1.2
만약 shadow password 방식을 사용하는 시스템이라면 configure 옵션에 --enable-specialauth 를 추가해 주도록 합니다.
그리고 컴파일을 합니다.
shell> ./configure --enable-specialauth
shell> make
shell> cd popper
먼저 생성된 popper를 복사한다.
shell> cp popper /usr/local/lib
만일 /usr/local/lib 디렉토리가 없다면 mkdir 명령으로 생성시켜주세요. 디렉토리가 존재할 경우 mkdir 명령을 내릴 필요없이 복사 작업만 하시면 됩니다.
이제는 /etc/services ,/etc/inetd.conf 화일을 수정해야 합니다.
/etc/services 화일에 다음과 같은 부분이 있는지 확인을 하시고 만일 없다면 추가를 해주세요.
pop3 110/tcp # popper
/etc/inetd.conf의 화일도 다음과 같은 부분이 있는지 확인을 하고 없으면 추가해주세요.
pop3 stream tcp nowait root /usr/local/lib/popper popper -s
이제는 inetd를 다음과 같이 restart 해줍니다.
shell> /etc/rc.d/init.d/inetd restart
그리고 위에서와 같이 테스트해 보도록 합니다.
shell> telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK QPOP (version 3.1) at localhost starting.
user userid
+OK Password required for myname.
pass userpassword
+OK myname has 0 messages (0 octets).
quit
+OK Pop server at localhost signing off.
Connection closed by foreign host.
이런식으로 메세지가 나오면 제대로 설치가 된 것입니다.
4. netmania mail 설치
netmania mail 을 설치하기 전에 MySQL ,apache (with php4),pop3 server ,smtp server(sendmail or qmail) 등이 설치가 되어 있어야 합니다.
만약 이런것이 설치 되어 있지 않으면 "3. 준비" 를 참고 해서 프로그램들을 설치해주세요.
netmania mail 에서는 install.me 라는 installer프로그램으로 쉽게 설치할 수 있습니다. 이 installer 는 perl로 만들어져 있어서 이 installer로 설치하기 위해서는 Perl 5 가 깔려 있어야 합니다. 대부분의 리눅스 시스템에서는 기본으로 Perl 5가 깔려 있습니다.
이 프로그램은 단계별로 구성되어있고 총 3단계로 되어있습니다.
1단계 => file copy
2단계 => MySQL setting
3단계 => conf 파일 수정
이런 순서로 설치를 하게 됩니다.
4.1 install.me를 이용한 설치
우선 install을 하기 전에 사용자는 root 권한으로 모든 작업을 해야 한다는 것을 다시한번 상기시켜 드리겠습니다. 그리고 mysql의 root 패스워드 또한 알고 있어야 합니?
이것은 MySQL 에 database 와 user 를 추가 하기 위해서 입니다.
모든 작업준비가 끝났으면 netmania website (http://www.netmania.org/) 에서 받은 netmania-1.0.1.tar.gz의 압축과 tar를 풀어줍니다.
shell>tar zxvf netmania-1.0.1.tar.gz
그리고 생성된 디렉토리로 이동하여서 인스톨 프로그램을 실행시킵니다.
shell> cd netmania-1.0.1
shell> perl install.me
그러면 다음과 같은 주의 문구가 나올겁니다.
[netmania mail Installer version 1.0.2 ]
[NOTICE!] This install program MUST be run as root, and
to connect to MySQL db, root password of MySQL is needed. If not
quit install program by press control+C.
[Session 1. File copy ]
Please locate the path where netmania mail will be
installed. [/usr/local/netmania]
enter를 치면 /usr/local/netmnaia 에 깔리게 되며 수정하고 싶으면 원하는 디렉토리 패쓰를 입력하면 됩니다.
성공하면 "[Session 1. File copy -- END --]" 이라는 문구가 나오고 다음 단계인 mysql setting이 나오게 됩니다.
[Session 1. File copy -- END --]
[Session 2. Mysql Setting ]
Please locate the path where MySQL is installed
[/usr/local/mysql] /usr/local/mysql <== mysql 이 설치된 디렉토리를 적어주면 됩니다.
What is the hostname of MySQL [localhost] ? <== mysql 이 설치된 server 주소를 적어주면 됩니다..
Please type MySQL root password.--> rootpasswd <== mysql 의 root의 password 를 적어줍니다.
We're going to add new database to MySQL.
Please type new database name [netmania] --> netmania <== netmania mail 에서 사용할 database name
We're going to add new user to MySQL.
Please type new user name [webmail] --> webmail <== netmania mail 에서 사용할 mysql id
Please type password of new user --> ****** <== 새로 만들 id의 패스워드
Connecting MySQL to add new database and to add new user..........
[Session 2. Mysql Setting -- END --]
위와 같은 메세지가 나오면서 3단계로 들어가게 됩니다.
다음과 같은 메세지가 나타납니다.
[Session 3. conf file setting ]
conf/db_auth.conf file writing..........
Please type server name of e-mail address
ex)if your email address is 'user@email.com'
, server name is 'email.com' --> netmania.org <== 사용할 email 주소의 서버이름을 쓰면 됩니다.
다음과 같은 메세지가 나타나면 끝이납니다.
Installation End.
이제는 apach server 의 document root 세팅만 하면 됩니다.
Apache의 httpd.conf 파일을 vi 같은 편집기로 열어서 수정합니다.
shell> vi /usr/local/apache/conf/httpd.conf
DocumentRoot를 지정하는 내용을 찾아서 다음과 같이 수정해 줍니다.
DocumentRoot "/usr/local/netmania/conf/htdocs"
위과 같이 수정하였으면 다음과 같이 apache 를 재시작 해줍니다.
shell>/etc/rc.d/init.d/httpd restart
여기 까지 되었으면, install 작업이 끝이 나게 됩니다.
만일 이미 기존에 사용하던 웹서비스가 있었고 웹메일 서비스를 추가하시는 경우라면 Apache의 httpd.conf에서 가상호스트를 잡아주셔야 합니다.
이 경우라면 httpd.conf를 vi 같은 편집기에서 열고 다음과 같이 수정해주어야 합니다.
shell>vi /usr/local/apache/conf/httpd.conf
파일을 연 다음 가상호스트의 내용을 다음과 같은 내용을 입력해 주시면 됩니다.
NameVirtualHost xxx.xxx.xxx.xxx <== 서버의 IP 주소를 적어주시면 됩니다.
<VirtualHost xxx.xxx.xxx.xxx> <== 역시 서버의 IP주소를 적습니다.
ServerAdmin admin@netmania.org <== 서버 관리자의 이메일 주소를 적습니다.
DocumentRoot /usr/local/netmania/conf/htdocs <== 위에서 사용한 DocumentRoot와 같습니다.
ServerName webmail.netmania.org <== 새로 가상호스트로 잡으려는 서버이름을 적습니다.
ErrorLog logs/webmail-netmania-error_log <== 에러로그 파일의 이름을 지정해 줍니다.
CustomLog logs/en-netmania-access_log common <== 로그 파일의 이름을 지정해 줍니다.
</VirtualHost>
위와 같이 수정하셨다면 저장하시고 Apache를 재시동 해주셔야 합니다.
shell>/etc/rc.d/init.d/httpd restart
만일 httpd.conf에서 가상호스트 관련 부분만을 따로 빼서 별도의 파일로 관리하신다면 별도의 파일을 고치시면 됩니다.
4.2 수동 설치
다운받으신 파일의 압축을 푸시고 생성된 디렉토리로 이동합니다.
shell> cd netmania-1.0.1
먼저 다음과 같이 필요한 디렉토리와 파일들을 복사합니다.
shell> cp -R htdocs/ conf/ /usr/local/netmania <== 설치할 디렉토리를 적어주시면 됩니다.
다음 createuser.sql 파일을 열고 new_database, new_user, new_passwd 를 각각 적당하게 수정합니다.
shell> cd DB_information
shell> vi createuser.sql
다음과 같이 하여 table를 구성합니다.
shell> cat mailbox.sql | /usr/local/mysql/bin/mysql --user=new_user --password=**** new_database
shell> cat mailfolder.sql | /usr/local/mysql/bin/mysql --user=new_user --password=**** new_database
shell> cat pop3.sql | /usr/local/mysql/bin/mysql --user=new_user --password=**** new_database
shell> cat profile.sql | /usr/local/mysql/bin/mysql --user=new_user --password=**** new_database
이번에는 conf 파일을 수정합니다.
shell> cd /usr/local/netmania/conf
shell> cp db_auth.conf.default db_auth.conf
shell> cp webmail.conf.default webmail.conf
shell> vi db_auth.conf
/* Connect to host */
$DB_HOSTNAME = "localhost"; <== MySQL 서버 host name을 적습니다.
/* Database to use */
$DB_DATABASE_NAME = "database_name"; <== 이번에 새로추가한 database name을 적습니다.
/* User for login */
$DB_USER_NAME = "user_name"; <== 이번에 새로추가한 db id 을 적습니다.
/* Password to use when connecting to server */
$DB_USER_PASSWD = "user_passwd"; <== 이번에 새로추가한 db id 의 password 을 적습니다.
/* Port number to use for connection */
$DB_PORT = ":3306";
/* Socket filename to use for connection */
$DB_PATH_SOCKET = ":/tmp/mysql.sock";
다음과 같은 디렉토리를 추가하고 퍼미션을 변경합니다.
nobody.nobody 로 변경한 것은 apache 실행 퍼미션과 일치 시키기 위한 작업입니다.
만약 apache가 다른 퍼미션으로 작동하고 있으면 그 퍼미션에 맞게 수정하시면 됩니다.
shell> mkdir /usr/local/netmania/maildata
shell> chown -R nobody.nobody /usr/local/netmania/maildata
이제는 apache server 의 document root 세팅만 하면 됩니다.
shell> vi /usr/local/apache/conf/httpd.conf
DocumentRoot "/usr/local/netmania/conf/htdocs"
다음과 같이 수정하고 apache 를 재시작 하시면 됩니다.
축하합니다! 여기까지 잘 되었다면 install 작업이 끝이 난겁니다.
OS : Redhat linux 6.2 (2.2.14-5.0), other Linux , UNIX ,FreeBSD, etc
Database : MySQL 3.22.30 이상
Webserver : Apache 1.3.x 이상
PHP : 4.0.0 이상
Perl : 5.0 이상 ( 단지 install에만 사용, 수동 설치시 불필요 )
2. 디렉토리 구조
설치가 끝이 나면 다음과 같은 구조의 디렉토리가 생성되게 됩니다.
절대경로는 설치시 지정하는 경로에 따라 다르게 됩니다.
/---------htdocs
| |---bin => 프로그램 파일들
| |
| |---tle => 디자인 셋 파일들
| |
| |---img => 이미지 파일들
| |
| |---lib => 라이브러리
|
|-----conf => 환경설정
| |
| |---language => 언어팩
|
---- DB_information => db table 정보
bin : netmania mail의 중요한 실행스크립트 파일들이 들어있습니다. 이 곳의 파일들을 임의로 수정하실 때는 비정상적으로 동작할 수 있습니다.
tle : netmania mail의 인터페이스와 관련된 파일들이 들어있습니다. 이 곳의 파일들에도 많은 스크립트들이 포함되어 있기 때문에 수정시에는 주의하셔야 합니다.
img : netmania mail에서 사용되는 그래픽 파일들이 들어있습니다.
lib : netmania mail이 사용하는 중요한 라이브러리들이 들어있으며 이 곳의 파일들도 임의로 수정시에는 비정상적으로 동작할 수 있습니다.
conf : netmania mail의 환경설정 관련 파일들이 들어있습니다.
language : netmania mail의 언어팩이 들어있습니다. 해당되는 언어의 팩을 이곳에 설치하신 후 conf에서 언어관련 설정을 바꾸시면 해당 언어로 서비스 되게 됩니다. 이곳에는 각종 메세지들을 담은 파일들과 메뉴에 사용된 각종 그래픽 파일들이 포함되어 있습니다.
DB_information : netmania mail이 사용하는 중요한 db 정보가 들어있습니다.
3. 준비
netmania mail을 사용하기 위해서는 Apache, pop3 server, smtp server(sendmail,qmail..etc), MySQL 이 설치 되어 있어야 합니다.
이미 Apache, pop3 server, smtp server, MySQL 이 설치되어 있는 경우 4장으로 넘어가세요.
다음에 소개되어있는 설치 과정은 Redhat 6.2 기반에서의 설치과정입니다.
3.1 MySQL 설치
MySQL 은 RedHat 6.2 에서 기본적으로 제공하고 있지 않기 때문에 http://www.mysql.com 에서
down 받아 설치 해야 합니다.
설치는 Source Compile, RPM 설치 두 가지 방법이 있습니다.
3.1.1 Source Compile
http://www.mysql.com/downloads/ 에서 최신 안정버전을 다운로드 받으세요.
다음 예제는 mysql 버전 3.22.32 버전을 설치하는 것으로 합니다.
참고) 프로그램 설치시 모두 root 권한으로 작업을 해야 합니다.
shell 에서 다음 같은 명령어로 압축된 배포판의 압축을 풀어줍니다.
shell> tar zxvf mysql-3.22.32.tar.gz
압축이 풀렸으면 생성된 디렉토리로 이동합니다.
shell> cd mysql-3.22.32
이제는 설정을 해주게 됩니다.
shell> ./configure --prefix=/usr/local/mysql \
--with-charset=euc_kr
여기에서 charset을 euc_kr로 하지 않게되면 한글로 되어 있는 data 를 sort 시에 정확한 sort 값을 얻지 못하게 됩니다.
\(역슬래시)는 옵션을 넣다 보니 길어질 경우 다음줄에서 이어서 쓸 경우 역슬래시를 이용하면 됩니다.
--prefix 옵션은 설치할 디렉토리를 지정하는 옵션입니다. default 값은 /usr/local 입니다.
--prefix, --with-charset 옵션 이외에 다양한 옵션이 있습니다. 다른 옵션에 대한 정보를 원할때는
다음과 같이 --help 옵션을 하면 다양한 옵션을 볼 수 있습니다.
shell> ./configure --help
configure 가 끝이 나면 make 과정으로 넘어 갑니다. make 과정은 souce를 compile 하는 과정으로 만약 make 도중 오류가 발생하여 다시 make 할 경우엔
make clean 으로 object 파일을 삭제하시고 다시 시도해 보세요.
shell> make clean
shell> make
이제 설치를 합니다.
shell> make install
MySQL 이 설치되어 있는 디렉토리로 이동합니다.
shell> cd /usr/local/mysql/bin
MySQL의 데이터를 관리할 기본적인 테이블 6개를 생성시킵니다.
shell > ./mysql_install_db
MySQL share 디렉토리로 이동해서 mysql.server 파일을 수정합니다.
shell> cd /usr/local/mysql/share/mysql
shell> vi mysql.server
safe_mysql이 실행되는 라인(78 line)에 --language=korean 옵션을 추가합니다. 이 옵션을 추가하면 에러 메세지가 한글로 나오게 됩니다.
$bindir/safe_mysqld --user=$mysql_daemon_user --pid-file=$pid_file --datadir=$datadir --language=korean &
mysql.server 파일 실행권한을 변경합니다.
shell> chmod 755 mysql.server
linux 가 부팅하면서 실행되게 하려면 mysql.server 를 /etc/rc.d/init.d/mysqld 로 copy 하고 다음과 같이 합니다.
shell> cp mysql.server /etc/rc.d/init.d/mysqld
shell> cd /etc/rc.d/rc3.d
shell> ln -s /etc/rc.d/init.d/mysqld S85mysqld
설치 작업이 끝이 났습니다. 이젠 mysql을 실행해 보겠습니다.
shell> /etc/rc.d/init.d/mysqld start
그리고 나서 mysql의 root password 를 바꿔보겠습니다. 예를 들면 새로 만들 password 가 netmania 일 경우
다음과 같이 하면 됩니다.
shell> /usr/local/mysql/mysqladmin -u root password 'netmania'
3.1.2 RPM 설치
http://www.mysql.com에서 최신안정버전을 다운로드 받습니다.
홈페이지에 보면 여러개의 rpm이 있는데, 그중에서
Binary RPM containing the server for i386 machines.
Binary RPM containing client programs for i386 machines.
Binary RPM containing include files and libraries for development for i386 machines
이 세 가지를 다운로드 하세요.
그런 후
다음과 같은 rpm 명령어로 설치한다.
shell> rpm -Uvh MySQL-3.22.21-1.i386.rpm
shell> rpm -Uvh MySQL-client-3.22.21-1.i386.rpm
shell> rpm -Uvh MySQL-devel-3.22.21-1.i386.rpm
3.2 apache & php
apache 프로그램은 http://www.apache.org/ 에서 가장 최신버전을 다운 받습니다.
php 프로그램은 http://www.php.net/downloads.php 에서 가장 최신버전을 다운 받습니다.
다음과 같은 명령어로 apache, php 프로그램의 압축과 tar를 풉니다.
shell> tar xvfz apache_1.3.14.tar.gz
shell> tar xvfz php-4.0.4.tar.gz
먼저 apache소스 디렉토리에서 configure 를 실행시킵니다.
shell> cd apache_1.3.14
shell> ./configure
3.2.1 php 설치
압축이 풀린 php 배포판 디렉토리로 이동합니다.
shell> cd ..
shell> cd php-4.0.4
다음과 같은 옵션으로 configure 를 실행하고 설치 합니다.
shell> ./configure --with-mysql=/usr/local/mysql --with-apache=../apache_1.3.14 \
--enable-track-vars --with-config-file-path=/usr/local/apache/conf \
--with-mod-charset --with-language=korean --with-charset=euc_kr \
--disable-debug --with-xml --enable-magic-quotes
shell> make
shell> make install
3.2.2 apache 설치
다음과 같이 apache 배포판 디렉토리로 이동하여 다시 다음 옵션을 주고 configure를 해줍니다.
shell> cd ../apache_1.3.14
shell> ./configure --prefix=/usr/local/apache \
--activate-module=src/modules/php4/libphp4.a
--prefix 는 apache가 설치되는 디렉토리를 지정하는 옵션입니다.
이제 apache를 컴파일 하고 설치 합니다.
shell> make
shell> make install
이제 php.ini-dist 파일을 /usr/local/apache/conf 에 이름을 변경하여 복사합니다.
shell> cp ../php-4.0.4/php.ini-dist /usr/local/apache/conf/php.ini
이제는 Apache의 환경설정 파일인 httpd.conf 에서 php가 동작하게끔 수정해야 합니다.
httpd.conf 파일을 vi 같은 에디터에서 열고
#AddType application/x-httpd-php .php
이렇게 주석처리 되어 있는 부분을 다음과 같이 수정합니다.
AddType application/x-httpd-php .php .php3 .inc .lib .ph
그리고 저장하고 편집기를 빠져나옵니다.
이제는 linux 가 부팅하면서 자동으로 apache 를 동작하게 변경하도록 합니다.
shell> cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
shell> cd /etc/rc.d/rc3.d
shell> ln -s /etc/rc.d/init.d/httpd S85httpd
apache 설치의 모든 과정이 끝이 났습니다. 이제 apache를 작동해 보도록 하죠.
shell> /etc/rc.d/init.d/httpd start
3.3 pop3 server
pop3 server 는 redhat6.2 버전에는 이미 깔려 있을겁니다.
vi 같은 편집기로 /etc/inetd.conf 를 열어보시면 다음과 같이 주석 처리 되어 있을겁니다.
#pop-2 stream tcp nowait root /usr/sbin/tcpd ipop2d
#pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d
#imap stream tcp nowait root /usr/sbin/tcpd imapd
그러면 주석처리 되어 있는 부분을 다음과 같이 풀어줍니다.
#pop-2 stream tcp nowait root /usr/sbin/tcpd ipop2d
pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d
#imap stream tcp nowait root /usr/sbin/tcpd imapd
저장하고 나와서 inetd를 다음과 같이 restart 시켜주세요.
shell> /etc/rc.d/init.d/inetd restart
그러면 pop3 가 제대로 작동하는지 알아보도록 하겠습니다. 다음과 같이 shell 에서 telnet 으로 110 번 포트에 접속을 시도해 봅니다.
shell> telnet localhost 110
화면에 다음과 같이 나오면 Pop3 server가 정상적으로 동작하고 있다고 볼 수 있습니다.
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
+OK POP3 localhost v7.64 server ready
이 상태에서
user "일반사용자 계정"
라고 치고 엔터를 쳐봅니다.
그리고,
pass "계정 패스워드"
라고 치고 엔터를 칩니다.
만약 제대로 설정이 되어 있다면 다음과 유사한 내용이 화면에 출력될겁니다.
Connected to localhost (127.0.0.1).
Escape character is '^]'.
+OK POP3 localhost v7.64 server ready
user userid
+OK User name accepted, password please
pass userpassword
+OK Mailbox open, 0 messages
위와 같은 메시지가 나오면 Pop3 서버가 정상적으로 동작하는 겁니다.
이제는 quit 라고 쳐서 접속을 끊습니다.
quit
+OK Sayonara
Connection closed by foreign host.
만약 이렇게 되지 않을경우나 pop3 server를 재설치 할경우 http://www.eudora.com/qpopper/ 에서
qpopper 최신 버전을 다운 받아서 설치하실 수 있습니다.
3.3.1 qpoper
다음과 같이 다운로드 받은 파일의 압축을 풀고 해당 디렉토리로 이동합니다.
shell> tar xvfz qpopper3.1.2.tar.gz
shell> cd qpopper3.1.2
만약 shadow password 방식을 사용하는 시스템이라면 configure 옵션에 --enable-specialauth 를 추가해 주도록 합니다.
그리고 컴파일을 합니다.
shell> ./configure --enable-specialauth
shell> make
shell> cd popper
먼저 생성된 popper를 복사한다.
shell> cp popper /usr/local/lib
만일 /usr/local/lib 디렉토리가 없다면 mkdir 명령으로 생성시켜주세요. 디렉토리가 존재할 경우 mkdir 명령을 내릴 필요없이 복사 작업만 하시면 됩니다.
이제는 /etc/services ,/etc/inetd.conf 화일을 수정해야 합니다.
/etc/services 화일에 다음과 같은 부분이 있는지 확인을 하시고 만일 없다면 추가를 해주세요.
pop3 110/tcp # popper
/etc/inetd.conf의 화일도 다음과 같은 부분이 있는지 확인을 하고 없으면 추가해주세요.
pop3 stream tcp nowait root /usr/local/lib/popper popper -s
이제는 inetd를 다음과 같이 restart 해줍니다.
shell> /etc/rc.d/init.d/inetd restart
그리고 위에서와 같이 테스트해 보도록 합니다.
shell> telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK QPOP (version 3.1) at localhost starting.
user userid
+OK Password required for myname.
pass userpassword
+OK myname has 0 messages (0 octets).
quit
+OK Pop server at localhost signing off.
Connection closed by foreign host.
이런식으로 메세지가 나오면 제대로 설치가 된 것입니다.
4. netmania mail 설치
netmania mail 을 설치하기 전에 MySQL ,apache (with php4),pop3 server ,smtp server(sendmail or qmail) 등이 설치가 되어 있어야 합니다.
만약 이런것이 설치 되어 있지 않으면 "3. 준비" 를 참고 해서 프로그램들을 설치해주세요.
netmania mail 에서는 install.me 라는 installer프로그램으로 쉽게 설치할 수 있습니다. 이 installer 는 perl로 만들어져 있어서 이 installer로 설치하기 위해서는 Perl 5 가 깔려 있어야 합니다. 대부분의 리눅스 시스템에서는 기본으로 Perl 5가 깔려 있습니다.
이 프로그램은 단계별로 구성되어있고 총 3단계로 되어있습니다.
1단계 => file copy
2단계 => MySQL setting
3단계 => conf 파일 수정
이런 순서로 설치를 하게 됩니다.
4.1 install.me를 이용한 설치
우선 install을 하기 전에 사용자는 root 권한으로 모든 작업을 해야 한다는 것을 다시한번 상기시켜 드리겠습니다. 그리고 mysql의 root 패스워드 또한 알고 있어야 합니?
이것은 MySQL 에 database 와 user 를 추가 하기 위해서 입니다.
모든 작업준비가 끝났으면 netmania website (http://www.netmania.org/) 에서 받은 netmania-1.0.1.tar.gz의 압축과 tar를 풀어줍니다.
shell>tar zxvf netmania-1.0.1.tar.gz
그리고 생성된 디렉토리로 이동하여서 인스톨 프로그램을 실행시킵니다.
shell> cd netmania-1.0.1
shell> perl install.me
그러면 다음과 같은 주의 문구가 나올겁니다.
[netmania mail Installer version 1.0.2 ]
[NOTICE!] This install program MUST be run as root, and
to connect to MySQL db, root password of MySQL is needed. If not
quit install program by press control+C.
[Session 1. File copy ]
Please locate the path where netmania mail will be
installed. [/usr/local/netmania]
enter를 치면 /usr/local/netmnaia 에 깔리게 되며 수정하고 싶으면 원하는 디렉토리 패쓰를 입력하면 됩니다.
성공하면 "[Session 1. File copy -- END --]" 이라는 문구가 나오고 다음 단계인 mysql setting이 나오게 됩니다.
[Session 1. File copy -- END --]
[Session 2. Mysql Setting ]
Please locate the path where MySQL is installed
[/usr/local/mysql] /usr/local/mysql <== mysql 이 설치된 디렉토리를 적어주면 됩니다.
What is the hostname of MySQL [localhost] ? <== mysql 이 설치된 server 주소를 적어주면 됩니다..
Please type MySQL root password.--> rootpasswd <== mysql 의 root의 password 를 적어줍니다.
We're going to add new database to MySQL.
Please type new database name [netmania] --> netmania <== netmania mail 에서 사용할 database name
We're going to add new user to MySQL.
Please type new user name [webmail] --> webmail <== netmania mail 에서 사용할 mysql id
Please type password of new user --> ****** <== 새로 만들 id의 패스워드
Connecting MySQL to add new database and to add new user..........
[Session 2. Mysql Setting -- END --]
위와 같은 메세지가 나오면서 3단계로 들어가게 됩니다.
다음과 같은 메세지가 나타납니다.
[Session 3. conf file setting ]
conf/db_auth.conf file writing..........
Please type server name of e-mail address
ex)if your email address is 'user@email.com'
, server name is 'email.com' --> netmania.org <== 사용할 email 주소의 서버이름을 쓰면 됩니다.
다음과 같은 메세지가 나타나면 끝이납니다.
Installation End.
이제는 apach server 의 document root 세팅만 하면 됩니다.
Apache의 httpd.conf 파일을 vi 같은 편집기로 열어서 수정합니다.
shell> vi /usr/local/apache/conf/httpd.conf
DocumentRoot를 지정하는 내용을 찾아서 다음과 같이 수정해 줍니다.
DocumentRoot "/usr/local/netmania/conf/htdocs"
위과 같이 수정하였으면 다음과 같이 apache 를 재시작 해줍니다.
shell>/etc/rc.d/init.d/httpd restart
여기 까지 되었으면, install 작업이 끝이 나게 됩니다.
만일 이미 기존에 사용하던 웹서비스가 있었고 웹메일 서비스를 추가하시는 경우라면 Apache의 httpd.conf에서 가상호스트를 잡아주셔야 합니다.
이 경우라면 httpd.conf를 vi 같은 편집기에서 열고 다음과 같이 수정해주어야 합니다.
shell>vi /usr/local/apache/conf/httpd.conf
파일을 연 다음 가상호스트의 내용을 다음과 같은 내용을 입력해 주시면 됩니다.
NameVirtualHost xxx.xxx.xxx.xxx <== 서버의 IP 주소를 적어주시면 됩니다.
<VirtualHost xxx.xxx.xxx.xxx> <== 역시 서버의 IP주소를 적습니다.
ServerAdmin admin@netmania.org <== 서버 관리자의 이메일 주소를 적습니다.
DocumentRoot /usr/local/netmania/conf/htdocs <== 위에서 사용한 DocumentRoot와 같습니다.
ServerName webmail.netmania.org <== 새로 가상호스트로 잡으려는 서버이름을 적습니다.
ErrorLog logs/webmail-netmania-error_log <== 에러로그 파일의 이름을 지정해 줍니다.
CustomLog logs/en-netmania-access_log common <== 로그 파일의 이름을 지정해 줍니다.
</VirtualHost>
위와 같이 수정하셨다면 저장하시고 Apache를 재시동 해주셔야 합니다.
shell>/etc/rc.d/init.d/httpd restart
만일 httpd.conf에서 가상호스트 관련 부분만을 따로 빼서 별도의 파일로 관리하신다면 별도의 파일을 고치시면 됩니다.
4.2 수동 설치
다운받으신 파일의 압축을 푸시고 생성된 디렉토리로 이동합니다.
shell> cd netmania-1.0.1
먼저 다음과 같이 필요한 디렉토리와 파일들을 복사합니다.
shell> cp -R htdocs/ conf/ /usr/local/netmania <== 설치할 디렉토리를 적어주시면 됩니다.
다음 createuser.sql 파일을 열고 new_database, new_user, new_passwd 를 각각 적당하게 수정합니다.
shell> cd DB_information
shell> vi createuser.sql
다음과 같이 하여 table를 구성합니다.
shell> cat mailbox.sql | /usr/local/mysql/bin/mysql --user=new_user --password=**** new_database
shell> cat mailfolder.sql | /usr/local/mysql/bin/mysql --user=new_user --password=**** new_database
shell> cat pop3.sql | /usr/local/mysql/bin/mysql --user=new_user --password=**** new_database
shell> cat profile.sql | /usr/local/mysql/bin/mysql --user=new_user --password=**** new_database
이번에는 conf 파일을 수정합니다.
shell> cd /usr/local/netmania/conf
shell> cp db_auth.conf.default db_auth.conf
shell> cp webmail.conf.default webmail.conf
shell> vi db_auth.conf
/* Connect to host */
$DB_HOSTNAME = "localhost"; <== MySQL 서버 host name을 적습니다.
/* Database to use */
$DB_DATABASE_NAME = "database_name"; <== 이번에 새로추가한 database name을 적습니다.
/* User for login */
$DB_USER_NAME = "user_name"; <== 이번에 새로추가한 db id 을 적습니다.
/* Password to use when connecting to server */
$DB_USER_PASSWD = "user_passwd"; <== 이번에 새로추가한 db id 의 password 을 적습니다.
/* Port number to use for connection */
$DB_PORT = ":3306";
/* Socket filename to use for connection */
$DB_PATH_SOCKET = ":/tmp/mysql.sock";
다음과 같은 디렉토리를 추가하고 퍼미션을 변경합니다.
nobody.nobody 로 변경한 것은 apache 실행 퍼미션과 일치 시키기 위한 작업입니다.
만약 apache가 다른 퍼미션으로 작동하고 있으면 그 퍼미션에 맞게 수정하시면 됩니다.
shell> mkdir /usr/local/netmania/maildata
shell> chown -R nobody.nobody /usr/local/netmania/maildata
이제는 apache server 의 document root 세팅만 하면 됩니다.
shell> vi /usr/local/apache/conf/httpd.conf
DocumentRoot "/usr/local/netmania/conf/htdocs"
다음과 같이 수정하고 apache 를 재시작 하시면 됩니다.
축하합니다! 여기까지 잘 되었다면 install 작업이 끝이 난겁니다.
'linux > Mail' 카테고리의 다른 글
qmail 설치 가이드(qmail+checkpassword) (0) | 2007.03.16 |
---|---|
qmail FAQ (0) | 2007.03.16 |
qmail 과 삶 (0) | 2007.03.16 |
qmail+phpmail+imap4.7 (0) | 2007.03.15 |
qmail+checkpassword+phpmail-임시 (0) | 2007.03.15 |