웹사이트 검색

Ubuntu 18.04 LTS에서 IRedMail 서버를 설정하는 방법


이 페이지에서

  1. 요구 사항\n
  2. 시작하기\n
  3. iRedMail 설치
  4. iRedMail 웹 인터페이스에 액세스

iRedMail은 서버에 필요한 모든 메일 서버 구성 요소를 자동으로 설치하고 구성하는 무료 오픈 소스 메일 서버 솔루션입니다. iRedMail을 사용하면 내장된 웹 인터페이스를 통해 원하는 만큼 사서함을 만들 수 있습니다. 메일, 폴더, 체 필터를 관리하기 위한 웹 기반 인터페이스를 제공합니다. OpenLDAP, MySQL, MariaDB, PostgreSQL을 사용하여 사서함을 저장합니다. IRedMail 서버는 Postfix, Dovecot, Nginx, OpenLdap, Amavised, SpamAssassin, ClamAV, Roundcube, SOGo, Netdata 및 Fail2ban을 포함한 여러 구성 요소로 구성됩니다.

이 튜토리얼에서는 Ubuntu 18.04 서버에서 iRedMail을 사용하여 완전한 기능을 갖춘 메일 서버를 설정하는 방법을 배웁니다.

요구 사항

  • Ubuntu 18.04를 실행하는 서버.\n
  • 고정 IP 주소 192.168.0.101이 서버에 설정되어 있습니다.
  • 루트 비밀번호가 서버에 설정됩니다.\n

시작하기

먼저 최신 버전으로 서버를 업데이트해야 합니다. 다음 명령으로 수행할 수 있습니다.

apt-get update -y
apt-get upgrade -y

서버가 업데이트되면 시스템을 다시 시작하여 모든 변경 사항을 적용하십시오.

다음으로 서버에서 FQDN을 설정해야 합니다. 다음 명령으로 수행할 수 있습니다.

hostnamectl set-hostname test.example.com

다음으로 /etc/hosts 파일을 열고 다음 줄을 추가합니다.

nano /etc/hosts

다음 줄을 추가합니다.

192.168.0.101 test.example.com test

완료되면 파일을 저장하고 닫습니다. 그런 다음 다음 명령을 실행하여 모든 변경 사항을 적용합니다.

hostname -f

완료되면 다음 단계로 진행할 수 있습니다.

아이레드메일 설치

먼저 웹사이트에서 최신 버전의 iRedMail 설치 프로그램을 다운로드해야 합니다. 다음 명령으로 다운로드할 수 있습니다.

wget https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.9.9.tar.bz2

다운로드가 완료되면 다음 명령을 사용하여 다운로드한 파일의 압축을 풉니다.

tar xjf iRedMail-0.9.9.tar.bz2

그런 다음 디렉터리를 iRedMail-0.9.9로 변경하고 다음 명령으로 설치 프로그램을 실행합니다.

cd iRedMail-0.9.9
bash iRedMail.sh

설치하는 동안 iRedMail 메일 서버를 설정하기 위한 몇 가지 질문에 답하라는 메시지가 표시됩니다.

먼저 아래와 같이 시작 화면이 표시되어야 합니다.

이제 Enter 버튼을 누릅니다. 다음 페이지가 표시됩니다.

여기에서 사서함을 저장할 전체 경로를 제공하십시오. 그런 다음 다음 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

여기에서 Nginx를 웹 서버로 선택하고 다음 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

여기에서 MariaDB를 데이터베이스로 선택하고 다음 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

여기에서 MariaDB 루트 암호를 제공하고 다음 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

그런 다음 도메인 이름을 입력하고 다음 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

그런 다음 메일 도메인 관리자의 비밀번호를 설정하고 다음 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

그런 다음 모든 도구를 선택하고 다음 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

*************************************************************************
***************************** WARNING ***********************************
*************************************************************************
*                                                                       *
* Below file contains sensitive infomation (username/password), please  *
* do remember to *MOVE* it to a safe place after installation.          *
*                                                                       *
*   * /root/iRedMail-0.9.9/config
*                                                                       *
*************************************************************************
********************** Review your settings *****************************
*************************************************************************

* Storage base directory:               /var/vmail
* Mailboxes:                            
* Daily backup of SQL/LDAP databases:   
* Store mail accounts in:               MariaDB
* Web server:                           Nginx
* First mail domain name:               example.com
* Mail domain admin:                    
* Additional components:                Roundcubemail SOGo netdata iRedAdmin Fail2ban

< Question > Continue? [y|N]y

이제 선택한 모든 옵션을 검토하십시오. 그런 다음 y를 입력하고 Enter 키를 눌러 설치를 계속합니다. 일단 설치가 성공적으로 완료되었습니다. 다음 출력이 표시되어야 합니다.

*************************************************************************
* iRedMail-0.9.9 installation and configuration complete.
*************************************************************************

