posts - 23,comments - 12,trackbacks - 0
          1、創建證書鑰匙庫:

          keytool -genkey -alias tomcat -keyalg RSA

          缺省證書文件名為:.keystore

          2、修改文件server.xml
            <Connector port="8443"
                         maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                         enableLookups="false" disableUploadTimeout="true"
                         acceptCount="100" debug="0" scheme="https" secure="true"
                         clientAuth="false"
                keystoreFile="C:\keystore\.keystore"
                keystorePass="netscape"
                sslProtocol="TLS" />

          3、web.xml
          <security-constraint>
              <web-resource-collection>
                <web-resource-name>Purchase</web-resource-name>
                <url-pattern>/ssl/*</url-pattern>
              </web-resource-collection>
              <auth-constraint>
                <role-name>registered-user</role-name>
              </auth-constraint>
              <user-data-constraint>
                <transport-guarantee>CONFIDENTIAL</transport-guarantee>
              </user-data-constraint>
            </security-constraint>
           
            <!-- Only users in the administrator role can access
                 the delete-account.jsp page within the admin
                 directory. -->
            <security-constraint>
              <web-resource-collection>
                <web-resource-name>Account Deletion</web-resource-name>
                <url-pattern>/admin/delete-account.jsp</url-pattern>
              </web-resource-collection>
              <auth-constraint>
                <role-name>administrator</role-name>
              </auth-constraint>
            </security-constraint>
           
            <!-- Tell the server to use form-based authentication. -->
            <login-config>
              <auth-method>FORM</auth-method>
              <form-login-config>
                <form-login-page>/admin/login.jsp</form-login-page>
                <form-error-page>/admin/login-error.jsp</form-error-page>
              </form-login-config>
            </login-config>
             
           
          4、重啟tomcat


          posted on 2005-11-02 15:21 my java 閱讀(404) 評論(0)  編輯  收藏 所屬分類: jsp

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 汕头市| 乌海市| 仙游县| 乌兰浩特市| 衡阳县| 彰化县| 长治市| 门头沟区| 石楼县| 景宁| 浠水县| 德清县| 吉木乃县| 泽普县| 炎陵县| 盘山县| 格尔木市| 云和县| 同心县| 龙井市| 且末县| 龙口市| 汶川县| 文水县| 阳朔县| 大埔区| 鞍山市| 牙克石市| 苍山县| 本溪| 苗栗市| 合水县| 托里县| 棋牌| 留坝县| 武功县| 钟祥市| 永新县| 汤原县| 保德县| 会宁县|