서버 설정 · 3 min read · Jan 22, 2026
완벽한 서버 - Debian Wheezy (Apache2, BIND, Dovecot, ISPConfig 3) - 페이지 3
4 SSH 서버 설치 (선택 사항)
시스템 설치 중 OpenSSH 서버를 설치하지 않았다면 지금 설치할 수 있습니다:
apt-get install ssh openssh-server이제부터 PuTTY와 같은 SSH 클라이언트를 사용하여 작업 스테이션에서 Debian Wheezy 서버에 연결하고 이 튜토리얼의 나머지 단계를 따를 수 있습니다.
5 vim-nox 설치 (선택 사항)
이 튜토리얼에서는 vi를 텍스트 편집기로 사용할 것입니다. 기본 vi 프로그램은 Debian과 Ubuntu에서 이상한 동작을 하므로 이를 수정하기 위해 vim-nox를 설치합니다:
apt-get install vim-nox(joe나 nano와 같은 다른 텍스트 편집기를 사용하는 경우 이 작업을 수행할 필요는 없습니다.)
6 네트워크 구성
Debian Wheezy 설치 프로그램이 DHCP를 통해 네트워크 설정을 가져오도록 시스템을 구성했기 때문에, 서버는 정적 IP 주소를 가져야 하므로 이를 변경해야 합니다. /etc/network/interfaces를 편집하고 필요에 맞게 조정합니다 (이 예제 설정에서는 IP 주소 192.168.0.100을 사용할 것입니다) (eth0에 대해 allow-hotplug를 auto로 교체하는 점에 유의하십시오; 그렇지 않으면 네트워크를 재시작할 수 없으며 전체 시스템을 재부팅해야 합니다):
vi /etc/network/interfaces| # 이 파일은 시스템에서 사용 가능한 네트워크 인터페이스와 이를 활성화하는 방법을 설명합니다. # 자세한 내용은 interfaces(5)를 참조하십시오. # 루프백 네트워크 인터페이스 auto lo iface lo inet loopback # 기본 네트워크 인터페이스 #allow-hotplug eth0 #iface eth0 inet dhcp auto eth0 iface eth0 inet static address 192.168.0.100 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.1 |
그런 다음 네트워크를 재시작합니다:
/etc/init.d/networking restart그런 다음 /etc/hosts를 편집합니다. 다음과 같이 만듭니다:
vi /etc/hosts| 127.0.0.1 localhost.localdomain localhost 192.168.0.100 server1.example.com server1 # 다음 줄은 IPv6 지원 호스트에 대해 바람직합니다 ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters |
이제 다음을 실행합니다:
echo server1.example.com > /etc/hostname
/etc/init.d/hostname.sh start그 후 다음을 실행합니다:
hostname
hostname -f두 명령 모두 server1.example.com을 표시하는 것이 중요합니다!
7 Debian 설치 업데이트
먼저 /etc/apt/sources.list에 wheezy-updates 리포지토리가 포함되어 있는지 확인합니다 (이것은 ClamAV 바이러스 스캐너의 최신 업데이트를 항상 받을 수 있도록 보장합니다 - 이 프로젝트는 매우 자주 릴리스를 게시하며, 때때로 이전 버전이 작동을 멈춥니다), 그리고 contrib 및 non-free 리포지토리가 활성화되어 있는지 확인합니다 (libapache2-mod-fastcgi와 같은 일부 패키지는 기본 리포지토리에 없습니다).
vi /etc/apt/sources.list| deb http://ftp.de.debian.org/debian/ wheezy main contrib non-free deb-src http://ftp.de.debian.org/debian/ wheezy main contrib non-free deb http://security.debian.org/ wheezy/updates main contrib non-free deb-src http://security.debian.org/ wheezy/updates main contrib non-free # wheezy-updates, 이전에 'volatile'로 알려졌던 deb http://ftp.de.debian.org/debian/ wheezy-updates main contrib non-free deb-src http://ftp.de.debian.org/debian/ wheezy-updates main contrib non-free |
다음 명령을 실행합니다:
apt-get updateapt 패키지 데이터베이스를 업데이트하고
apt-get upgrade최신 업데이트를 설치합니다 (있는 경우).
8 기본 셸 변경
/bin/sh는 /bin/dash에 대한 심볼릭 링크이지만, 우리는 /bin/bash가 필요합니다, /bin/dash가 아닙니다. 따라서 다음을 수행합니다:
dpkg-reconfigure dash기본 시스템 셸로 dash를 사용합니까? <- 아니요
이 작업을 수행하지 않으면 ISPConfig 설치가 실패합니다.
9 시스템 시계 동기화
시스템 시계를 인터넷의 NTP (network time protocol) 서버와 동기화하는 것이 좋습니다. 간단히 다음을 실행합니다:
apt-get install ntp ntpdate그러면 시스템 시간이 항상 동기화됩니다.
10 Postfix, Dovecot, MySQL, phpMyAdmin, rkhunter, binutils 설치
Postfix, Dovecot, MySQL, rkhunter 및 binutils를 단일 명령으로 설치할 수 있습니다:
apt-get install postfix postfix-mysql postfix-doc mysql-client mysql-server openssl getmail4 rkhunter binutils dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve sudo다음 질문을 받게 됩니다:
메일 구성의 일반 유형: <– 인터넷 사이트
시스템 메일 이름: <– server1.example.com
MySQL “root” 사용자에 대한 새 비밀번호: <– yourrootsqlpassword
MySQL “root” 사용자에 대한 비밀번호 반복: <– yourrootsqlpassword
다음으로 Postfix에서 TLS/SSL 및 제출 포트를 엽니다:
vi /etc/postfix/master.cf제출 및 smtps 섹션의 주석을 제거합니다 (우리는 -o milter_macro_daemon_name=ORIGINATING이 필요하지 않으므로 그대로 둡니다):
| [...] 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 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 milter_macro_daemon_name=ORIGINATING [...] |
그 후 Postfix를 재시작합니다:
/etc/init.d/postfix restartMySQL이 localhost뿐만 아니라 모든 인터페이스에서 수신 대기하도록 하려면 /etc/mysql/my.cnf를 편집하고 bind-address = 127.0.0.1 줄의 주석을 제거합니다:
vi /etc/mysql/my.cnf| [...] # skip-networking 대신 기본값은 이제 # localhost에서만 수신 대기하는 것입니다. # 이는 더 호환성이 좋고 덜 안전하지 않습니다. #bind-address = 127.0.0.1 [...] |
그런 다음 MySQL을 재시작합니다:
/etc/init.d/mysql restart이제 네트워킹이 활성화되어 있는지 확인합니다. 다음을 실행합니다:
netstat -tap | grep mysql출력은 다음과 같아야 합니다:
root@server1:~# netstat -tap | grep mysql
tcp 0 0 *:mysql *:* LISTEN 26757/mysqld
root@server1:~#11 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-perlISPConfig 3 설정은 amavisd를 사용하여 SpamAssassin 필터 라이브러리를 내부적으로 로드하므로 RAM을 확보하기 위해 SpamAssassin을 중지할 수 있습니다:
/etc/init.d/spamassassin stop
update-rc.d -f spamassassin remove새 게시물을 받은 편지함에서 받기
스팸은 없습니다. 언제든지 구독 해지 가능합니다.