아파치 virtualhost 설정
<VirtualHost localhost2>
ServerAdmin postmaster@localhost2
DocumentRoot "/workspace/localhost2"
ServerName localhost2
ErrorLog "logs/localhost2.error.log"
CustomLog "logs/localhost2.access.log" combined
</VirtualHost>
<VirtualHost localhost>
ServerAdmin postmaster@localhost
DocumentRoot "/xampplite/htdocs"
ServerName localhost
ErrorLog "logs/localhost.error.log"
CustomLog "logs/localhost.access.log" combined
</VirtualHost>
위와 같이 로컬에서 http://localhost2/ 와 http://localhost/ 두가지 호스트를 돌리려고 합니다.
system32 폴더에서 어디론가 들어가 host 설정하는 데에 localhost2도 추가 해뒀고요.
문제는 localhost2라고 치든 localhost라고 치든 virtualhost의 맨 첫번째 설정이 모두 적용되고 있습니다. 즉 위와 같은 경우는 localhost2가 무조건 뜨고, virtualhost 설정 두개의 순서를 바꾸면 localhost가 뜨게 됩니다.
혹시 어디를 더 살펴봐야 할지 힌트 주시면 감사하겠습니다. ^^
ServerAdmin postmaster@localhost2
DocumentRoot "/workspace/localhost2"
ServerName localhost2
ErrorLog "logs/localhost2.error.log"
CustomLog "logs/localhost2.access.log" combined
</VirtualHost>
<VirtualHost localhost>
ServerAdmin postmaster@localhost
DocumentRoot "/xampplite/htdocs"
ServerName localhost
ErrorLog "logs/localhost.error.log"
CustomLog "logs/localhost.access.log" combined
</VirtualHost>
위와 같이 로컬에서 http://localhost2/ 와 http://localhost/ 두가지 호스트를 돌리려고 합니다.
system32 폴더에서 어디론가 들어가 host 설정하는 데에 localhost2도 추가 해뒀고요.
문제는 localhost2라고 치든 localhost라고 치든 virtualhost의 맨 첫번째 설정이 모두 적용되고 있습니다. 즉 위와 같은 경우는 localhost2가 무조건 뜨고, virtualhost 설정 두개의 순서를 바꾸면 localhost가 뜨게 됩니다.
혹시 어디를 더 살펴봐야 할지 힌트 주시면 감사하겠습니다. ^^
댓글 3개
15년 전
C:\WINDOWS\system32\drivers\etc에 있는 hosts파일에서
127.0.0.1 localhost2
127.0.0.1 localhost
와 같이 설정을 해주세요.
127.0.0.1 localhost2
127.0.0.1 localhost
와 같이 설정을 해주세요.
15년 전
그건 이미 설정해뒀습니다.. 만약 안했다면 http://localhost2/ 라고 치면 아무것도 안 떴겠죠?
15년 전
우오오옷! 해결했습니다.
NameVirtualHost *:80
이렇게 name-based virtual hosting을 사용하도록 설정해줘야 하는군요. 위 내용이 주석 처리 되어있어서나타나는 현상이었습니다.
며칠동안 속썩이던 게 해결되었습니다! ^^
NameVirtualHost *:80
이렇게 name-based virtual hosting을 사용하도록 설정해줘야 하는군요. 위 내용이 주석 처리 되어있어서나타나는 현상이었습니다.
며칠동안 속썩이던 게 해결되었습니다! ^^
게시판 목록
토크
개발과 관련된 어떤 얘기도 괜찮습니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 3600 |
nature1235
|
10개월 전 | 434 | |
| 3599 |
swallow
|
2년 전 | 1344 | |
| 3598 |
swallow
|
2년 전 | 1190 | |
| 3597 |
swallow
|
2년 전 | 794 | |
| 3596 | 2년 전 | 1413 | ||
| 3595 | 2년 전 | 692 | ||
| 3594 | 2년 전 | 1410 | ||
| 3593 |
|
3년 전 | 1235 | |
| 3592 |
|
3년 전 | 1569 | |
| 3591 |
|
3년 전 | 1483 | |
| 3590 |
|
3년 전 | 1435 | |
| 3589 |
|
3년 전 | 1237 | |
| 3588 |
|
3년 전 | 1222 | |
| 3587 |
|
4년 전 | 1137 | |
| 3586 |
|
4년 전 | 1370 | |
| 3585 |
|
4년 전 | 1292 | |
| 3584 |
|
4년 전 | 1036 | |
| 3583 |
Arm코리아
|
4년 전 | 1132 | |
| 3582 |
|
4년 전 | 1240 | |
| 3581 |
|
4년 전 | 2196 | |
| 3580 |
|
4년 전 | 1266 | |
| 3579 |
|
4년 전 | 1298 | |
| 3578 |
|
4년 전 | 1532 | |
| 3577 | 4년 전 | 1669 | ||
| 3576 |
|
4년 전 | 1660 | |
| 3575 |
|
4년 전 | 1670 | |
| 3574 |
|
4년 전 | 2090 | |
| 3573 |
|
4년 전 | 1547 | |
| 3572 |
|
4년 전 | 1533 | |
| 3571 |
|
4년 전 | 1612 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기