[XP홈폐이지구축방안-3] 아파치 서버 설정 하기 < 가상호스트 설정>
여기서 가상호스트를 위한 계정 디렉토리를 공간을 미리 만들어 둔다.
이제 본격적으로 아파치 설정을 시작한다.
C:\Server\APMServer\Server\Apache\conf\ httpd.conf 열어서 아래 설정내용을
변경한다. 자기 시스템 상황에 맞게 말이다.
==================================================================
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule log_rotate_module modules/mod_log_rotate.so
è 이 4개는 주석이 되어 있다면 풀어주어야 한다. 그래야만 가상호스트를 사용할수 있다.
ServerAdmin admin@linuxsunny.pe.kr
ServerName linuxsunny.pe.kr
<IfModule dir_module>
DirectoryIndex index.php index.html index.htm
</IfModule>
아래 이 두가지 설정 파일을 불러오는 부분이 주석처리 되어 있으면 안된다.
반드시 주석을 풀어준다.
# User home directories
Include conf/extra/httpd-userdir.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
대부분 이 정도만 설정해도 web서버 홈폐이지 구축에는 문제 없다.
이제 추가 설정파일을 편집해야 한다. 아래처럼 응용해서 편집하면 된다.
C:\Server\APMServer\Server\Apache\conf\extra\ 안에 들어가서
httpd-userdir + httpd-vhosts 이 두 개 파일을 편집한다.
httpd-userdir.conf 의 내용
=============================================================
UserDir "www"
#
<Directory "C:/Server/APMServer/user/*/www">
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
=============================================================
httpd-vhosts.conf 의 내용
======================================================================
# Virtual Hosts
NameVirtualHost *:80
#### 메인 홈 폐이지 ######
<VirtualHost *:80>
ServerAdmin webmaster@linuxsunny.pe.kr
DocumentRoot "C:/Server/APMServer/user/bunny/www"
ServerName linuxsunny.pe.kr
ServerAlias www.linuxsunny.pe.kr
ErrorLog "logs/linuxsunny.pe.kr-error.log"
CustomLog "logs/linuxsunny.pe.kr-access.log" common
</VirtualHost>
###### 버니 개인 블로그 폐이지 #####
<VirtualHost *:80>
ServerAdmin webmaster@linuxsunny.pe.kr
DocumentRoot "C:/Server/APMServer/user/bunnyblog/www"
ServerName bunny.linuxsunny.pe.kr
ServerAlias blog.linuxsunny.pe.kr
ErrorLog "logs/blog.linuxsunny.pe.kr-error.log"
CustomLog "logs/blog.linuxsunny.pe.kr-access.log" common
</VirtualHost>
#### 버니 포럼 폐이지 #####
<VirtualHost *:80>
ServerAdmin webmaster@linuxsunny.pe.kr
DocumentRoot "C:/Server/APMServer/user/form/www"
ServerName from.linuxsunny.pe.kr
ServerAlias fm.linuxsunny.pe.kr
ErrorLog "logs/form.linuxsunny.pe.kr-error.log"
CustomLog "logs/form.linuxsunny.pe.kr-access.log" common
</VirtualHost>
========================================================================
이렇게 설정하고 저장하면 아파치 가상 호스트 설정은 끝난다.