禁用tomcat6的webdav模組

來源:互聯網
上載者:User

標籤:webdav   禁用webdav   



禁用tomcat6的webdav模組:


說明:開啟webdav模組後可通過命令列或用戶端對web進行線上上傳、下載、修改、刪除等操作,如控制不好會帶來安全隱患


# vi /var/lib/tomcat6/conf/web.conf   (在<web-app  下添加)

按a或i進入編輯模式  


<security-constraint>
<web-resource-collection>
    <url-pattern>/*</url-pattern>
    <http-method>PUT</http-method>
    <http-method>DELETE</http-method>
    <http-method>HEAD</http-method>
    <http-method>OPTIONS</http-method>
    <http-method>TRACE</http-method>
    </web-resource-collection>
      <auth-constraint>
      </auth-constraint>
    </security-constraint>
    <login-config>
        <auth-method>BASIC</auth-method>
    </login-config>
<init-param>
     <param-name>readonly</param-name>
     <param-value>true</param-value>
</init-param>

按Esc鍵退出編輯模式

:wq (退出並儲存)


# service tomcat6 restart


驗證:

下載:

$ curl -v -X OPTIONS http://localhost:8080/index.html   (如出現HTTP/1.1 403 Forbidden則說明禁用生效了)

上傳:


$ curl -v -T a.html http://localhost:8080/aa/a.html    (如出現HTTP/1.1 403 Forbidden則說明禁用生效了)






本文出自 “linux” 部落格,謝絕轉載!

禁用tomcat6的webdav模組

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.