서브 도메인 만드는 방법 알려주세요

http://도메인.com/blog

인데요

http://blog.도메인.com

으로 연결 해야되는데요.. 블로그들때문에요..(작동이안되네여ㅠ)

서버이전하기전에는 관리메뉴에서 쉽게했는데.. 가상호스팅받으면서 스스로 해야되어서...

검색으로 찾아봐도
2계정을 연결하는 방법은 나와있는데 계정내 디렉토리를 서브도메인으로 사용하는건 못찾겠드라그염 ㅠ
|

댓글 8개

zone에서 설정해줘야될껍니다.
named.conf에서 해당 도메인 zone파일 위치 보시고 거기서 편집해주세요
네임서버 개념으로 들어가기때문에 네임서버 공부하셔야되염
apache2.conf에서도 잡아줘야됩니당~~
2004년쯤 서버하나 운영하면서 적용했던것입니다.
그때는 잘되었는데 지금은 잘될지...

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

BIND zone파일에 대한 셋팅
존파일의 경우

test.com. IN A 111.111.111.111
*.test.com. IN A 111.111.111.111 <-- *.test.com으로 모든 서브도메인을 네임서버에서
잡아줍니다.

APACHE http.conf
먼저 아파치에서 자동서브도메인이 셋팅되도록할려면
mod_rewrite 모듈이 필요합니다. 컴파일시 첨부하거나 DSO(동적)방식으로 삽입을 해야합니다.

/home/계정명/폴더 <---- 해당 폴더가 서브도메인이 되도록 셋팅

<VirtualHost 000.000.000.000>
ServerAdmin webmaster@test.com ; // 관리자 이메일
DocumentRoot /home/test/www // 기본 웹 루트
ServerName test.com // 기본서버명
ServerAlias *.test.com // 모든 서브도메인을 Alias로 받습니다.
RewriteEngine on // RewriteEngine 활성화
RewriteCond %{HTTP_HOST} ^[^.]+\.test\.com$ // 서버명에 서브도메인 정규화로 매치
RewriteRule ^(.+) %{HTTP_HOST}$1 [C] // Cond에 해당되는 도메인에 대해서 도메인뒤에 나온 문장 매치
RewriteRule ^([^.]+)\.test\.com(.*) /home/test/$1/$2 서브도메인과 해당페이지 매치
ErrorDocument 404 /home/test/error/err-404.html
ErrorDocument 403 /home/test/error/err-403.html
ErrorLog /home/test/web_log/error_log
CustomLog /home/test/web_log/access_log common
</VirtualHost>

계정이용자들을 서브도메인으로
domain.com/~id를 id.domain.com으로
생략합니다.(상단은 같음)
RewriteEngine on
RewriteCond %{HTTP_HOST} ^[^.]+\.test\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+)\.test\.com(.*) /home/$1/www$2

이제 아파치 Restart하면 끝......*^^*
계정내 디렉토리는 RewriteRule 로 하시면 되겠고.

http://www.dnsever.com 여기 좋읍니다.
저도 그거 신뢰안하고 괴기고 있다가 본격으로 쓰기 시작한지는 겨우 3년 정도 돼는데
만족도 매우 좋습니다.
"BIND zone파일에 대한 셋팅 "

그 파일이 어딧죠?
vi /etc/named.conf 입력시

E325: ATTENTION
Found a swap file by the name "/etc/.named.conf.swp"
owned by: root dated: Tue Aug 11 13:05:24 2009
file name: /etc/named.conf
modified: no
user name: root host name: egghyun3.cafe24.com
process ID: 14447 (still running)
While opening file "/etc/named.conf"

(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.

(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r /etc/named.conf"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/etc/.named.conf.swp"
to avoid this message.
"/etc/named.conf" [New File]
Press ENTER or type command to continue
named.rfc1912.zones 이파일이 zone파일같데..

[root@egghyun3 etc]# vi ./named.rfc1912.zones
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
zone "." IN {
type hint;
file "named.ca";
};

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

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 "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
type master;
file "named.ip6.local";
allow-update { none; };
};

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

zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};
~
"./named.rfc1912.zones" 49L, 955C
저에게 질문하시는것 같은데 저도 손놓은지 오래라 잘모릅니다^^;;;
예전에 썼던거 텍스트파일로 해놓은게 있어서...

vi /etc/named.conf
zone "000.com" {
type master;
file "zone-000.com";
};

제가 쓰던 서버의 zone파일 위치는 /var/named/chroot/zone/zone-000.com 이였고
일반계정세팅하던 내용입니다 ↓

000.com은 세팅될 도메인

vi /var/named/chroot/zone/zone-000.com
@ IN SOA ns.000.com. admin.000.com. (
2001040501 ; serial
28800 ; refresh
14400 ; retry
3600000 ; expire
86400 ; default_ttl
)
@ IN NS ns.000.co.kr. <--네임서버인것 같음
@ IN A 222.222.222.222 <---서버아이피
@ IN HINFO "Unknown" "Unknown" <---??
@ IN MX 10 mail.000.com. <---메일
localhost IN A 127.0.0.1
ns IN CNAME @
www IN CNAME @
ftp IN CNAME @
mail IN A 222.222.222.222 <--메일서버아이피
test.com. IN A 111.111.111.111
*.test.com. IN A 111.111.111.111
댓글을 작성하시려면 로그인이 필요합니다. 로그인

자유게시판

+
제목 글쓴이 날짜 조회
16년 전 조회 1,125
16년 전 조회 1,146
16년 전 조회 1,409
16년 전 조회 1,215
16년 전 조회 1,110
16년 전 조회 1,098
16년 전 조회 1,541
16년 전 조회 1,717
16년 전 조회 1,796
16년 전 조회 2,098
16년 전 조회 1,449
16년 전 조회 1,705
16년 전 조회 1,163
16년 전 조회 1,142
16년 전 조회 2,913
16년 전 조회 2,759
16년 전 조회 1,163
16년 전 조회 1,126
16년 전 조회 1,124
16년 전 조회 1,318
16년 전 조회 1,976
16년 전 조회 1,714
16년 전 조회 1,756
16년 전 조회 1,439
16년 전 조회 1,316
16년 전 조회 1,693
16년 전 조회 3,911
16년 전 조회 4,861
16년 전 조회 1,833
16년 전 조회 4,781
🐛 버그신고