Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- live8
- The Frames
- 닷넷DB연동
- 광야에서
- 닷넷공부법
- 닷넷게시판만들기
- 김광석
- 닷넷게시판리스트
- 게시판페이징
- 윈폰7
- 서호주
- 웹프로그래밍
- wp7
- U2
- 서호주여행
- 여행
- ASP.NET
- 퍼스
- 안치환
- 백스트리트보이스
- swell season
- Perth
- 가족영화
- 영화
- BSB
- 안치환콘서트
- 유용주
- asp
- 안치환공연
- 전라도여행
Archives
- Today
- Total
새로운 시작, GuyV's lIfe sTyle.
아파치 가상호스트 설정 예제. 본문
Apache virtual host..
Okay I got it going on my box just using localhost and listen on different ports.
The Document root had to start from root /var/www/html/...
In my directories I have
/var/www/html/test1/index.html
/var/www/html/test2/index.html
I configured appache to also listen to port 8000
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80
Listen 8000
Then modified the virtual hosts to point to the different folders...
NameVirtualHost *:80
NameVirtualHost *:8000
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /var/www/html/test1
ServerName test1.com
</VirtualHost>
<VirtualHost *:8000>
DocumentRoot /var/www/html/test2
ServerName test2.com
</VirtualHost>
Restart apache, open a browser and voila - http://localhost displays /test1/index.html and http://localhost:8000 displays /test2/index.html
Okay I got it going on my box just using localhost and listen on different ports.
The Document root had to start from root /var/www/html/...
In my directories I have
/var/www/html/test1/index.html
/var/www/html/test2/index.html
I configured appache to also listen to port 8000
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80
Listen 8000
Then modified the virtual hosts to point to the different folders...
NameVirtualHost *:80
NameVirtualHost *:8000
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /var/www/html/test1
ServerName test1.com
</VirtualHost>
<VirtualHost *:8000>
DocumentRoot /var/www/html/test2
ServerName test2.com
</VirtualHost>
Restart apache, open a browser and voila - http://localhost displays /test1/index.html and http://localhost:8000 displays /test2/index.html
- http://fedoraforum.org/forum/archive/index.php/t-147521.html
반응형
'ⓟrogramming' 카테고리의 다른 글
MySQL CSV 파일 import (0) | 2008.11.20 |
---|---|
APM6 + XP Mysql 한글깨짐 해결 (0) | 2008.11.20 |
[Rails] Controller -> View (0) | 2008.10.23 |
Ruby, 모델을 이용해 Select 하는 예제.. (0) | 2008.10.02 |
레일즈 튜토리얼 (0) | 2008.09.11 |
Comments