2007년 11월 14일 수요일

Apache의 Default Host

403 Forbidden You don't have permission to access
Apache 설치 후 http.conf 파일에 VirtualHost를 설정하여서 사용하고 있었는데 *.domain.com 주소가 동작을 하지 않더군요. 이것저것 다 설정해보고 동료 분의 http.conf와 비교도 해봤는데 원인을 찾지 못했었는데 방금 '올빼미'님의 도움으로 해결했습니다. 해결방법은...(Virtual Host에서 주소를 찾지 못할 때도 403이 발생하더군요)

'http.conf의 VirtualHost들이 정의되어 있는 리스트에서 디폴트 동작을하는 VirtualHost 정의는 맨 처음에 위치해야 한다'입니다. (As a consequence, the first listed virtual host is the default virtual host.)

   NameVirtualHost *

<VirtualHost *>
ServerName *.domain.tld
DocumentRoot /www/domain
</VirtualHost>

<VirtualHost *>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>
관련 링크 : Named-based Virtual Host Support

댓글 없음:

댓글 쓰기