table

          Apache虛擬主機的配置

          虛擬主機的配置

          基于IP地址的虛擬主機配置
          Listen 80
          DocumentRoot /www/example1
          ServerName www.example1.com
          DocumentRoot /www/example2
          ServerName www.example2.org

          基于IP和多端口的虛擬主機配置
          Listen 172.20.30.40:80
          Listen 172.20.30.40:8080
          Listen 172.20.30.50:80
          Listen 172.20.30.50:8080

          DocumentRoot /www/example1-80
          ServerName www.example1.com
          DocumentRoot /www/example1-8080
          ServerName www.example1.com
          DocumentRoot /www/example2-80
          ServerName www.example1.org
          DocumentRoot /www/example2-8080
          ServerName www.example2.org

          單個IP地址的服務器上基于域名的虛擬主機配置
          # Ensure that Apache listens on port 80
          Listen 80
          # Listen for virtual host requests on all IP addresses
          NameVirtualHost *:80
          DocumentRoot /www/example1
          ServerName www.example1.com
          ServerAlias example1.com. *.example1.com
          # Other directives here
          DocumentRoot /www/example2
          ServerName www.example2.org
          # Other directives here

          在多個IP地址的服務器上配置基于域名的虛擬主機
          Listen 80
          # This is the “main” server running on 172.20.30.40
          ServerName server.domain.com
          DocumentRoot /www/mainserver
          # This is the other address
          NameVirtualHost 172.20.30.50
          DocumentRoot /www/example1
          ServerName www.example1.com
          # Other directives here …
          DocumentRoot /www/example2
          ServerName www.example2.org
          # Other directives here …

          在不同的端口上運行不同的站點
          基于多端口的服務器上配置基于域名的虛擬主機。
          Listen 80
          Listen 8080
          NameVirtualHost 172.20.30.40:80
          NameVirtualHost 172.20.30.40:8080
          ServerName www.example1.com
          DocumentRoot /www/domain-80
          ServerName www.example1.com
          DocumentRoot /www/domain-8080
          ServerName www.example2.org
          DocumentRoot /www/otherdomain-80
          ServerName www.example2.org
          DocumentRoot /www/otherdomain-8080

          基于域名和基于IP的混合虛擬主機的配置:
          Listen 80
          NameVirtualHost 172.20.30.40
          DocumentRoot /www/example1
          ServerName www.example1.com
          DocumentRoot /www/example2
          ServerName www.example2.org
          DocumentRoot /www/example3
          ServerName www.example3.net

          NameVirtualHost *:8008
          <VirtualHost *:8008>
          ServerAdmin bchen@jishike.com
          DocumentRoot F:/xampp/htdocs/uch2009
          ServerName www.table.com
          </VirtualHost>

          posted on 2009-09-15 19:13 小卓 閱讀(158) 評論(0)  編輯  收藏 所屬分類: Apach


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 和静县| 遂溪县| 潼南县| 南川市| 若尔盖县| 板桥市| 普格县| 淮北市| 东辽县| 额济纳旗| 海南省| 深水埗区| 汾阳市| 新干县| 云阳县| 云南省| 东兴市| 德江县| 英吉沙县| 临朐县| 昌邑市| 额济纳旗| 敖汉旗| 宁城县| 成都市| 方正县| 辛集市| 健康| 甘肃省| 饶平县| 颍上县| 简阳市| 昌乐县| 开江县| 张家港市| 措勤县| 闵行区| 五华县| 富蕴县| 黑山县| 花垣县|