서버 설정 · 5 min read · Oct 02, 2025

완벽한 서버 - Ubuntu 14.10 (nginx, BIND, Dovecot, ISPConfig 3)

이 튜토리얼은 ISPConfig 3 설치를 위해 nginx, BIND, Dovecot이 포함된 Ubuntu 14.10 (Utopic Unicorn) 서버를 준비하는 방법과 ISPConfig 3 설치 방법을 보여줍니다. ISPConfig 3는 웹 브라우저를 통해 다음 서비스를 구성할 수 있는 웹 호스팅 제어판입니다: Apache 또는 nginx 웹 서버, Postfix 메일 서버, Courier 또는 Dovecot IMAP/POP3 서버, MySQL, BIND 또는 MyDNS 네임서버, PureFTPd, SpamAssassin, ClamAV 등. 이 설정은 nginx (Apache 대신), BIND (MyDNS 대신), Dovecot (Courier 대신)을 다룹니다.

ISPConfig 3 매뉴얼

ISPConfig 3 사용 방법을 배우기 위해 ISPConfig 3 매뉴얼을 다운로드할 것을 강력히 권장합니다.

300페이지가 넘는 이 매뉴얼은 ISPConfig의 개념(관리자, 리셀러, 클라이언트)을 다루고, ISPConfig 3 설치 및 업데이트 방법을 설명하며, ISPConfig의 모든 양식 및 양식 필드에 대한 참조와 유효한 입력 예제를 포함하고, ISPConfig 3에서 가장 일반적인 작업에 대한 튜토리얼을 제공합니다. 또한 서버를 더 안전하게 만드는 방법을 설명하고 마지막에 문제 해결 섹션이 포함되어 있습니다.

1. 사전 참고

이 튜토리얼에서는 호스트 이름 server1.example.com과 IP 주소 192.168.0.100, 게이트웨이 192.168.0.1을 사용합니다. 이러한 설정은 귀하의 경우 다를 수 있으므로 적절한 곳에서 교체해야 합니다. 진행하기 전에 튜토리얼에 설명된 대로 Ubuntu 14.10의 기본 최소 설치가 필요합니다.

2. /etc/apt/sources.list 편집 및 Linux 설치 업데이트

/etc/apt/sources.list를 편집합니다. 파일에서 설치 CD를 주석 처리하거나 제거하고 universe 및 multiverse 저장소가 활성화되어 있는지 확인합니다. 다음과 같이 보여야 합니다:

nano /etc/apt/sources.list
# 

# deb cdrom:[Ubuntu-Server 14.10 _Utopic Unicorn_ - Release amd64 (20141022.2)]/ utopic main restricted

#deb cdrom:[Ubuntu-Server 14.10 _Utopic Unicorn_ - Release amd64 (20141022.2)]/ utopic main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://de.archive.ubuntu.com/ubuntu/ utopic main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ utopic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://de.archive.ubuntu.com/ubuntu/ utopic-updates main restricted
deb-src http://de.archive.ubuntu.com/ubuntu/ utopic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://de.archive.ubuntu.com/ubuntu/ utopic universe
deb-src http://de.archive.ubuntu.com/ubuntu/ utopic universe
deb http://de.archive.ubuntu.com/ubuntu/ utopic-updates universe
deb-src http://de.archive.ubuntu.com/ubuntu/ utopic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://de.archive.ubuntu.com/ubuntu/ utopic multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ utopic multiverse
deb http://de.archive.ubuntu.com/ubuntu/ utopic-updates multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ utopic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://de.archive.ubuntu.com/ubuntu/ utopic-backports main restricted universe multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ utopic-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu utopic-security main restricted
deb-src http://security.ubuntu.com/ubuntu utopic-security main restricted
deb http://security.ubuntu.com/ubuntu utopic-security universe
deb-src http://security.ubuntu.com/ubuntu utopic-security universe
deb http://security.ubuntu.com/ubuntu utopic-security multiverse
deb-src http://security.ubuntu.com/ubuntu utopic-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu utopic partner
# deb-src http://archive.canonical.com/ubuntu utopic partner

## Uncomment the following two lines to add software from Ubuntu's
## 'extras' repository.
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
# deb http://extras.ubuntu.com/ubuntu utopic main
# deb-src http://extras.ubuntu.com/ubuntu utopic main
~                                                        

그런 다음 다음을 실행합니다:

apt-get update

apt 패키지 데이터베이스를 업데이트하고

apt-get upgrade

최신 업데이트를 설치합니다(있는 경우). 업데이트의 일환으로 새로운 커널이 설치되는 경우, 이후 시스템을 재부팅해야 합니다:

