>> Edit article
이름
제목
패스워드
naribi@sinet.pe.kr http://sinet.pe.kr/~naribi Virtual Hosting ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 작성자 : 부일이동통신 윤오영(statjoe@nownuri.net ) 작성일 : 1998.07.07. < KRNIC's comment > o 본 기술자료는 - 하나의 웹서버에서 - 각각 별개의 도메인이름을 가지고 있는 많은 홈페이지들을 - 하나의 IP주소로서(C class 1개가 아니라, 1개의 host address를 의미함) 서비스할 수 있도록 하는 인터넷 신기술 "Virtual hosting"에 대해 기술한 것이다. o 그동안의 많은 웹호스팅서비스제공기관(WSP)들이 이와 같은 기술적 내용을 알지 못해, 도메인이름이 틀린 각 홈페이지마다 하나의 IP주소를 부여해 줌으로서, IP주소 낭비를 초 래하여 왔던 것이 사실이다. o 앞으로는 본 기술자료를 활용함으로서, 하나의 웹호스팅서버에는 반드시 1개의 IP주소만 을 사용하도록 하여야 하며, 그간 낭비되어 왔던 IP주소들은 모두 연결 ISP에게 반납하여 야 한다. 1. 시작 ·Virtual Hosting 서비스 - 인터넷을 이용한 서비스를 제공하려고 해도 환경이 구축되지 업체가 기존의 인터넷 서비스 업체에 장비를 대여하여 자신의 도메인명으로 서비스를 하는 것 - 대표적인 서비스 : virtual Web 서비스, virtual mail 서비스 등 ·Virtual Web 서비스 - 일반적으로 하나의 호스트에 하나의 웹서버, 하나의 웹서버에 하나의 url을 지원하지만, HTTP/1.1 규약의 multihosting 사양을 지원하는 Apache_1.2.x를 이용하면 하나의 host 에 많은 domain name을 지원함 (HTTP/1.1 을 지원하는 모든 server에서 가능) ·Virtual Mail 서비스 - 기존의 internet mail 서비스는 계정(mail box)이 있다는 가정 하에서나 가능 - sendmail 8.7.x 이상에서 Berkeley DB 1.85 library를 이용하여 여러 개의 domain name 을 가진 호스트에서 해당 도메인네임으로 mail 수신을 가능하게 해주어 virtual hosting 서비스를 받는 업체가 외부적으로는 마치 자신의 mail server를 가지고 있는 것처럼 느 끼게 해줌 - 지원하는 email address 개수 당으로 과금 할 때, 실제 mailbox를 제공하는 서비스도 있고, 타 호스트(예: 상용 통신 서비스) mail box로 forwarding만 하는 서비스도 있음 ·abc.co.kr(ABC화학)의 예 - 부일이동통신은 virtual hosting 전용 server 는 web.eyes.co.kr이다. - ABC화학은 abc.co.kr 도메인네임으로 web 서비스와 mail 서비스를 받고자 한다. - ABC화학에서 신청하는 도메인 네임인 ABC.CO.KR을 KRNIC에 신청 대행해주고, DNS 서비스를 해줌 - ABC.CO.KR에 대한 홈페이지와 mail을 운영하기 위한 계정인 ipabc를 발급해줌 - DNS 서비스, WEB 서비스, mail 서비스를 위한 configuration 해줌 2. Web Server Setting 주) 아래의 setting 설명은 기존에 apache server에 대한 기본적인 setting 능력이 가능하다 는 가정에서 virtual hosting부분에 주안점을 둔 것임 ·Apache Server Configuration - internet에서 가장 많이 쓰이고 있는 web server - NCSA server의 configuration과 유사 - Apache server source, binary 및 documentation은 http://www.apache.org/에서 얻을 수 있다. - Apache server는 아래의 4개의 configuration file로 구성된다. httpd.conf basic server configuration file, server's operation의 기본적인 부분을 다루고 있다. access.conf access configuration file, file이나 user에 따라서 허락되어지는 operation을 다룬다. srm.conf resource configuration file, request를 받았을 때 server가 local resource를 어떻게 처 리하는가를 다루고 있다. mime.types MIME types file, file확장자와 MIME types를 연관시키는 기능을 한다. 참고. 위의 4개의 configuration file의 예제는 기본적으로 server에서 제공한다. ·다양한 domain에 대한 virtual hosting setting SAMPLE 1. httpd.conf (Virtual hosting의 모든 setting은 여기서 행해진다.) ServerType standalone Port 80 HostnameLookups off User nobody Group nobody BrowserMatch Mozilla/2 nokeepalive ServerAdmin izweb@eyes.co.kr ServerRoot /usr/local/etc/apache_1.2.4 ErrorLog /var/log/error_log TransferLog /var/log/access_log PidFile logs/httpd.pid ScoreBoardFile logs/apache_status ServerName web.eyes.co.kr---> Default Server Name Timeout 300 KeepAlive On MaxKeepAliveRequests 0 KeepAliveTimeout 15 MinSpareServers 15 MaxSpareServers 30 StartServers 15 MaxClients 120 MaxRequestsPerChild 30 # VirtualHost: Allows the daemon to respond to requests for more than one ----> Domain Name 지정 ServerAdmin izweb@eyes.co.kr DocumentRoot /home1/webhost/ipabc/html ----> DocumentRoot 지정 ServerName abc.co.kr ErrorLog /var/log/error_log TransferLog /var/log/access_log ServerAdmin izweb@eyes.co.kr DocumentRoot /home1/webhost/ipabc/html ServerName www.abc.co.k ErrorLog /var/log/error_log TransferLog /var/log/access_log ▷ 일반적으로 하나의 host에 하나의 web server, 하나의 web server에 하나의 url을 지원하지만, HTTP/1.1 규약의 multihosting 사양을 지원하는 Apache_1.2.x를 이용하면 하나의 host에 많은 domain name을 지원함 2. access.conf Options FollowSymLinks ExecCGI Includes AllowOverride None order deny,allow deny from all allow from all ---> 특정 디렉토리에 대한 user인증 AuthType Basic 을 기본적인 web server에서 AuthName ABC 화학 게시판지원 AuthUserFile /home1/webhost/ipabc/.htaccess Options All require valid-user ▷ 기본적으로 웹서버에서 지원하는 User인증을 사용하기 위해서, apache_1.2.x/support/htpasswd file을 이용하여 .htaccess file을 생성 및 추가 할 수 있음 login & passwd 신청 후 즉시 자동으로 .htaccess file을 update하기 위해서 Expect를 이용하면 될듯함 ·참고 서적 Exploring Expect A Tcl-based Toolkit for Automating Interactive Programs - O'Reilly & Associates, Inc. 3. srm.conf DocumentRoot /home1/web/html ---> Default Document Root 지정 UserDir html DirectoryIndex index.html index.htm index.shtml FancyIndexing on 아 래 생 략 ▷ Default ServerName의 DocumentRoot는 일반적으로 srm.conf에서 지정함 4. server 구동 명령어 ▷ 구동 명령어 # /usr/local/etc/apache_1.2.4/src/httpd -f /usr/local/etc/apache_1.2.4/conf/httpd.conf ? ▷ Booting시 작동시키는 rc Script의 위치 위치 : /etc/rc3.d/S90httpd #!/bin/sh if [ -f /usr/local/etc/apache_1.2.4/src/httpd ]; then echo " [httpd ] Start............" /usr/local/etc/apache_1.2.4/src/httpd -f /usr/local/etc/apache_1.2.4/conf/httpd.conf else echo " [/usr/local/etc/apache_1.2.4/src/httpd] File Not Found..." fi ·참고 서적 Apache The Definitive Guide - O'Reilly & Associates, Inc. 3. Mail Server Setting 주. 아래의 setting 설명은 기존에 sendmail에 대한 기본적인 setting 능력이 가능하다는 가 정에서 virtual hosting부분에 주안점을 둔 것임 ·sendmail source을 구한다. - sendmail, makemap을 compile할 때 db관련 tag가 주어져야 함 - 이를 위해서 기본적으로 Berkeley DataBase Package가 install되어 있어야 함 - sendmail 8.8.x에는 DB 1.85를, sendmail 8.9.x에는 DB 2.0이 지원됨 - sendmail 관련 site : http://www.sendmail.org/ - Berkeley DB site : http://www.sleepycat.com/ ·Berkeley DB 1.85 를 compile하여, libdb.a를 만듬 - db.1.85/README 참고 ·sendmail compile 1. sendmail-8.8.7H1/src/READ_ME를 참고 하여 sendmail compile Berkeley DB library를 이용키 위해서, DBMDEF 변수에 -DNEWDB, LIBS 변수에 -ldb를 설정함 아래는 sendmail-8.8.7H1/src/obj.SunOS.5.5.sun4/Makefile의 sample임 # # This Makefile is designed to work on the old "make" program. It does # not use the obj subdirectory. It also does not install documentation # automatically -- think of it as a quick start for sites that have the # old make program (I recommend that you get and port the new make if you # are going to be doing any signficant work on sendmail). # # This has been tested on Solaris 2.5. # # @(#)Makefile.SunOS.5.5 8.11 (Berkeley) 6/24/97 # # use O=-O (usual) or O=-g (debugging) # warning: do not use -O with versions of gcc prior to 2.6 O= -O CC= gcc # define the database mechanism used for alias lookups: # -DNDBM -- use new DBM # -DNEWDB -- use new Berkeley DB # -DNIS -- include NIS support # The really old (V7) DBM library is no longer supported. # See READ_ME for a description of how these flags interact. # #DBMDEF= -DNDBM -DNIS -DNISPLUS DBMDEF= -DNDBM -DNEWDB ---> compile시 Berkeley DB lib를 사용함 # environment definitions (e.g., -D_AIX3) ENVDEF= -DSOLARIS=20500 # see also conf.h for additional compilation flags # include directories #INCDIRS=-I/usr/sww/include INCDIRS=-I/home1/db.1.85/PORT/sunos.5.2 # library directories #LIBDIRS=-L/usr/sww/lib LIBDIRS=-I/home1/db.1.85/PORT/sunos.5.2 # libraries required on your system # delete -l44bsd if you are not running BIND 4.9.x # add -ldb if you add -DNEWDB above (in DBMDEF) #LIBS= -lresolv -l44bsd -lsocket -lnsl -lkstat LIBS= -lresolv -ldb -lsocket -lnsl -lkstat ---> compile시 Berkeley DB lib를 사용함 # location of sendmail binary (usually /usr/sbin or /usr/lib) BINDIR= ${DESTDIR}/usr/lib # location of sendmail.st file (usually /var/log or /usr/lib) STDIR= ${DESTDIR}/etc/mail # location of sendmail.hf file (usually /usr/share/misc or /usr/lib) HFDIR= ${DESTDIR}/etc/mail # additional .o files needed OBJADD= # things to be made before compilation begins BEFORE= sysexits.h ################### end of user configuration flags ###################### CFLAGS= -I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF} OBJS= alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o deliver.o domain.o envelope.o err.o headers.o macro.o main.o map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o safefile.o savemail.o srvrsmtp.o stab.o stats.o sysexits.o trace.o udb.o usersmtp.o util.o version.o ${OBJADD} LINKS= ${DESTDIR}/usr/bin/newaliases ${DESTDIR}/usr/bin/mailq ${DESTDIR}/usr/bin/hoststat ${DESTDIR}/usr/bin/purgestat INSTALL=/usr/ucb/install BINOWN= root BINGRP= sys BINMODE=6555 ALL= sendmail aliases.0 mailq.0 newaliases.0 sendmail.0 all: ${ALL} sendmail: ${BEFORE} ${OBJS} ${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS} makemap: ${BEFORE} ----> makemap을 compile 하기 위한 부분 ${CC} -o makemap makemap.c safefile.c -I. -DNEWDB -DNOT_SENDMAIL ${LIBDIRS} ${LIBS} mailstats: ${BEFORE} ${CC} -o mailstats mailstats.c -I. -I.. ${OBJ} ${LIBDIRS} ${LIBS} 참고하세여~ 퍼온글입니다. : 안녕하세요... : 한가지 궁굼한게 있어 이렇게 글을 씁니다. : : 보통 계정사용자홈페이지가 : : http://www.domain.com/~user/ 로 사용되는데 : : 이걸 : : http://user.domain.com/ : : 이렇게 사용할수 있는지 알고싶습니다. : : * 밑에 이런질문이 있어 답변을 보니 링크가 없더군요... : 알고 계신분 답변 부탁드립니다. : 감사합니다.--뜨거운 감자의 맛을 보기 위해선 시간과 노력을 투자해야만 한다..
Copyleft
1999-2026 by
JSBoard Open Project
Theme Designed by
IDOO
All right reserved