![]() by 저자에대해: 저자는 스위스에서 웹마스터와 유닉스 관리자로 일하고 있다. 저자는 Linux, unix, Perl, Apache와 GPL s/w등에 관심을 가지고 있다. 저자에 대한 더 자세한 것은 저자의 홈페이지에서 발견할 수 있다. 차례: |
Abstract:
이 문서는 Unix와 Linux상에서 아파치를 사용하여 같은 IP 주소를 사용하는 여러개의 버추얼 웹서버를 운영하는 법을 보인다. 이 문서는 독자가 아파치와 DNS 그리고 Unix에 대해 기본적인 지식을 가지고 있다고 가정한다. 이 문서의 주 독자는 ISP와 시스템 관리자 그리고 배우기를 원하는 모든 사람들이다.
IP 주소를 재사용 하는 것은 여러가지 이유에서 유용하다.
NameVirtualHost 192.168.1.1:80
#Host for unix files
ServerName unix.hometranet.home
DocumentRoot /www/unix/html
ScriptAlias /cgi-bin/ /www/unix/cgi-bin/
TransferLog /www/unix/logs/access_log
ErrorLog /www/unix/logs/error_log
#Host for perl stuff
ServerName perl.hometranet.home
DocumentRoot /www/perl/html
ScriptAlias /cgi-bin/ /www/perl/cgi-bin/
TransferLog /www/perl/logs/access_log
ErrorLog /www/perl/logs/error_log
#Here we host some cool Apache stuff
ServerName apache.hometranet.home
DocumentRoot /www/apache/html
ScriptAlias /cgi-bin/ /www/apache/cgi-bin/
TransferLog /www/apache/logs/access_log
ErrorLog /www/apache/logs/error_log
위와 같이 추가하면 하나의 IP주소로 쉽게 3개의 버추얼 호스트를 덧 붙일 수 있다.perl.hometranet.home. IN A 192.168.1.1 apache.hometranet.home. IN A 192.168.1.1 unix.hometranet.home. IN A 192.168.1.1
이것은 새로운 기능이다. 아파치는 호스트 이름에 와일드카드를 사용하는 것을 허용한다.
이것은 당신이 도메인을 *.home.hometranet.home과 같이 설정할 수 있다는 것을 의미한다. 그리고 user1.home.hometranet.home, user2.home.hometranet.home, user3.home.hometranet.home등등에 대한 모든 질의는 응답될 수 있게 된다.
예:
#host for users
ServerName home.hometranet.home
ServerAlias *.home.hometranet.home
DocumentRoot /www/home/html
TransferLog /www/home/logs/access_log
ErrorLog /www/home/logs/error_log
그리고 zone 파일 안에서의 항목.
*.home.hometranet.home. IN A 192.168.1.1
주의 : 이러한 트릭은 당신이 만약 마이크로 소프트의 DNS Server를 사용한다면 작동되지 않는다. 마이크로 소프트의 DNS Server는 호스트이름에서 와일드카드를 사용하는것을 허용하지 않는다.이것은 좀더 자세한 설절 파일입니다. 이것은 저의 메인 httpd.conf 파일에서 추출한 것입니다.
이것은 제 서버에서 정확히 작동합니다.
이 파일을 httpd.conf에 추가시키기 위해서는 당신의 httpd.conf 파일안에서 Include 지시자를 사용하면 됩니다.
Include "/etc/vhosts.conf"
| 본 웹페이지는 리눅스포커스 편집자 팀에의해 관리됩니다. © Atif Ghaffar LinuxFocus 1999 |
1999-11-06, generated by lfparser version 0.9