2010年1月9日 星期六

wamp 虛擬主機設置方式(多個網域對應一個IP主機)

1.
先找到C:\wamp\Apache2\conf 下的httpd.conf
找這一行
Include conf/extra/httpd-vhosts.conf
然後把#號取消

2.
C:\wamp\Apache2\conf\extra 下的httpd-vhosts.conf
改成這樣
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
#
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
# 宣告虛擬網站所要使用的IP
NameVirtualHost 120.xxx.116.31:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any block.
#


# 第一個虛擬網站(即原來的主網站名稱)
DocumentRoot C:/wamp/www/
ServerName www.xxx.com.tw

# 第二個虛擬網站
DocumentRoot C:/wamp/www/aircool
ServerName aircool.xxx.com.tw


3.去設定網址的DNS對應 "新增"將 123.xxx.com.tw 的A記錄 對應到你的主機IP


沒有留言:

張貼留言