reboot

3. 기본 셸 변경

/bin/sh는 /bin/dash에 대한 심볼릭 링크이지만, 우리는 /bin/dash가 아닌 /bin/bash가 필요합니다. 따라서 다음과 같이 합니다:

dpkg-reconfigure dash

Use dash as the default system shell (/bin/sh)? <– 아니요

이 작업을 수행하지 않으면 ISPConfig 설치가 실패합니다.

4. AppArmor 비활성화

AppArmor는 확장된 보안을 제공해야 하는 보안 확장(SELinux와 유사)입니다. 13.10부터 기본적으로 설치되지 않습니다. 설치 여부를 확인하겠습니다. 제 생각에는 안전한 시스템을 구성하는 데 필요하지 않으며, 일반적으로 장점보다 더 많은 문제를 일으킵니다(어떤 서비스가 예상대로 작동하지 않아 일주일 동안 문제를 해결한 후, 모든 것이 괜찮았고 AppArmor가 문제를 일으켰다는 것을 알게 되는 경우를 생각해 보십시오). 따라서 이를 비활성화합니다(나중에 ISPConfig를 설치하려면 필수입니다).

다음과 같이 비활성화할 수 있습니다:

service apparmor stop  
update-rc.d -f apparmor remove  
apt-get remove apparmor apparmor-utils

5. 시스템 시계 동기화

NTP (network time protocol) 서버와 시스템 시계를 동기화하는 것이 좋습니다. 다음을 실행하기만 하면 됩니다:

apt-get install ntp ntpdate

그러면 시스템 시간이 항상 동기화됩니다.

6. Postfix, Dovecot, MySQL, phpMyAdmin, rkhunter, binutils 설치

Postfix, Dovecot, MySQL, rkhunter 및 binutils를 단일 명령으로 설치할 수 있습니다:

apt-get install postfix postfix-mysql postfix-doc mariadb-client mariadb-server openssl getmail4 rkhunter binutils dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve sudo

다음 질문이 표시됩니다:

MySQL “root” 사용자에 대한 새 비밀번호: <– yourrootsqlpassword
MySQL “root” 사용자에 대한 비밀번호를 반복 입력하세요: <– yourrootsqlpassword
자체 서명된 SSL 인증서를 생성하시겠습니까?: <– 예
호스트 이름: <– server1.example.com
로컬 전용: <– 확인
메일 구성의 일반 유형: <– 인터넷 사이트
시스템 메일 이름: <– server1.example.com

다음으로 Postfix에서 TLS/SSL 및 제출 포트를 엽니다:

nano /etc/postfix/master.cf

제출 및 smtps 섹션의 주석을 제거하고 다음과 같이 -o smtpd_client_restrictions=permit_sasl_authenticated,reject 줄을 두 섹션 모두에 추가한 후 나머지는 주석 처리된 상태로 둡니다:

[...]
submission inet n       -       -       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
smtps     inet  n       -       -       -       -       smtpd
  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
[...]

그런 다음 Postfix를 재시작합니다:

service postfix restart

MySQL이 localhost뿐만 아니라 모든 인터페이스에서 수신 대기하도록 하려면 /etc/mysql/my.cnf를 편집하고 bind-address = 127.0.0.1 줄의 주석을 제거합니다:

nano /etc/mysql/my.cnf
[...]
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address           = 127.0.0.1
[...]

그런 다음 MySQL을 재시작합니다:

service mysql restart

이제 네트워킹이 활성화되었는지 확인합니다. 다음을 실행합니다:

netstat -tap | grep mysql

출력은 다음과 같아야 합니다:

root@server1:~# netstat -tap | grep mysql  
tcp        0      0 *:mysql                 *:*                     LISTEN      23785/mysqld    
root@server1:~#

7. Amavisd-new, SpamAssassin 및 Clamav 설치

amavisd-new, SpamAssassin 및 ClamAV를 설치하려면 다음을 실행합니다:

apt-get install amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 arj nomarch lzop cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl

ISPConfig 3 설정은 내부적으로 SpamAssassin 필터 라이브러리를 로드하는 amavisd를 사용하므로 RAM을 확보하기 위해 SpamAssassin을 중지할 수 있습니다:

service spamassassin stop  
update-rc.d -f spamassassin remove

clamav를 실행하려면

freshclam  
service clamav-daemon start
Share: X/Twitter LinkedIn

새 게시물을 받은 편지함에서 받기

스팸은 없습니다. 언제든지 구독 해지 가능합니다.