apache配置虚拟主机
#在httpd.conf 开启 virtual hosts include conf/extra/httpd-vhosts.conf
#然后在httpd-vhosts.conf 里面配置
#根据ip来匹配
# <virtualhost 127.0.0.1:80>
#    documentroot "e:/htdocs"
#    directoryindex index.html index.htm index.php
#    <directory e:/htdocs>
#      options followsymlinks
#      allowoverride none
#      order allow,deny
#      allow from all
#    </directory>
# </virtualhost>
 
#根据端口号来匹配
# <virtualhost 127.0.0.1:82>
#    documentroot "e:/htdocs"
#    directoryindex index.html index.htm index.php
#    <directory e:/htdocs>
#      options followsymlinks
#      allowoverride none
#      order allow,deny
#      allow from all
#    </directory>
# </virtualhost>
 
#根据主机名匹配
<virtualhost *:80>
    documentroot "e:/htdocs"
    servername localhost
    directoryindex index.html index.htm index.php
    <directory e:/htdocs>
      options followsymlinks
      allowoverride none
      order allow,deny
      allow from all
    </directory>
</virtualhost>
 
<virtualhost *:80>
    documentroot "e:/htdocs/dedecms"
    servername dedecms.com
    directoryindex index.html index.htm index.php
    <directory e:/htdocs>
      options followsymlinks
      allowoverride none
      order allow,deny
      allow from all
    </directory>
</virtualhost>
 
<virtualhost *:80>
    documentroot "e:/htdocs/discuz"
    servername discuz.com
    directoryindex index.html index.htm index.php
    <directory e:/htdocs>
      options followsymlinks
      allowoverride none
      order allow,deny
      allow from all
    </directory>
</virtualhost>
#在window 配置host文件
以上就是apache配置,虚拟主机的内容。
   
 
   