Sealyu

          --- 博客已遷移至: http://www.sealyu.com/blog

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            618 隨筆 :: 87 文章 :: 225 評(píng)論 :: 0 Trackbacks

          在整合Apache和Tomcat之后,發(fā)現(xiàn)該服務(wù)器的兩個(gè)網(wǎng)站一個(gè)是靜態(tài)的,一個(gè)是動(dòng)態(tài)jsp的,設(shè)置總結(jié)如下

          主要設(shè)置httpd.conf

          1、DirectoryIndex的設(shè)置

          如果多個(gè)虛擬站點(diǎn)中包含多種文件格式和文件名的首頁文件,必須在這里全部出現(xiàn)

          2、多個(gè)站點(diǎn)的定義如下

          #NameVirtualHost *:80

          #
          # 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.
          #
          NameVirtualHost 220.231.32.*:80

          <VirtualHost 220.231.32.*:80>
              ServerAdmin liubin@sina.com
              DocumentRoot /usr/local/tomcat/webapps/ronglian
              ServerName www.ronglian.com
              ErrorLog logs/ronglian.com-error_log
              CustomLog logs/ronglian.com-access_log common
          </VirtualHost>

          <VirtualHost 220.231.32.*:80>
              ServerAdmin wellboby@tom.com
              DocumentRoot /usr/local/wwwroot/chinaface
              ServerName www.chinaface.net
              ErrorLog logs/chinaface.net-error_log
              CustomLog logs/chinaface.net-access_log common
          </VirtualHost>

          !! 在這里,NameVirtualHost的字段不能省略,否則起apache時(shí)報(bào)錯(cuò):VirtualHost 220.231.32.*.80 overlaps with VirtualHost 220.231.32.*:80, the first has precedence, perhaps you need a NameVirtualHost directive——雖然apache能起,同錯(cuò)誤描述一樣,第二個(gè)站點(diǎn)的定義被第一個(gè)站點(diǎn)的定義所覆蓋,即訪問第二個(gè)站點(diǎn)指向的其實(shí)是第一個(gè)

          !! NameVirtualHost字段的端口號(hào)不能忽略,否則起apache時(shí)報(bào)錯(cuò):VirtualHost 220.231.32.*:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
          [Sun Jul 09 16:59:37 2006] [error] VirtualHost 220.231.32.*:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results——apache不能起

          !!如果VirtualHost 字段的端口號(hào)確實(shí),起apache時(shí)報(bào)錯(cuò):VirtualHost 220.231.32.28:0 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results——但apache可以啟動(dòng),訪問也正常

          posted on 2008-08-14 14:10 seal 閱讀(2882) 評(píng)論(1)  編輯  收藏 所屬分類: web服務(wù)器

          評(píng)論

          # re: Apache設(shè)置虛擬站點(diǎn)總結(jié) 2012-03-10 12:26 shirne
          配置了好久覺得沒問題,卻總是不行
          原來關(guān)鍵點(diǎn)在
          NameVirtualHost  回復(fù)  更多評(píng)論
            

          主站蜘蛛池模板: 鲜城| 柏乡县| 景泰县| 东阿县| 扶沟县| 奎屯市| 涞源县| 通海县| 绥德县| 闽侯县| 岑溪市| 文昌市| 英山县| 类乌齐县| 博客| 布尔津县| 涿鹿县| 赞皇县| 沙田区| 托克逊县| 剑川县| 荆州市| 阜新市| 镇原县| 晴隆县| 凌海市| 陇川县| 黎川县| 新营市| 晋江市| 巴青县| 额济纳旗| 合川市| 呼玛县| 苍梧县| 麦盖提县| 绥芬河市| 蒲城县| 平利县| 丹凤县| 华宁县|