table

          Apache虛擬主機(jī)的配置

          虛擬主機(jī)的配置

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

          基于IP和多端口的虛擬主機(jī)配置
          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

          單個(gè)IP地址的服務(wù)器上基于域名的虛擬主機(jī)配置
          # 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

          在多個(gè)IP地址的服務(wù)器上配置基于域名的虛擬主機(jī)
          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 …

          在不同的端口上運(yùn)行不同的站點(diǎn)
          基于多端口的服務(wù)器上配置基于域名的虛擬主機(jī)。
          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的混合虛擬主機(jī)的配置:
          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) 評(píng)論(0)  編輯  收藏 所屬分類(lèi): Apach


          只有注冊(cè)用戶(hù)登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           

          My Links

          Blog Stats

          常用鏈接

          留言簿(2)

          我參與的團(tuán)隊(duì)

          隨筆檔案

          文章分類(lèi)

          文章檔案

          搜索

          最新評(píng)論

          主站蜘蛛池模板: 凤台县| 雅江县| 崇阳县| 杨浦区| 彩票| 崇文区| 监利县| 甘孜县| 克什克腾旗| 余干县| 铜川市| 红河县| 绥阳县| 上高县| 高淳县| 读书| 泽普县| 平果县| 上杭县| 平顺县| 巩留县| 韶山市| 朝阳区| 横山县| 兴城市| 垫江县| 无锡市| 炉霍县| 沈阳市| 临湘市| 大洼县| 松滋市| 盐亭县| 文水县| 禹州市| 嘉禾县| 汝城县| 鹤山市| 隆安县| 思茅市| 稻城县|