질문&답변
클라우드/리눅스에 관한 질문과 답변을 주고 받는 곳입니다.
리눅스 분류

★ 가상호스트(VirtualHost)에 관하여 질문드립니다.

작성자 정보

  • 김병삼 작성
  • 작성일

컨텐츠 정보

본문

반갑습니다 ^^;;

제가 지금 name based 가상 호스트를 구성중입니다...

그런데.. 문제가 좀 있습니다.

1) IP(111.222.333.444)로 접속시 : 디폴트 호스트로 접속이 되어 기본 페이지가 웹 브라우져 창에 뜹니다.

2) 도메인 aaa.co.kr 로 접속시 : 아이네임즈와 같은 곳에서 aaa.co.kr 도메인을 구입 후,  네임서버를 이쪽으로 돌려두었습니다. 접속은 1)과 같은 페이지가 뜹니다.(디폴트 호스트가 도메인 aaa.co.kr 와 같습니다)

3) 도메인 bbb.co.kr 로 접속시 : 역시 도메인을 구입하여 네임서버 역시 이쪽으로 돌려두었습니다. 그러나 웹 브라우저에서 보이는 페이지는 이상하게도 도메인 bbb.co.kr 의 페이지가 떠버립니다...

4) 지금 한 컴퓨터에 모든 써버가 얹혀져 있습니다. 그럴 경우... 메일 서버의 이름은 어떻게 되는 것입니까? zone 파일 설정 부분의 MX 코드 값을 적어줘야만 하는 것인지.. 안적어 줘도 되는 것인지... 일단은 MX 10 ns1.aaa.co.kr. 뭐 이렇게 작성은 하였습니다만... 그럴 경우... 도메인 bbb.co.kr 의 zone 파일 속의 MX 코드 값은 어떻게 되는 것일까요.. 그냥 같이 쓰면 되는 것인가요....;;;;;

5) 메일은 webmaster@aaa.co.kr 로 오는 것은 aaa 계정으로.... webmaster@bbb.co.kr 로 오는 것은 bbb 계정으로 오게끔 작성 하였습니다... 그런데... 작동을 하는 것인지.. 마는 것인지.. 메일 서버의 pop3 테스트를 텔넷으로 해 본 결과 이상은 없었습니다. 제가 할 수 있는 것은 다 한듯 합니다... >_<

 

현재 메일서버도 셑팅 중인데... 아웃룩에서 계정설정시 보내는 테스팅 메일은 정상적으로 도착을 하여 아웃룩에는 정상적인 쎝팅이 이루어 진 것 같습니다... 그러나 서버쪽으로 메일을 보내면 서버에서 메일을 받지를 못합니다... 애효... 뭐가 문젠지...

그러나 일단은 중요한 것이 웹입니다...

도메인이 멋대로니... 난감하군요...

대략적으로 이런 문제라면 어디를 손보면 될까요....

설정은 다 한 듯 합니다....

아파치, 네임서버, 존 등등....

참... 혹시 모르니 대략적인 파일 내용을 올려볼께요.. .보시고 답변 좀 부탁드립니다..

 

[[[[[[     httpd.conf     ]]]]]]=================================================================================


