Sealyu

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

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

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

          主要設置httpd.conf

          1、DirectoryIndex的設置

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

          2、多個站點的定義如下

          #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時報錯:VirtualHost 220.231.32.*.80 overlaps with VirtualHost 220.231.32.*:80, the first has precedence, perhaps you need a NameVirtualHost directive——雖然apache能起,同錯誤描述一樣,第二個站點的定義被第一個站點的定義所覆蓋,即訪問第二個站點指向的其實是第一個

          !! NameVirtualHost字段的端口號不能忽略,否則起apache時報錯: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 字段的端口號確實,起apache時報錯:VirtualHost 220.231.32.28:0 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results——但apache可以啟動,訪問也正常

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

          評論

          # re: Apache設置虛擬站點總結 2012-03-10 12:26 shirne
          配置了好久覺得沒問題,卻總是不行
          原來關鍵點在
          NameVirtualHost  回復  更多評論
            

          主站蜘蛛池模板: 南京市| 聂拉木县| 鱼台县| 平乡县| 吉木萨尔县| 剑阁县| 呼和浩特市| 砀山县| 板桥市| 洞头县| 澄迈县| 县级市| 湟中县| 乌兰浩特市| 麟游县| 乐至县| 五华县| 望江县| 绥棱县| 库尔勒市| 乌苏市| 独山县| 龙南县| 大港区| 金川县| 保德县| 达州市| 林甸县| 洪江市| 长岭县| 封丘县| 沙湾县| 枞阳县| 宣恩县| 遵义市| 民勤县| 藁城市| 凉城县| 凌海市| 兰考县| 漳平市|