posts - 13,  comments - 4,  trackbacks - 0
          Linux環境VNC服務安裝、配置與使用http://blog.chinaunix.net/space.php?uid=57865&do=blog&cuid=1982905

          UNIX 系統
          http://www.linuxsir.org/bbs/showthread.php?s=c5e7da060762ad290ad8d2bd26bac6e0&t=195579

          CDE問題的troubleshooting http://blog.chinaunix.net/space.php?uid=9816449&do=blog&cuid=80800

          HP-UX 11i下安裝VNC  http://www.chinaunix.net/jh/8/576126.html

          ORA-01207: old control file完全解決方案    
          http://bbs.chinaunix.net/thread-2070372-1-1.html
          posted @ 2011-08-29 17:09 身在半空 閱讀(308) | 評論 (0)編輯 收藏

          WebLogic9.2拒絕訪問的異常分析及解決方案
          之前分析不對,特此改正

          一、 故障概述

          近三個月來,已有3次發生業務自動開通系統執行平臺維護系統訪問異常,所有頁面拒絕訪問并提示:

          Connection rejected, the server is in the RUNNING state. Starting service weblogic.application.internal.BackgroundDeploymentService$WaitForBackgroundCompletion, 110 of 112. Last service weblogic.deploy.service.internal.adminserver.HeartbeatService took 2ms.

          多點施工管理平臺維護系統同時出現上述問題,部署這兩個維護系統的WebLogic服務器服務異常。

          該故障使工單查詢、系統監控、失敗工單轉移和受理等功能無法使用。對業務工單的自動執行無影響,所有執行服務器正常。

          每次均是采用強制停止服務后重啟的方式恢復服務。

          二、 故障描述

          訪問業務自動開通系統執行平臺維護系統和多點施工管理平臺維護系統均報以下異常:

          Connection rejected, the server is in the RUNNING state. Starting service weblogic.application.internal.BackgroundDeploymentService$WaitForBackgroundCompletion, 110 of 112. Last service weblogic.deploy.service.internal.adminserver.HeartbeatService took 2ms.

          此時,網絡狀況、設備狀態、服務器操作系統均正常;WebLogic應用服務器異常,其控制臺無法正常訪問,顯示報告同業務自動開通系統執行平臺維護系統,且不能正常停止WebLogic服務。

          經查,WebLogic應用服務器在記錄以下日志后無法正常訪問:

          ####<2011-8-13 上午104615 CST> <Critical> <Server> <tfh-node2> <TFHWEB> <DynamicListenThread[Default]> <<WLS Kernel>> <> <> <1313203575118> <BEA-002616> <Failed to listen on channel "Default" on 132.60.5.29:8080, failure count: 2, failing for 1 seconds, java.net.SocketException: 無效的自變量>

          ####<2011-8-13 上午104659 CST> <Critical> <Server> <tfh-node2> <TFHWEB> <DynamicListenThread[Default]> <<WLS Kernel>> <> <> <1313203619270> <BEA-002617> <Attempting to close and reopen the server socket on on channel "Default" on 132.60.5.29:8080.>

          ####<2011-8-13 上午104709 CST> <Notice> <Server> <tfh-node2> <TFHWEB> <DynamicListenThread[Default]> <<WLS Kernel>> <> <> <1313203629287> <BEA-002614> <Reopening channel "Default" on 132.60.5.29:8080.>

          ####<2011-8-13 上午104709 CST> <Notice> <Server> <tfh-node2> <TFHWEB> <DynamicListenThread[Default]> <<WLS Kernel>> <> <> <1313203629787> <BEA-002615> <After having failed to listen, the server is now listening on channel "Default" on 132.60.5.29:8080.>

          之后所有訪問均記錄如下日志:

          ####<2011-8-13 上午104709 CST> <Notice> <Server> <tfh-node2> <TFHWEB> <DynamicListenThread[Default]> <<WLS Kernel>> <> <> <1313203629787> <BEA-002615> <After having failed to listen, the server is now listening on channel "Default" on 132.60.5.29:8080.>

           

          三、 處理過程和解決方法

          使用正常停止WebLogic服務的命令無法停止服務,強行killWebLogic服務進程,并按照正常流程啟動WebLogic服務

              故障分析和建議

          1、故障的原因分析

          此故障是由WebLogic9.2bug導致,Oracle官方解釋如下:

          Solaris 9 或更高版本上使用 JDK 1.5 時,半閉套接口上的任何設置操作都會引發 SocketException。這延遲了服務器在相同端口上接受新連接,而且如果故障間的最大補償時間達到最大值,還會導致回收服務器套接口。

          需要安裝CR283953補丁解決該BUG

          以下為Oracle官方對CR283953補丁的英文解釋:

          http://docs.oracle.com/cd/E13222_01/wls/docs100/issues/known_resolved.html

          On Solaris 9 or later, with JDK 1.5, any set operation on a half-closed socket throws a SocketException. This delayed the server in accepting new connections on the same port and also caused the server socket to be recycled if the maximum backoff time between failures reaches its maximum.

          Solution:

          WebLogic Server no longer throws an exception in connection with a set operation on half-closed sockets.

           

          2、改進措施和計劃

          1.WebLogic服務編寫守護程序,定時查看WebLogic服務狀態,若出現故障則重啟WebLogic服務。守護程序采用crontab+shell腳本實現,參見

          掃描日志重啟WebLogic服務shell腳本

          2.獲取CR283953補丁,并安裝。BEA已被oracle收購,補丁已不能免費下載,具體詢oracle客服。

           

           

          posted @ 2011-08-16 17:31 身在半空 閱讀(3631) | 評論 (3)編輯 收藏
          操作系統:Solaris
          1.使用oracle用戶進行定時備份,添加crontab時要用root用戶添加,執行命令為:crontab -e oracle;
          2.shell腳本中不能使用“()”,如
          exp ywkt/ywkt@ywkt buffer=64000 file=/backup/config_$dd.dmp log=/backup/exp_config.log tables=(ACTIONTYPEIDLIST,RESOURCE_CONFIGURE)。會提示紅色括號附件錯誤。

          附個人感覺有用的鏈接:
          http://space.itpub.net/4227/viewspace-68717
          http://www.itpub.net/thread-92487-1-1.html
          posted @ 2011-06-09 15:47 身在半空 閱讀(569) | 評論 (0)編輯 收藏

          說明:IbosExecHistory系列表是提供歷史數據查詢的歷史表;

          IbosExecHistory為試圖;

          IbosExecHistory_XXXX中“XXXX”為年份,供存放該年所有歷史數據,此類表做歷史數據備份用,不提供維護系統查詢;

          IbosExecHistory_month_X中“X”為月份(1-9不加0),此類表做循環使用,根據維護系統要求查詢時提供6個月內數據,故在此前六個月之外的數據可清楚。最后及時清楚,否則將造成與往年數據共存現象,較難分離。若造成累計,建議將數據使用bcp導出后,對文件進行操作,不要在數據庫中進行操作。

          工作原理:為減少對數據庫性能造成影響,使用bcptruncate table操作,做truncate table時應謹慎。

          本文目的:提供IbosExecHistory_month_X表歷史數據清除步驟。

          注:以下步驟以20105月份歷史數據清除為例,在實際操作中需更改重要sql語句,謹記。

          具體步驟:

          1.查詢年份表中是否已有該月數據,結果為0,則順序執行

          select count(*) from IbosExecHistory_2010 where SendTime>='2010-05-01' and SendTime<'2010-06-01'

          2.查詢月份表中是否已清除,結果不為0,則順序執行

          select count(*) from IbosExecHistory_month_5

          3.使用bcp命令進行數據導出,bcp命令OS命令,在已安裝sybase數據庫客戶端的系統上方可使用

          bcp test..IbosExecHistory_month_5 out d:\IbosExecHistory_month_5.txt -c -t "{" -r "\r\n" -Uibos -Pibos123 -Stfh28

          4.使用bcp命令進行數據導入

          bcp test..IbosExecHistory_2010 in d:\IbosExecHistory_month_5.txt -c -t "{" -r "\r\n" -Uibos -Pibos123 -Stfh28

          5.清除月份表數據

          truncate table IbosExecHistory_month_5

          posted @ 2010-12-22 15:54 身在半空 閱讀(294) | 評論 (0)編輯 收藏
               摘要: Oracle SQL Developer外觀改為windows后啟動異常的解決方法

          刪除我的文檔下面的 \AppData\Roaming\SQL Developer文件夾即可。  閱讀全文
          posted @ 2010-06-24 11:01 身在半空 閱讀(1606) | 評論 (0)編輯 收藏

          引自:http://www.examda.com/linux/fudao/20090928/091946607.html

          在Windows和Linux(Fedora/Ubuntu/RedHat)中安裝了NetBeans后,會遇到菜單等顯示亂碼的 問題。這里告訴大家如何解決中文顯示亂碼的問題,包括Windows、Fedora、Ubuntu下NetBeans中文亂碼解決辦法。

          一、Windows下NetBeans中文亂碼解決辦法

          l              找到你的Netbeans安裝目錄下的etc文件夾

          l              用記事本打開netbeans.conf

          l              找到netbeans_default_options(不是最后那個帶句號的…), 在其屬性的最后(引號以內)加一個空格, 再加上-J-Dfile.encoding=UTF-8

          二、Fedora   NetBeans中文亂碼解決辦法

          l              拷貝/usr/share/fonts/zh_CN/TrueType中的ttf文件到你的JDK安裝目錄下 jre/lib/fonts/fallback里,如果在”java安裝目錄/jre/lib/fonts”下沒有”fallback”這個目錄, 可以手工創建一個,即可解決。

          l              如果還不行的話,打開Netbeans的默認配置文件:我的在/home/www.dengchao.org/netbeans-6.5.1/etc /netbeans.conf。

          l              找到netbeans_default_options這一項(注意不要在#后面,那個是注釋)。

          l              在最后加上:(空格)-J-Duser.language=zh -J-Duser.country=CNs -J-Dfile.encoding=UTF-8

          三、Ubuntu NetBeans中文亂碼解決辦法

          l              在$JAVA_HOME/jre/lib/fonts目錄下創建一名為fallback的目錄

          l              將一可顯示中文的字體放到fallback目錄下,可以到Ubuntu字體目錄(/usr/share/fonts)去復制一份或者用ln命令做一個硬鏈 接到該目錄(注:軟鏈接無效)

          l              再運行NetBeans(or NetBean)即可

          posted @ 2010-05-16 13:44 身在半空 閱讀(1280) | 評論 (0)編輯 收藏
          對于過濾流的關閉,一般采取先開后關、由外向內的原則。

          FileInputStream f=new FileInputStream( "file ");
          BufferedInputStream b=new BufferedInputStream(f);
          DataInputStream d=new DataInputStream(b);

          關閉”真正有意義的事情在于“釋放系統資源”。在這個例子里,只有FileInputStream占據了系統資源(打開了一個文件),另外兩個流對象只是從數據處理角度做的包裝(可能會占用一些內存,但不占用其它“系統資源”)。所以,只需要確保關閉了FileInputStream即可。

          在實際編程實踐中,你不一定總能清楚地知道每層的流對象是否占據了系統資源,所以,最安全(也是最常規)的做法就是關閉最外層的那個對象。這種逐層包裝的對象在實現上都會有一個特點,像“關閉”這種操作都會逐層向內調用。

          引自:http://blog.sina.com.cn/s/blog_6307d85b0100gqtt.html
          posted @ 2010-02-25 11:26 身在半空 閱讀(1158) | 評論 (0)編輯 收藏
          準備:
              Solaris系統運行過一段時間后,時間和標準時間有偏差,單機系統下,不與其他系統同步。
          若要修改系統時間,得考慮一下系 統上的服務是否會由于修改了時間而服務起不來。
          現網運行中有一臺服務器,時間比標準時間快15分鐘,由于應用的需要,要求時間要與標準時間相近, 服務器上系統是SunOS 5.8,數據庫是IBM Informix Dynamic Server Version 9.40.FC7,一個實例,好幾個庫。
          經過一番咨詢,在不停止服務的情況下可以修改系統時間,用root用戶登陸后修改。修改時間就用date 命令就性,格式為date mmddHHMMYYYY.SS,月日時分年.秒
          下面是操作記錄
           
           
          操作:
           
           
          SunOS 5.8
           
          login: login: xxxuser
          Password:
          Last login: Tue Jan 16 18:27:47 from 10.2.0.221
          Sun Microsystems Inc.   SunOS 5.8       Generic Patch   February 2004
          You have new mail.
          infodb% echo $TZ
          PRC
          infodb% onstat -
          IBM Informix Dynamic Server Version 9.40.FC7     -- On-Line -- Up 40 days 01:02:36 -- 3920896 Kbytes
          infodb% su - root
          Password:
          Sun Microsystems Inc.   SunOS 5.8       Generic Patch   February 2004
          You have new mail.
          Sourcing //.profile-EIS.....
          root@infodb # id
          uid=0(root) gid=1(other)
          root@infodb # date               
          Tue Jan 16 19:08:25 CST 2007
          root@infodb # date 011618552007.10
          Tue Jan 16 18:55:10 CST 2007
          root@infodb # date
          Tue Jan 16 18:55:13 CST 2007
          root@infodb # date
          Tue Jan 16 18:55:22 CST 2007
          root@infodb # exit
          infodb% onstat -
          IBM Informix Dynamic Server Version 9.40.FC7     -- On-Line -- Up 40 days 00:55:31 -- 3920896 Kbytes
          infodb% onstat -
          IBM Informix Dynamic Server Version 9.40.FC7     -- On-Line -- Up 40 days 00:55:34 -- 3920896 Kbytes

          轉自:http://blog.chinaunix.net/u/20228/showart_233546.html
          posted @ 2010-02-10 15:05 身在半空 閱讀(647) | 評論 (0)編輯 收藏
          public class Test2 {
          public static void main(String[] args) throws Exception{
          System.out.println(Test2.class.getProtectionDomain().getCodeSource().getLocation());// 獲取程序的根目錄
          }
          }
          摘自:http://blog.sina.com.cn/s/blog_643937a30100gkrz.html
          posted @ 2010-02-08 15:18 身在半空 閱讀(1776) | 評論 (0)編輯 收藏
             我開發時使用的是jxl2.6.12版本的包,在NetBeans6.7上開發時運行良好(tomcat6.0服務器),在部署到weblogic9.2上時,報java.lang.NoClassDefFoundError: jxl/write/WriteException異常。
             經分析以為是weblogic內置jxl較低版本的包,后嘗試上傳最新jar包至common/lib下及創建weblogic.xml文件使其優先使用WEB-INF下包等兩種解決方案時仍不能解決問題。
             之后在一次部署過程中發現weblogic報出:invalid LOC header (bad signature),經查得知是不識別jar包,隨下載jxl2.6的包上傳部署并通過。

          現象:weblogic9.2報出java.lang.NoClassDefFoundError異常。
          原因:weblogic9.2不識別jar包所致,具體深層原因不明,可參考http://www.zeali.net/entry/106。
          解決:使用稍低版本jar包。或許同一版本其他包也可使用,為曾嘗試。

          附:weblogic.xml
          <?xml version="1.0" encoding="GBK"?>
          <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
          <weblogic-web-app>
              <container-descriptor>
                  <prefer-web-inf-classes>true</prefer-web-inf-classes>
              </container-descriptor>
          </weblogic-web-app>

          posted @ 2010-01-12 14:29 身在半空 閱讀(971) | 評論 (0)編輯 收藏

          一、介紹(introduction)

          1. 目的——HTTP/0.9-〉HTTP/1.0-〉HTTP/1.1

          2. 要求——MUST、REQUIRED、SHOULD

          3. 術語——連接(Connection)、消息(Message)、請求(Request)、應答(Response)、資源(Resource)、實體 (Entity)、表示方法(Representation)、內容協商(Content Negotiation)、變量(Variant)、客戶機(Client)、用戶代理(User agent)、服務器(Server)、原服務器(Origin server)、代理服務器( Proxy)、網關(gateway)、高速緩存(Cache)、可緩存(Cacheable)、直接(first-hand)、明確終止時間 (explicit expiration time)、探索終止時間(heuristic expiration time)、年齡(Age)、保鮮壽命(Freshness lifetime)、保鮮(Fresh)、陳舊(Stale)、語義透明(semantically transparent)、有效性判別器(Validator)、實體標記(entity tag)或最終更改時間(Last-Modified time))、上游/下游(upstream/downstream)、向內/向外(inbound/outbound)

          4. 總體操作——請求/應答、中介

          二、符號慣例與一般語法(notational conversions and generic grammar)

          1. 擴充BNF——name = definition,"literal",rule1 | rule2,(rule1 rule2),*rule,[rule],N rule, #rule,; comment, implied *LWS

          2. 基本規則——OCTET,CHAR,UPALPHA,LOALPHA,ALPHA,DIGIT,CTL,CR,LF,SP,HT,<">

          三、協議參數(protocol parameters)

          1. HTTP版本——HTTP-Version = "HTTP" "/" 1*DIGIT "." 1*DIGIT

          2. 統一資源標示符(URI)——統一資源定位器(URL)和統一資源名稱(URN)的結合,http_URL = "http:" "http://" host [ ":" port ] [ abs_path [ "?" query ]]

          3. 日期/時間格式——Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123,
          Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036,
          Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format

          4. 字符集——本文檔中的術語"字符集"指一種用一個或更多表格將一個八字節序列轉換成一個字符序列的方法,
          charset=token
          失蹤字符集

          5. 內容編碼——內容編碼主要用來允許文檔壓縮(信源編碼)
          content-coding= token
          注冊表包含下列標記:gzip,compress,deflate,identity

          6. 傳輸編碼——目的是能夠確保通過網絡安全傳輸(信道編碼)
          transfer-coding = "chunked" | transfer-extension
          transfer-extension = token *( ";" parameter ),
          成塊傳輸代碼

          7. 媒體類型——media-type = type "/" subtype *( ";" parameter )
          type = token
          subtype = token
          規范化和原文缺省
          多部分類型

          8. 產品標記——product = token ["/" product-version]
          product-version = token

          9. 質量值——qvalue = ( "0" [ "." 0*3DIGIT ] )| ( "1" [ "." 0*3("0") ] )

          10. 語言標記——language-tag = primary-tag *( "-" subtag )
          primary-tag = 1*8ALPHA
          subtag = 1*8ALPHA

          11. 實體標記——entity-tag = [ weak ] opaque-tag
          weak = "W/"
          opaque-tag = quoted-string

          12. 范圍單位——range-unit = bytes-unit | other-range-unit
          bytes-unit = "bytes"
          other-range-unit = token

          四、 HTTP消息(HTTP message)

          1. 消息類型——HTTP-message = Request | Response ; HTTP/1.1 messages
          generic-message = start-line *(message-header CRLF) CRLF [ message-body ]
          start-line = Request-Line | Status-Line

          2. 消息頭——HTTP頭域包括常規頭,請求頭,應答頭和實體頭域
          message-header = field-name ":" [ field-value ]
          field-name = token
          field-value = *( field-content | LWS )
          field-content = <the OCTETs making up the field-value and consisting of either *TEXT or combinations of token, separators, and quoted-string>

          3. 消息體——message-body = entity-body| <entity-body encoded as per Transfer-Encoding>

          4. 消息的長度——決定因素

          5. 常規頭域——general-header = Cache-Control| Connection| Date| Pragma| Transfer-Encoding

          五、 請求(request)

          首行包括利用資源的方式,區分資源的標識,以及協議的版本號
          Request = Request-Line * (( general-header| request-header| entity-header ) CRLF) CRLF [ message-body ]

          1. 請求行——Request-Line = Method SP Request-URI SP HTTP-Version CRLF
          方法——方法標記指的是在請求URI所指定的資源上所實現的方式
          Method = "OPTIONS"| "GET"| "POST"| "PUT"| "DELETE"| "TRACE"| "CONNECT"| extension-method
          extension-method = token
          請求URL——請求URL是一種全球統一的應用于資源請求的資源標識符
          Request-URI = "*" | absoluteURI | abs_path | authority
          請求行舉例:GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1
          GET /pub/WWW/TheProject.html HTTP/1.1
          Host: www.w3.org

          2. 請求定義的資源——一個INTERNET請求所定義的精確資源由請求URL和主機報頭域所決定

          3. 請求報頭域——request-header = Accept| Accept-Charset| Accept-Encoding| Accept-Language| Authorization| Expect| From| Host| If-Match| If-Modified-Since| If-None-Match| If-Range| If-Unmodified-Since| Max-Forwards| Proxy-Authorization| Range| Referer| TE| User-Agent

          六、 應答(response)

          接收和翻譯一個請求信息后,服務器發出一個HTTP應答信息
          Response = Status-Line*(( general-header| response-header| entity-header ) CRLF) CRLF [ message-body ]

          1. 狀態行——Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
          狀態碼——狀態碼是試圖理解和滿足請求的三位數字的整數碼,1xx,2xx,3xx,4xx,5xx,100-〉505-〉擴展碼

          2. 應答報頭域——response-header = Accept-Ranges| Age| Location| Proxy-Authenticate| Retry-After| Server| Vary| WWW-Authenticate

          七、 實體(entity)

          在未經特別規定的情況下,請求與應答的消息也可以傳送實體。 實體包括實體報頭域與實體正文,而有些應答只包括實體報頭。

          1. 實體報頭域——entity-header = Allow | Content-Encoding| Content-Language| Content-Length | Content-Location| Content-MD5| Content-Range| Content-Type| Expires| Last-Modified| extension-header
          extension-header = message-header

          2. 實體正文——entity-body = *OCTET
          entity-body := Content-Encoding( Content-Type( data ) )

          八、 連接(connection)

          1. 持續連接——優點
          持續連接是任何HTTP連接的缺省方式,支持持續連接的客戶機可以以流水線方式發送請求
          代理服務器

          2. 消息傳遞要求——持續連接與流量控制
          監視連接中出錯狀態的消息
          100號狀態的用途
          服務器過早關閉連接時客戶機的動作

          九、 方法定義(method definitions)

          1. 安全和等冪方法
          安全方法——GET和HEAD方法除了補救外不應該有別的采取措施的含義
          等冪方法——沒有副作用的序列是等冪的

          2. OPTIONS——OPTIONS方法代表在請求URI確定的請求/應答過程中通信條件是否可行的信息

          3. GET——GET方法說明了重建信息的內容由請求URI來確定

          4. HEAD——除了應答中禁止返回消息正文外,HEAD方法與GET方法一樣

          5. POST——POST方法實現的實際功能取決于服務器

          6. PUT——PUT方法要求所附實體存儲在提供的請求URI下

          7. DELETE——DELELE方法要求原服務器釋放請求URI指向的資源

          8. TRACE——TRACE方法用于調用遠程的應用層循環請求消息

          9. CONNECT——CONNECT方法用于能動態建立起隧道的代理服務器

          十、 狀態碼定義(status code definitions)

          1. 信息1XX——
          100繼續
          101轉換協議

          2. 成功2XX——
          200請求成功
          201創建
          202接受
          203非權威信息
          204無內容
          205重置內容
          206局部內容

          3. 重新定向3XX——
          300多樣選擇
          301永久移動
          302創立
          303觀察別的部分
          304只讀
          306(沒有用的)
          307臨時重發

          4. 客戶錯誤4xx——
          400壞請求
          401未授權的
          402必需的支付
          403禁用
          404沒有找到
          405不被允許的方法
          406不接受
          407代理服務器認證所必需
          408請求超時
          409沖突
          410停止
          411必需的長度
          412預處理失敗
          413請求實體太大
          414請求的URI過長
          415不被支持的媒體類型
          416請求范圍不滿足
          417期望失敗

          5. 服務器錯誤5xx——
          500服務器內部錯誤
          501不能實現
          502壞網關
          503難以獲得的服務
          504網關超時
          505 HTTP版本不支持

          十一、 訪問驗證(access authentication)——可選擇

          十二、 內容談判(content negotiation)

          HTTP為了"內容談判"提供了一些機制,即當有很多種可能的表示時如何選擇對于一個請求的最佳的表示。

          1. 服務器驅動談判——一個請求的最佳表示的選擇由服務器提供的運算法則來完成

          2. 代理驅動談判——對于一個應答的最佳表示法的選擇是在代理從原服務器端收到最初的應答后實現的

          3. 透明談判——透明的判斷是服務器驅動和代理驅動談判的結合體

          十三、 HTTP中的緩存(caching in HTTP)

          HTTP典型應用于能通過采用緩存技術而提高性能的分布式信息系統

          1. 緩存——
          緩存正確性
          警告信息
          緩存控制機制
          直接的用戶代理警告
          規則和警告的例外情況
          由客戶控制的行為

          2. 過期模型——
          服務器指定模型
          啟發式過期
          年齡計算
          過期計算
          澄清過期值
          澄清多重響應

          3. 確認模型——當緩存器想要用一個失時效的條目來相應客戶的請求,他首先必須向源服務器檢驗這一緩存條目是否仍然可用
          最后修改日期
          標簽緩存確認器
          強弱控制器
          關于何時使用實體標簽和最后修改時間的規則
          不確認條件

          4. 響應的緩存能力——除非被明確限制,緩存系統可以將一成功的響應作為緩存實體一直存儲

          5. 從緩存構造響應——
          端到端和Hop-by-hop報頭
          不可更改報頭
          聯合報頭
          聯合字節范圍

          6. 緩存談判響應

          7. 共享與非共享緩存

          8. 錯誤和不完全響應緩存行為

          9. GET和 HEAD的副作用

          10. 刷新或刪除后的無效性

          11. 強制寫通過

          12. 緩存替換

          13. 歷史紀錄

          十四、 報頭域定義(header field definitions)

          1. Accept——Accept = "Accept" ":" #( media-range [ accept-params ] )
          media-range = ( "*/*"| ( type "/" "*" )| ( type "/" subtype )) *( ";" parameter )
          accept-params = ";" "q" "=" qvalue *( accept-extension )
          accept-extension = ";" token [ "=" ( token | quoted-string ) ]
          例1:Accept: audio/*; q=0.2, audio/basic
          例2:Accept: text/plain; q=0.5, text/html, text/x-dvi; q=0.8, text/x-c

          2. Accept-Charset——Accept-Charset = "Accept-Charset" ":" 1#( ( charset | "*" )[ ";" "q" "=" qvalue ] )
          例:Accept-Charset: iso-8859-5, unicode-1-1;q=0.8

          3. Accept-Encoding——Accept-Encoding = "Accept-Encoding" ":" 1#( codings [ ";" "q" "=" qvalue ] )
          codings = ( content-coding | "*" )
          例:Accept-Encoding: gzip;q=1.0, identity; q=0.5, *;q=0

          4. Accept-Language——Accept-Language = "Accept-Language" ":" 1#( language-range [ ";" "q" "=" qvalue ] )
          language-range = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )
          例:Accept-Language: da, en-gb;q=0.8, en;q=0.7

          5. Accept-Range——Accept-Ranges = "Accept-Ranges" ":" acceptable-ranges
          acceptable-ranges = 1#range-unit | "none"
          例:Accept-Ranges: bytes

          6. Age——Age = "Age" ":" age-value
          age-value = delta-seconds

          7. Allow——Allow = "Allow" ":" #Method
          例:Allow: GET, HEAD, PUT

          8. Authorization——Authorization = "Authorization" ":" credentials

          9. Cache-Control——Cache-Control = "Cache-Control" ":" 1#cache-directive
          cache-directive = cache-request-directive| cache-response-directive
          cache-request-directive ="no-cache"| "no-store"| "max-age" "=" delta-seconds| "max-stale" [ "=" delta-seconds ]| "min-fresh" "=" delta-seconds| "no-transform"| "only-if-cached"| cache-extension
          cache-response-directive ="public"| "private" [ "=" <"> 1#field-name <"> ]| "no-cache" [ "=" <"> 1#field-name <"> ]| "no-store"| "no-transform"| "must-revalidate"| "proxy-revalidate"| "max-age" "=" delta-seconds| "s-maxage" "=" delta-seconds| cache-extension
          cache-extension = token [ "=" ( token | quoted-string ) ]
          什么是可緩存的
          哪些可能被緩存保存
          對基本過期失效機制的改進
          緩存重新確認有效和重載控制
          不得轉換的指令
          緩存控制擴展

          10. Connection——Connection = "Connection" ":" 1#(connection-token)
          connection-token = token
          例:Connection: close

          11. Content-Encoding——Content-Encoding = "Content-Encoding" ":" 1#content-coding
          例:Content-Encoding: gzip

          12. Content-Language——Content-Language = "Content-Language" ":" 1#language-tag
          例:Content-Language: mi, en

          13. Content-Length——Content-Length = "Content-Length" ":" 1*DIGIT
          Content-Length: 3495

          14. Content-Location——Content-Location = "Content-Location" ":"( absoluteURI | relativeURI )

          15. Content-MD5——Content-MD5 = "Content-MD5" ":" md5-digest
          md5-digest = <base64 of 128 bit MD5 digest as per RFC 1864>

          16. Content-Range——Content-Range = "Content-Range" ":" content-range-spec
          content-range-spec = byte-content-range-spec
          byte-content-range-spec = bytes-unit SP byte-range-resp-spec "/"( instance-length | "*" )
          byte-range-resp-spec = (first-byte-pos "-" last-byte-pos) | "*"
          instance-length = 1*DIGIT
          例:The first 500 bytes:bytes 0-499/1234

          17. Content-Type——Content-Type = "Content-Type" ":" media-type
          例:Content-Type: text/html; charset=ISO-8859-4

          18. Date——Date = "Date" ":" HTTP-date
          例:Date: Tue, 15 Nov 1994 08:12:31 GMT
          沒有時鐘的原服務器的運作

          19. Etag——ETag = "ETag" ":" entity-tag
          例:ETag: W/"xyzzy"

          20. Expect——Expect = "Expect" ":" 1#expectation
          expectation = "100-continue" | expectation-extension
          expectation-extension = token [ "=" ( token | quoted-string )*expect-params ]
          expect-params = ";" token [ "=" ( token | quoted-string ) ]

          21. Expires——Expires = "Expires" ":" HTTP-date
          例:Expires: Thu, 01 Dec 1994 16:00:00 GMT

          22. From——From = "From" ":" mailbox
          例:From: webmaster@w3.org

          23. Host——Host = "Host" ":" host [ ":" port ] ; Section 3.2.2

          24. If-Match——If-Match = "If-Match" ":" ( "*" | 1#entity-tag )
          例:If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"

          25. If-Modified-Since——If-Modified-Since = "If-Modified-Since" ":" HTTP-date
          例:If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT

          26. If-None-Match ——If-None-Match = "If-None-Match" ":" ( "*" | 1#entity-tag )
          例:If-None-Match: W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz"

          27. If-Range ——If-Range = "If-Range" ":" ( entity-tag | HTTP-date )

          28. If-Unmodified-Since ——If-Unmodified-Since = "If-Unmodified-Since" ":" HTTP-date
          例:If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT

          29. Last-Modified ——Last-Modified = "Last-Modified" ":" HTTP-date
          例:Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT

          30. Location ——Location = "Location" ":" absoluteURI
          Location: http://www.w3.org/pub/WWW/People.html

          31. Max-Forwards ——Max-Forwards = "Max-Forwards" ":" 1*DIGIT

          32. Pragma ——Pragma = "Pragma" ":" 1#pragma-directive
          pragma-directive = "no-cache" | extension-pragma
          extension-pragma = token [ "=" ( token | quoted-string ) ]

          33. Proxy-Authenticate ——Proxy-Authenticate = "Proxy-Authenticate" ":" 1#challenge

          34. Proxy-Authorization ——Proxy-Authorization = "Proxy-Authorization" ":" credentials

          35. Range——字節范圍
          范圍檢索請求
          Range = "Range" ":" ranges-specifier

          36. Referer——Referer = "Referer" ":" ( absoluteURI | relativeURI )

          37. Retry-After ——Retry-After = "Retry-After" ":" ( HTTP-date | delta-seconds )

          38. Server ——Server = "Server" ":" 1*( product | comment )

          39. TE ——TE = "TE" ":" #( t-codings )
          t-codings = "trailers" | ( transfer-extension [ accept-params ] )
          例:TE: trailers, deflate;q=0.5

          40. Trailer ——Trailer = "Trailer" ":" 1#field-name

          41. Transfer-Encoding ——Transfer-Encoding = "Transfer-Encoding" ":" 1#transfer-coding
          例:Transfer-Encoding: chunked

          42. Upgrade——Upgrade = "Upgrade" ":" 1#product
          例:Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11

          43. User-Agent ——User-Agent = "User-Agent" ":" 1*( product | comment )
          例:User-Agent: CERN-LineMode/2.15 libwww/2.17b3

          44. Vary ——Vary = "Vary" ":" ( "*" | 1#field-name )

          45. Via ——Via = "Via" ":" 1#( received-protocol received-by [ comment ] )
          received-protocol = [ protocol-name "/" ] protocol-version
          protocol-name = token
          protocol-version = token
          received-by = ( host [ ":" port ] ) | pseudonym
          pseudonym = token
          例:Via: 1.0 ricky, 1.1 ethel, 1.1 fred, 1.0 lucy

          46. Warning = "Warning" ":" 1#warning-value
          warning-value = warn-code SP warn-agent SP warn-text [SP warn-date]
          warn-code = 3DIGIT
          warn-agent = ( host [ ":" port ] ) | pseudonym
          warn-text = quoted-string
          warn-date = <"> HTTP-date <">

          47. WWW-Authenticate ——WWW-Authenticate = "WWW-Authenticate" ":" 1#challenge

          十五、 安全考慮(security considerations)

          一些建議,但是并不包括最終解決方案

          1. 個人信息
          服務器日志信息的濫用
          敏感信息的傳輸
          URI中敏感信息的編碼
          連接到Accept報頭的機要問題

          2. 基于文件和路徑名稱的攻擊

          3. DNS欺騙

          4. Location(位置)報頭和欺騙

          5. 內容傾向問題

          6. 鑒定證書和空閑的客戶機

          7. 代理服務器和高速緩存
          對代理服務器的拒絕服務攻擊

          十六、 感謝

          十七、 參考文獻

          十八、 作者地址

          十九、 附錄


          文章轉自:http://www.cppblog.com/woaidongmao/archive/2008/05/28/51408.html

          posted @ 2009-11-30 23:31 身在半空 閱讀(4635) | 評論 (0)編輯 收藏
          博客開通了,先發表一篇隨筆。
          posted @ 2009-07-27 11:08 身在半空 閱讀(129) | 評論 (0)編輯 收藏

          <2009年7月>
          2829301234
          567891011
          12131415161718
          19202122232425
          2627282930311
          2345678

          常用鏈接

          留言簿

          隨筆檔案

          文章檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 马公市| 获嘉县| 汉中市| 霍邱县| 湘乡市| 浦北县| 天台县| 卢湾区| 新邵县| 武宁县| 井研县| 云林县| 厦门市| 博爱县| 修武县| 大渡口区| 鲜城| 宣武区| 靖边县| 鄂尔多斯市| 惠州市| 巴东县| 沈阳市| 孟连| 忻城县| 民权县| 稷山县| 富川| 当阳市| 白水县| 中卫市| 蕲春县| 河西区| 呼玛县| 洪雅县| 师宗县| 怀来县| 延吉市| 汕头市| 噶尔县| 峨眉山市|