[/IfModule>

DefaultType text/plain

[IfModule mod_mime_magic.c>
    MIMEMagicFile /usr/local/apache/conf/magic
[/IfModule>

HostnameLookups Off

ErrorLog /usr/local/apache/logs/error_log

LogLevel warn

LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%h %l %u %t "%r" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

SetEnvIfNoCase Request_URI (gif|png|jpg|css|js|bmp|jpeg|swf)$ IMAGE=1
CustomLog /usr/local/apache/logs/access_log common env=!IMAGE

ServerSignature On
 EBCDICConvertByType Off=InOut */*

[IfModule mod_alias.c>

    Alias /icons/ "/usr/local/apache/icons/"

    [Directory "/usr/local/apache/icons">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    [/Directory>

    Alias /manual/ "/usr/local/apache/htdocs/manual/"

    [Directory "/usr/local/apache/htdocs/manual">
        Options Indexes FollowSymlinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    [/Directory>

    ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"

    [Directory "/usr/local/apache/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    [/Directory>

[/IfModule>

[IfModule mod_autoindex.c>

    IndexOptions FancyIndexing

    AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

    AddIconByType (TXT,/icons/text.gif) text/*
    AddIconByType (IMG,/icons/image2.gif) image/*
    AddIconByType (SND,/icons/sound2.gif) audio/*
    AddIconByType (VID,/icons/movie.gif) video/*

    AddIcon /icons/binary.gif .bin .exe
    AddIcon /icons/binhex.gif .hqx
    AddIcon /icons/tar.gif .tar
    AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
    AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
    AddIcon /icons/a.gif .ps .ai .eps
    AddIcon /icons/layout.gif .html .shtml .htm .pdf
    AddIcon /icons/text.gif .txt
    AddIcon /icons/c.gif .c
    AddIcon /icons/p.gif .pl .py
    AddIcon /icons/f.gif .for
    AddIcon /icons/dvi.gif .dvi
    AddIcon /icons/uuencoded.gif .uu
    AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
    AddIcon /icons/tex.gif .tex
    AddIcon /icons/bomb.gif core

    AddIcon /icons/back.gif ..
    AddIcon /icons/hand.right.gif README
    AddIcon /icons/folder.gif ^^DIRECTORY^^
    AddIcon /icons/blank.gif ^^BLANKICON^^

    DefaultIcon /icons/unknown.gif

    ReadmeName README.html
    HeaderName HEADER.html

    IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

[/IfModule>

[IfModule mod_mime.c>

    AddLanguage da .dk
    AddLanguage nl .nl
    AddLanguage en .en
    AddLanguage et .ee
    AddLanguage fr .fr
    AddLanguage de .de
    AddLanguage el .el
    AddLanguage he .he
    AddCharset ISO-8859-8 .iso8859-8
    AddLanguage it .it
    AddLanguage ja .ja
    AddCharset ISO-2022-JP .jis
    AddLanguage kr .kr
    AddCharset ISO-2022-KR .iso-kr
    AddLanguage nn .nn
    AddLanguage no .no
    AddLanguage pl .po
    AddCharset ISO-8859-2 .iso-pl
    AddLanguage pt .pt
    AddLanguage pt-br .pt-br
    AddLanguage ltz .lu
    AddLanguage ca .ca
    AddLanguage es .es
    AddLanguage sv .sv
    AddLanguage cs .cz .cs
    AddLanguage ru .ru
    AddLanguage zh-TW .zh-tw
    AddCharset Big5         .Big5    .big5
    AddCharset WINDOWS-1251 .cp-1251
    AddCharset CP866        .cp866
    AddCharset ISO-8859-5   .iso-ru
    AddCharset KOI8-R       .koi8-r
    AddCharset UCS-2        .ucs2
    AddCharset UCS-4        .ucs4
    AddCharset UTF-8        .utf8

    [IfModule mod_negotiation.c>
        LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
    [/IfModule>

    AddType application/x-tar .tgz
    AddType application/x-httpd-php .html .htm .php .php3 .php4 .php5 .phtml .cgi .jsp .conn .config .inc .con .cnf .set
    AddType application/x-httpd-php-source .phps

    AddEncoding x-compress .Z
    AddEncoding x-gzip .gz .tgz

    AddHandler cgi-script .cgi

[/IfModule>

[IfModule mod_setenvif.c>

    BrowserMatch "Mozilla/2" nokeepalive
    BrowserMatch "MSIE 4.0b2;" nokeepalive downgrade-1.0 force-response-1.0

    BrowserMatch "RealPlayer 4.0" force-response-1.0
    BrowserMatch "Java/1.0" force-response-1.0
    BrowserMatch "JDK/1.0" force-response-1.0

[/IfModule>

# IP로 접속 했을 때의 기본 호스트 설정
[VirtualHost 111.222.333.444>
    DocumentRoot /home/aaa/public_html
    ServerName aaa.co.kr
[/VirtualHost>

NameVirtualHost 111.222.333.444

[VirtualHost 111.222.333.444>
    ServerAdmin aaa@aaa.co.kr
    DocumentRoot /home/aaa/public_html
    ServerName aaa.co.kr
    ServerAlias www.aaa.co.kr
    ErrorLog logs/aaa_error_log
    CustomLog logs/aaa_log common
[/VirtualHost>

[VirtualHost 111.222.333.444>
    ServerAdmin bbb@bbb.co.kr
    DocumentRoot /home/bbb/public_html
    ServerName bbb.co.kr
    ServerAlias www.bbb.co.kr
    ErrorLog logs/bbb_error_log
    CustomLog logs/bbb_log common
[/VirtualHost>

[Directory "/home/*">
        AllowOverride All
        Options +ExecCGI
        Order allow,deny
        Allow from all
[/Directory>

 


[[[[[[     access     ]]]]]]=================================================================================
localhost.localdomain           RELAY
localhost                       RELAY
127.0.0.1                       RELAY
aaa.co.kr                       RELAY
bbb.co.kr                  RELAY

 

[[[[[[     local-host-names     ]]]]]]=================================================================================
aaa.co.kr
bbb.co.kr

 

[[[[[[     virtusertable     ]]]]]]=================================================================================
webmaster@aaa.co.kr             aaa
webmaster@bbb.co.kr        bbb

 

[[[[[[     named.conf     ]]]]]]=================================================================================
 // generated by named-bootconf.pl

options {
        directory "/var/named";
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
        // query-source address * port 53;
};

//
// a caching only nameserver config
//
controls {
        inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
        type hint;
        file "named.ca";
};

zone "localhost" IN {
        type master;
        file "localhost.zone";
        allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "named.local";
        allow-update { none; };
};


zone "aaa.co.kr" IN {
        type master;
        file "aaa.co.kr.zone";
        allow-update { none; };
};

zone "bbb.co.kr" IN {
        type master;
        file "bbb.co.kr.zone";
        allow-update { none; };
};

include "/etc/rndc.key";

 

[[[[[[     aaa.co.kr.zone     ]]]]]]=================================================================================
$TTL 300
@       IN      SOA     ns1.aaa.co.kr. webmaster.aaa.co.kr. (
                2005022212      ; serial
                3H              ; refresh
                15M             ; retry
                1W              ; expire
                300 )           ; TTL minimum
;
        IN      NS      ns1.aaa.co.kr.
        IN      MX      10 aaa.co.kr.
       
www     IN      A       111.222.333.444
mail    IN      A       111.222.333.444
*       IN      A       111.222.333.444

 

[[[[[[     bbb.co.kr.zone     ]]]]]]=================================================================================
$TTL 300
@       IN      SOA     ns1.aaa.co.kr. webmaster.bbb.co.kr. (
                2005022212      ; serial
                3H              ; refresh
                15M             ; retry
                1W              ; expire
                300 )           ; TTL minimum

        IN      NS      ns1.aaa.co.kr.
        IN      MX      10 bbb.co.kr.

www     IN      A       111.222.333.444
mail    IN      A       111.222.333.444
*       IN      A       111.222.333.444

 

[[[[[[     sendmail.mc     ]]]]]]=================================================================================
divert(-1)dnl
dnl #
dnl # This is the sendmail macro config file for m4. If you make changes to
dnl # /etc/mail/sendmail.mc, you will need to regenerate the
dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is
dnl # installed and then performing a
dnl #
dnl #     make -C /etc/mail
dnl #
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for Red Hat Linux')dnl
OSTYPE(`linux')dnl
dnl #
dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
dnl define(`SMART_HOST',`smtp.your.provider')
dnl #
define(`confDEF_USER_ID',``8:12'')dnl
define(`confTRUSTED_USER', `smmsp')dnl
dnl define(`confAUTO_REBUILD')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST',true)dnl
define(`confDONT_PROBE_INTERFACES',true)dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
dnl define(`STATUS_FILE', `/etc/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
dnl #
dnl # The following allows relaying if the user authenticates, and disallows
dnl # plaintext authentication (PLAIN/LOGIN) on non-TLS links
dnl #
dnl define(`confAUTH_OPTIONS', `A p')dnl
dnl #
dnl # PLAIN is the preferred plaintext authentication method and used by
dnl # Mozilla Mail and Evolution, though Outlook Express and other MUAs do
dnl # use LOGIN. Other mechanisms should be used if the connection is not
dnl # guaranteed secure.
dnl #
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl #
dnl # Rudimentary information on creating certificates for sendmail TLS:
dnl #     make -C /usr/share/ssl/certs usage
dnl #
dnl define(`confCACERT_PATH',`/usr/share/ssl/certs')
dnl define(`confCACERT',`/usr/share/ssl/certs/ca-bundle.crt')
dnl define(`confSERVER_CERT',`/usr/share/ssl/certs/sendmail.pem')
dnl define(`confSERVER_KEY',`/usr/share/ssl/certs/sendmail.pem')
dnl #
dnl # This allows sendmail to use a keyfile that is shared with OpenLDAP's
dnl # slapd, which requires the file to be readble by group ldap
dnl #
dnl define(`confDONT_BLAME_SENDMAIL',`groupreadablekeyfile')dnl
dnl #
dnl define(`confTO_QUEUEWARN', `4h')dnl
dnl define(`confTO_QUEUERETURN', `5d')dnl
dnl define(`confQUEUE_LA', `12')dnl
dnl define(`confREFUSE_LA', `18')dnl
define(`confTO_IDENT', `0')dnl
dnl FEATURE(delay_checks)dnl
FEATURE(`no_default_msa',`dnl')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
dnl #
dnl # The -t option will retry delivery if e.g. the user runs over his quota.
dnl #
FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db',`hash -T -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
dnl #
dnl # The following causes sendmail to only listen on the IPv4 loopback address
dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
dnl # address restriction to accept email from the internet or intranet.
dnl #
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
dnl #
dnl # The following causes sendmail to additionally listen to port 587 for
dnl # mail from MUAs that authenticate. Roaming users who can't reach their
dnl # preferred sendmail daemon due to port 25 being blocked or redirected find
dnl # this useful.
dnl #
dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
dnl #
dnl # The following causes sendmail to additionally listen to port 465, but
dnl # starting immediately in TLS mode upon connecting. Port 25 or 587 followed
dnl # by STARTTLS is preferred, but roaming clients using Outlook Express can't
dnl # do STARTTLS on ports other than 25. Mozilla Mail can ONLY use STARTTLS
dnl # and doesn't support the deprecated smtps; Evolution <1.1.1 uses smtps
dnl # when SSL is enabled-- STARTTLS support is available in version 1.1.1.
dnl #
dnl # For this to work your OpenSSL certificates must be configured.
dnl #
dnl DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
dnl #
dnl # The following causes sendmail to additionally listen on the IPv6 loopback
dnl # device. Remove the loopback address restriction listen to the network.
dnl #
dnl # NOTE: binding both IPv4 and IPv6 daemon to the same port requires
dnl #       a kernel patch
dnl #
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
dnl #
dnl # We strongly recommend not accepting unresolvable domains if you want to
dnl # protect yourself from spam. However, the laptop and users on computers
dnl # that do not have 24x7 DNS do need this.
dnl #
FEATURE(`accept_unresolvable_domains')dnl
dnl #
dnl FEATURE(`relay_based_on_MX')dnl
dnl #
dnl # Also accept email sent to "localhost.localdomain" as local email.
dnl #
LOCAL_DOMAIN(`localhost.localdomain')dnl
dnl #
dnl # The following example makes mail from this host and any additional
dnl # specified domains appear to be sent from mydomain.com
dnl #
dnl MASQUERADE_AS(`mydomain.com')dnl
dnl #
dnl # masquerade not just the headers, but the envelope as well
dnl #
dnl FEATURE(masquerade_envelope)dnl
dnl #
dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
dnl #
dnl FEATURE(masquerade_entire_domain)dnl
dnl #
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl
dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl

 

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,376 명
  • 현재 강좌수 :  37,051 개
  • 현재 접속자 :  298 명