Jboss 安全和優(yōu)化_第1頁
免費(fèi)預(yù)覽已結(jié)束,剩余1頁可下載查看

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、jboss 安全和優(yōu)化一 jboss后臺(tái)啟動(dòng): 添加后臺(tái)修改: vi run.sh while ue; do if x$launch_jboss_in_background = x ; then exee the jvm in the foreground nohup $java $java_opts -djava.endors.= $jboss_endorsed_dirs -classpath $jboss_classpath org.jboss.main $ jboss_status=$? ee execute the jvm in the background $java $java_o

2、pts -djava.endor.dirs= $jboss_endorsed_dirs -classpath $jboss_classpath org.jboss.main $ jboss_pid=$! trap common signals and relay them to the jboss process trap -hup $jboss_pid hup trap kill -term $jboss_pid int trap kill -quit $jboss_pid quit trap kill -pipe $jboss_pid pipe trap kill -term $jboss

3、_pid term wait until the background process its wait_status=0 while $wait_status -ne 127 ; do jboss_status=$wait_status wait $jboss_pid 2 /dev/null wait_status=$? done fi if restart doesn't work, check you are running jbossas 4.0.4+ or the following if you're running red hat 7.0 if $jboss_st

4、atus -eq 10 ; then echo restarting jboss. else exit $jboss_status fi done 二 jboss內(nèi)存優(yōu)化: 修改這個(gè)兩參數(shù),給jvm分配適當(dāng)?shù)膬?nèi)存,普通為服務(wù)器的3/4內(nèi)存量,推舉起碼用法4g內(nèi)存。 另 外添加兩個(gè)參數(shù) -xx:+useparallelgc -xx:+useparalleloldgc 這兩個(gè)讓服務(wù)并行回收內(nèi)存空間。修改完成后,大致為 java_opts = -xms4096m -xmx8192m -xx:+useparallelgc -xx:+useparalleloldgc -dsum 三 jboss日志輸出模

5、式 root190mem conf /usr/local/jboss/server/default/conf root190mem conf vi jboss-log4j.xml appender name= file > errorhandler ' target='_blank'>nceerrorhandler / param name= file value= $jboss.server.log.dir/server.log / param name= append value= false / param name= threshold value=

6、 error / 四 jboss數(shù)據(jù)庫銜接池優(yōu)化 修改數(shù)據(jù)庫銜接池: datasources local-tx-datasource jndi-name training_master_db /jndi-name connection-url jdbc:mysql:/28:3306/dts?useunicode=true characterencoding=utf-8 /connection-url driver-class com.mysql.jdbc.driver /driver-class user-name root /user-name password /

7、password min-pool-size 100 /min-pool-size max-pool-size 500 /max-pool-size exception-er-class-name org.jboss.resource.adapter.jdbc.vendor.mysqlexceptionsorter /exception-sorter-class-name 五 jboss部署名目優(yōu)化: 去掉和應(yīng)用無關(guān)的部署,加快jboss運(yùn)行速度 bsh-deployer.xml client-deployer-service.xml ear-deployer.xml ejb-deployer

8、.xml http-invoker.sar jboss-bean.deployer jboss-ws4ee.sar jms jsr88-service.xml schele-manager-service.xml scheduler-service.xml sqlexception-service.xml uu-key-generator.sar 六 jboss應(yīng)用平安加固: 去掉: toat us (full) (xml) jmx console jboss web console 刪除deploy下的jmx-console.war/ management/ root190mem deplo

9、y pwd /usr/local/jboss/server/default/deploy root190mem deploy ls jmx-console.war/ management/ jmx-console.war/: checkjndi.jsp displaymbeans.jsp images inspectmbean.jsp meta-inf web-inf cluster displayopresult.jsp index.jsp jboss.css style_master.css management/: console-mgr.sar 一、 前言: jboss默認(rèn)安裝以后,會(huì)

10、默認(rèn)打開,顯示如下: jboss online resources jboss 4.0 documentation jboss wiki jboss forums jboss management tom status (full) (xml) jmx console jboss web console jmx console和jboss web console 里面可以修改和刪除應(yīng)用的參數(shù),假如不加強(qiáng)平安設(shè)置,將會(huì)帶來嚴(yán)峻平安后果。 二、 關(guān)閉管理端口和相關(guān)統(tǒng)計(jì)信息: 1、 關(guān)閉jmx-console: 刪除 /home/jboss-4.0.3sp1/serve

