서버 설정 · 5 min read · Oct 30, 2025
완벽한 서버 - Debian 8.4 Jessie (Apache2, BIND, Dovecot, ISPConfig 3.1)
이 튜토리얼에서는 ISPConfig 3.1 설치를 위해 Apache2, BIND, Dovecot이 포함된 Debian Jessie 서버를 준비하는 방법과 ISPConfig 설치 방법을 보여줍니다. 웹 호스팅 제어판 ISPConfig 3을 사용하면 웹 브라우저를 통해 다음 서비스를 구성할 수 있습니다: Apache 또는 nginx 웹 서버, Postfix 메일 서버, Courier 또는 Dovecot IMAP/POP3 서버, MySQL, BIND 또는 MyDNS 네임서버, PureFTPd, SpamAssassin, ClamAV 등. 이 설정은 Apache(nginx 대신), BIND 및 Dovecot(Courier 대신)을 포함합니다.
1 사전 참고
이 튜토리얼에서는 호스트 이름 server1.example.com과 IP 주소 192.168.1.100 및 게이트웨이 192.168.1.1을 사용할 것입니다. 이러한 설정은 귀하의 경우 다를 수 있으므로 적절한 곳에서 교체해야 합니다. 계속 진행하기 전에 Debian 8의 최소 설치가 필요합니다. 이는 호스팅 제공업체에서 제공하는 Debian 최소 이미지일 수도 있고, Minimal Debian Server 튜토리얼을 사용하여 기본 시스템을 설정할 수도 있습니다.
이 튜토리얼의 새로운 점은 무엇인가요?
- 새로운 ISPConfig 3.1 기능 지원.
- Let’s Encrypt SSL 인증서 지원.
- PHP 스크립트를 실행하기 위한 HHVM(힙합 가상 머신) 지원.
- XMPP(메트로놈) 지원.
- Postgrey를 통한 이메일 그레이리스트 지원.
- Bastille를 대체하는 방화벽으로 UFW.
- Squirrelmail 대신 RoundCube 웹메일.
2 SSH 서버 설치 (선택 사항)
시스템 설치 중 OpenSSH 서버를 설치하지 않았다면 지금 설치할 수 있습니다:
apt-get install ssh openssh-server이제부터는 PuTTY와 같은 SSH 클라이언트를 사용하여 작업대에서 Debian Jessie 서버에 연결하고 이 튜토리얼의 나머지 단계를 따를 수 있습니다.
3 셸 텍스트 편집기 설치 (선택 사항)
이 튜토리얼에서는 nano 텍스트 편집기를 사용할 것입니다. 일부 사용자는 고전적인 vi 편집기를 선호하므로 두 편집기를 모두 설치하겠습니다. 기본 vi 프로그램은 Debian 및 Ubuntu에서 이상한 동작을 하므로 이를 수정하기 위해 vim-nox를 설치합니다:
apt-get install nano vim-noxvi가 선호하는 편집기라면 다음 명령에서 파일을 편집하기 위해 nano를 vi로 교체하십시오.
4 호스트 이름 구성
서버의 호스트 이름은 “server1.example.com”과 같은 하위 도메인이어야 합니다. “example.com”과 같은 하위 도메인 부분이 없는 도메인 이름을 호스트 이름으로 사용하지 마십시오. 이는 나중에 메일 설정에 문제를 일으킬 수 있습니다. 먼저 /etc/hosts에서 호스트 이름을 확인하고 필요할 경우 변경해야 합니다. 해당 줄은 다음과 같아야 합니다: “IP 주소 - 공백 - 전체 호스트 이름(도메인 포함) - 공백 - 하위 도메인 부분”. 우리의 호스트 이름 server1.example.com의 경우 파일은 다음과 같아야 합니다:
nano /etc/hosts127.0.0.1 localhost.localdomain localhost
192.168.1.100 server1.example.com server1
# IPv6 지원 호스트에 대해 바람직한 다음 줄
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters그런 다음 /etc/hostname 파일을 편집합니다:
nano /etc/hostname여기에는 하위 도메인 부분만 포함되어야 하며, 우리의 경우:
server1마지막으로 변경 사항을 적용하기 위해 서버를 재부팅합니다:
reboot다시 로그인하고 다음 명령으로 호스트 이름이 올바른지 확인합니다:
hostname
hostname -f출력은 다음과 같아야 합니다:
root@server1:/tmp# hostname
server1
root@server1:/tmp# hostname -f
server1.example.com5 Debian 설치 업데이트
먼저 /etc/apt/sources.list에 jessie/updates 리포지토리가 포함되어 있는지 확인하십시오(이렇게 하면 항상 최신 보안 업데이트를 받을 수 있습니다) 그리고 contrib 및 non-free 리포지토리가 활성화되어 있는지 확인하십시오(일부 패키지, 예: libapache2-mod-fastcgi는 기본 리포지토리에 없습니다).
nano /etc/apt/sources.list#deb cdrom:[Debian GNU/Linux 8.0.0 _Jessie_ - Official amd64 NETINST Binary-1 20150425-12:50]/ jessie main
deb http://ftp.us.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free실행:
apt-get updateapt 패키지 데이터베이스를 업데이트합니다
apt-get upgrade최신 업데이트를 설치합니다(있는 경우).
6 기본 셸 변경
/bin/sh는 /bin/dash에 대한 심볼릭 링크이지만, 우리는 /bin/dash가 아닌 /bin/bash가 필요합니다. 따라서 다음과 같이 합니다:
dpkg-reconfigure dash기본 시스템 셸로 dash를 사용합니까? <- 아니요
이 작업을 수행하지 않으면 ISPConfig 설치가 실패합니다.
7 시스템 시계 동기화
시스템 시계를 인터넷의 NTP(network time protocol) 서버와 동기화하는 것이 좋습니다. 간단히 실행하십시오:
apt-get install ntp그러면 시스템 시간이 항상 동기화됩니다.
8 Postfix, Dovecot, MySQL, 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 dovecot-lmtpd sudoMySQL을 MariaDB보다 선호하는 경우 위 명령에서 “mariadb-client mariadb-server” 패키지를 “mysql-client mysql-server”로 교체하십시오.
다음 질문이 표시됩니다:
일반 메일 구성 유형: <– 인터넷 사이트
시스템 메일 이름: <– server1.example.com
MariaDB “root” 사용자에 대한 새 비밀번호: <– yourrootsqlpassword
MariaDB “root” 사용자에 대한 비밀번호 반복: <– yourrootsqlpassword
MariaDB / MySQL 설치를 보안하고 테스트 데이터베이스를 비활성화하려면 다음 명령을 실행하십시오:
mysql_secure_installation우리는 설치 중에 새 비밀번호를 설정했기 때문에 MySQL 루트 비밀번호를 변경할 필요가 없습니다. 질문에 다음과 같이 답하십시오:
루트 비밀번호를 변경하시겠습니까? [Y/n] <-- n
익명 사용자 제거? [Y/n] <-- y
원격에서 루트 로그인 금지? [Y/n] <-- y
테스트 데이터베이스 및 이에 대한 접근 제거? [Y/n] <-- y
권한 테이블을 지금 다시 로드하시겠습니까? [Y/n] <-- y다음으로 Postfix에서 TLS/SSL 및 제출 포트를 엽니다:
nano /etc/postfix/master.cf제출 및 smtps 섹션의 주석을 제거하고 필요한 경우 줄을 추가하여 master.cf 파일의 이 섹션이 아래와 정확히 같아 보이도록 합니다.
[...]
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=
# -o smtpd_relay_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=
# -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
[...]그 후 Postfix를 재시작합니다:
service postfix restart우리는 MariaDB가 localhost뿐만 아니라 모든 인터페이스에서 수신 대기하도록 하기를 원하므로 /etc/mysql/my.cnf를 편집하고 bind-address = 127.0.0.1 줄의 주석을 제거합니다:
nano /etc/mysql/my.cnf[...]
# skip-networking 대신 기본값은 이제
# localhost에서만 수신 대기하는 것입니다. 이는 더 호환성이 좋고 덜 안전하지 않습니다.
#bind-address = 127.0.0.1
[...]그런 다음 MySQL을 재시작합니다:
service mysql restart이제 네트워킹이 활성화되었는지 확인합니다. 실행:
netstat -tap | grep mysql출력은 다음과 같아야 합니다:
root@server1:/# netstat -tap | grep mysql
tcp6 0 0 [::]:mysql [::]:* LISTEN 16806/mysqld9 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 postgreyISPConfig 3 설정은 내부적으로 SpamAssassin 필터 라이브러리를 로드하는 amavisd를 사용하므로 RAM을 확보하기 위해 SpamAssassin을 중지할 수 있습니다:
service spamassassin stop
systemctl disable spamassassin9.1 Metronome XMPP 서버 설치 (선택 사항)
이 단계에서는 XMPP 프로토콜과 호환되는 채팅 서버를 제공하는 Metronome XMPP 서버를 설치합니다. 이 단계는 선택 사항이며, 채팅 서버가 필요하지 않은 경우 이 단계를 건너뛸 수 있습니다. 다른 ISPConfig 기능은 이 소프트웨어에 의존하지 않습니다.
Debian에 Prosody 패키지 리포지토리를 추가합니다.
echo "deb http://packages.prosody.im/debian jessie main" > /etc/apt/sources.list.d/metronome.list
wget http://prosody.im/files/prosody-debian-packages.key -O - | sudo apt-key add -패키지 목록을 업데이트합니다:
apt-get update그리고 apt로 패키지를 설치합니다.
apt-get install git lua5.1 liblua5.1-0-dev lua-filesystem libidn11-dev libssl-dev lua-zlib lua-expat lua-event lua-bitop lua-socket lua-sec luarocks luarocksluarocks install lpcMetronome을 위한 셸 사용자를 추가합니다.
adduser --no-create-home --disabled-login --gecos 'Metronome' metronome/opt 디렉토리에 Metronome을 다운로드하고 컴파일합니다.
cd /opt; git clone https://github.com/maranda/metronome.git metronome
cd ./metronome; ./configure --ostype=debian --prefix=/usr
make
make install이제 Metronome이 /opt/metronome에 설치되었습니다.
새 게시물을 받은 편지함에서 받기
스팸은 없습니다. 언제든지 구독 해지 가능합니다.