< Question > Would you like to use firewall rules provided by iRedMail?
< Question > File: /etc/default/iptables, with SSHD ports: 22. [Y|n]n
[ INFO ] Skip firewall rules.
[ INFO ] Updating ClamAV database (freshclam), please wait ...
ERROR: /var/log/clamav/freshclam.log is locked by another process
********************************************************************
* URLs of installed web applications:
*
* - Roundcube webmail: https://test.example.com/mail/
* - SOGo groupware: https://test.example.com/SOGo/
* - netdata (monitor): https://test.example.com/netdata/
*
* - Web admin panel (iRedAdmin): https://test.example.com/iredadmin/
*
* You can login to above links with below credential:
*
* - Username: 
* - Password: admin123
*
*
********************************************************************
* Congratulations, mail server setup completed successfully. Please
* read below file for more information:
*
*   - /root/iRedMail-0.9.9/iRedMail.tips
*
* And it's sent to your mail account 
*
********************* WARNING **************************************
*
* Please reboot your system to enable all mail services.
*
********************************************************************

이제 다음 명령을 사용하여 모든 메일 서비스를 활성화하려면 서버를 다시 시작하십시오.

reboot

다음으로 설치 후 iRedMail 구성 파일도 제거해야 합니다. 사용자 이름과 비밀번호가 포함되어 있기 때문입니다. 다음 명령으로 삭제할 수 있습니다.

rm -rf /root/iRedMail-0.9.9/config

다음 명령을 사용하여 로그를 확인할 수도 있습니다.

tail -f /var/log/mail.log

다음 출력이 표시되어야 합니다.

May 25 03:24:26 ubuntu1804 postfix/master[2379]: daemon started -- version 3.3.0, configuration /etc/postfix
May 25 03:24:32 ubuntu1804 amavis[983]: starting. /usr/sbin/amavisd-new at test.example.com amavisd-new-2.11.0 (20160426), Unicode aware, LC_ALL="C", LANG="en_US.UTF-8"
May 25 03:24:37 ubuntu1804 amavis[2434]: Net::Server: Group Not Defined.  Defaulting to EGID '122 122'
May 25 03:24:37 ubuntu1804 amavis[2434]: Net::Server: User Not Defined.  Defaulting to EUID '118'
May 25 03:24:37 ubuntu1804 amavis[2434]: No ext program for   .F, tried: unfreeze, freeze -d, melt, fcat
May 25 03:24:37 ubuntu1804 amavis[2434]: No ext program for   .zoo, tried: zoo, unzoo
May 25 03:24:37 ubuntu1804 amavis[2434]: No decoder for       .F
May 25 03:24:37 ubuntu1804 amavis[2434]: No decoder for       .zoo
May 25 03:24:37 ubuntu1804 amavis[2434]: Using primary internal av scanner code for clamav-socket
May 25 03:24:37 ubuntu1804 amavis[2434]: Found secondary av scanner clamav-clamscan at /usr/bin/clamscan

다음으로 ClamAV 데이터베이스를 수동으로 업데이트해야 합니다.

먼저 다음 명령을 사용하여 freshcalm 서비스를 중지합니다.

systemctl stop clamav-freshclam

다음으로 다음 명령을 사용하여 ClamAV 데이터베이스를 업데이트합니다.

freshclam

다음 출력이 표시되어야 합니다.

Sat May 25 03:31:35 2019 -> ClamAV update process started at Sat May 25 03:31:35 2019
Sat May 25 03:31:35 2019 -> ^Your ClamAV installation is OUTDATED!
Sat May 25 03:31:35 2019 -> ^Local version: 0.100.3 Recommended version: 0.101.2
Sat May 25 03:31:35 2019 -> DON'T PANIC! Read https://www.clamav.net/documents/upgrading-clamav
Sat May 25 03:31:35 2019 -> main.cvd is up to date (version: 58, sigs: 4566249, f-level: 60, builder: sigmgr)
Sat May 25 03:37:55 2019 -> Downloading bytecode.cvd [100%]
Sat May 25 03:38:02 2019 -> bytecode.cvd updated (version: 328, sigs: 94, f-level: 63, builder: neo)
Sat May 25 03:38:03 2019 -> *Can't query bytecode.328.93.1.0.6810DB54.ping.clamav.net
Sat May 25 03:38:17 2019 -> Database updated (6146486 signatures) from db.local.clamav.net (IP: 104.16.219.84)
Sat May 25 03:38:17 2019 -> ^Clamd was NOT notified: Can't connect to clamd through /var/run/clamav/clamd.ctl: No such file or directory

메일 서버에 대한 자세한 정보는 /root/iRedMail-0.9.9/iRedMail.tips 파일을 참조하십시오.

완료되면 다음 단계로 진행할 수 있습니다.

iRedMail 웹 인터페이스에 액세스

이제 iRedMail이 설치 및 구성되었습니다. 웹 인터페이스에 액세스할 시간입니다.

웹 브라우저를 열고 URL https://test.example.com/iredadmin을 입력합니다. 자체 서명된 인증서가 기본적으로 사용되기 때문에 인증서 경고를 받을 수 있습니다. 다음 페이지로 리디렉션됩니다.

이제 사용자 이름과 비밀번호를 제공하십시오. 그런 다음 로그인 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

Roundcube 웹 메일에 액세스하여 설치 후 생성된 이메일을 읽을 수도 있습니다. URL https://test.example.com/mail을 입력하여 Roundcube 웹 메일에 액세스합니다.

축하합니다! Ubuntu 18.04 서버에 iRedMail을 성공적으로 설치하고 구성했습니다. 이제 웹 브라우저를 통해 사용자 메일 계정을 쉽게 만들 수 있습니다. 궁금한 점이 있으면 언제든지 문의해 주세요.