.htaccess를 이용하는 방법도 있으나 파일도 하나 더 만들어야 되고 귀찮음.
그리고 각 서버 상태에 따라 이것저것 달라진다.
xampp에서 하려니 뭐 잘 안되기도 하고...
VirtualHost 설정시 그냥 같이 해버리는 방법이 짱인 듯.
xampp 기준으로 C:\xampp\apache\conf\extra\httpd-vhosts.conf 파일을 아래처럼 수정해주면 가능함.
NameVirtualHost *
<VirtualHost *>
ServerName localhost
DocumentRoot "C:\xampp\htdocs"
</VirtualHost>
<VirtualHost *>
ServerName myhome.localhost.com
DocumentRoot "C:\myhome"
<Directory "C:\myhome">
AllowOverride All
Options All
php_value include_path ".;C:\xampp\php\pear;C:\myhome\mylibrary"
</Directory>
</VirtualHost>
<VirtualHost *>
ServerName localhost
DocumentRoot "C:\xampp\htdocs"
</VirtualHost>
<VirtualHost *>
ServerName myhome.localhost.com
DocumentRoot "C:\myhome"
<Directory "C:\myhome">
AllowOverride All
Options All
php_value include_path ".;C:\xampp\php\pear;C:\myhome\mylibrary"
</Directory>
</VirtualHost>
'Apache' 카테고리의 다른 글
[Apache] 2.4 버전에서 403 에러시 [authz_core:error AH01630: client denied by server configuration] (4) | 2012.12.11 |
---|---|
[Apache] xampp 1.7.3 아파치 시작 안되는 현상. (0) | 2010.12.01 |
[Apache] 네트워크 드라이브를 DocumentRoot로 사용하기 (2) | 2010.07.26 |
[Apache] mod_ruid (각 사용자별 권한설정) (0) | 2010.05.19 |
Windows에서 VirtualHost 설정 (0) | 2009.09.21 |