11、r/default/deploy下名目jmx-console.war、management 2、 關(guān)閉web-console: 刪除 /export/home/jboss-4.0.3sp1/server/default/deploy/jbossweb-tomcat55.sar下名目root.war 3、 關(guān)閉status統(tǒng)計(jì)信息: 修改/export/home/jboss-4.0.3sp1/server/default/deploy/root.war/web-inf/web.xml 屏蔽其中jboss的內(nèi)容:粗體為添加屏蔽符號(hào): !-display-name welcome to jboss

12、/display-name description welcome to jboss /description servlet servlet-name status servlet /servlet-name servlet-class org.jboss.web.tomcat.tc5.statusservlet /servlet-class /servlet- !-servlet-map servlet-name status servlet /servlet-name url-pattern /status /url-pattern /servlet-mapping- 4、 刪除jbos

13、s主頁相名目和文件: /export/home/jboss-4.0.3sp1/server/default/deploy/root.war下:manager/favicon.ico/jboss.css/jbossindex.html/logo.gif lion:/export/home/jboss-4.0.3sp1/server/default/deploy/root.war -rf manager favicon.ico jboss.css jbossindex.html logo.gif 5、 備注: 三、 關(guān)閉完成測試: 1、 /jmx-console 2、

14、 /web-console 3、 /jbossindex.html 4、 /status 5、 測試結(jié)果: 測試人 時(shí)光 服務(wù)器 jmx-console web-console status jbossindex.html 測試 jboss默認(rèn)配置了以下服務(wù): jmx console jboss web console 為了平安起見,需要用戶通過授權(quán)舉行拜訪。 一、jmx平安配置 step 1: 找到%jboss_home%/server/default/deploy/jmx-console.war/we

15、b-inf/jboss-web.xml文件,按照解釋,去掉注釋。 jboss-web security-domain java:/jaas/jmx-console /security-domain /jboss-web step 2: 與jboss-web.xml同級(jí)名目下還有一個(gè)文件web.xml,找到其中的節(jié)點(diǎn),按照解釋,取消注釋。 security-constraint web-resource-lection web-resource-name htmladaptor /web-resource-name description an example security config t

16、hat only allows users with the role jbossadmin to access the html jmx console web application /description url-pattern /* /url-pattern http-method get /http-method http-method post /http-method /web-resource-collection auth-constraint role-name jbossadmin /role-name /auth-constraint /security-constr

17、aint step 3: 在第一步中的jmx-console平安域和其次步中的運(yùn)行角色jbossadmin都是在login-config.xml中配置,我們?cè)? application-policy name = jmx-console authentication login-module code= org.jboss.security.auth.spi.usersrolesloginmodule flag = required module-option name= usersproperties props/perties /module-op

18、tion module-option name= rolesproperties props/perties /module-option /login-module /authentication /application-policy 文件props/perties定義了用戶名、密碼;props/perties定義了用戶所屬角色 注: perties 格式是:用戶名=密碼明文 per

19、ties 格式是:用戶名=角色1,角色2,角色3 二、web-console的平安配置 step 1: 找到%jboss_home%/server/default/deploy/ management/console-mgr.sar/web-console.war/web-inf/jboss-web.xml文件,按照解釋,去掉注釋。 jboss-web depends jboss.admin:service=pluginmanager /depends /jboss-web step 2: 與jboss-web.xml同級(jí)名目下還有一個(gè)文件web.xml,找到其中的節(jié)點(diǎn),按照解釋,取消注釋。

20、security-constraint web-resource-collection web-resource-name htmladaptor /web-resource-name description an example security config that only allows users with the role jbossadmin to access the html jmx console web application /description url-pattern /* /url-pattern http-method get /http-method http-method post /http-method /web-resource-collection auth-constraint role-name jbossadmin /role-name /auth-constraint /security-constraint step 3: 在本名目的classes文件夾下找到perties和perties兩個(gè)文件更名為: application-policy name = web-console authentication

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論