centos 安裝 jetty9,centosjetty9

來源:互聯網
上載者:User

centos 安裝 jetty9,centosjetty9

1、解壓縮jetty9

cd /opt/app/jetty9 2、建立臨時目錄mkdir tmp 3、修改jetty.sh ,添加如下: JETTY_ARGS=jetty.port=8080
JAVA=/usr/java/jdk1.7.0_03/bin/java
JETTY_HOME=/opt/app/app-jetty
JETTY_BASE=$JETTY_HOME
JETTY_RUN=$JETTY_BASE
TMPDIR=$JETTY_HOME/tmpJAVA_OPTIONS="-server -Xms1G -Xmx1G -Xmn500m -Xss256k -XX:MaxDirectMemorySize=100m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:NewSize=500m -XX:MaxNewSize=500m -XX:+UseParNewGC -XX:MaxTenuringThreshold=2 -XX:SurvivorRatio=8 -XX:+UnlockDiagnosticVMOptions -XX:ParGCCardsPerStrideChunk=32768 -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+ParallelRefProcEnabled -XX:CMSFullGCsBeforeCompaction=5 -XX:+UseCMSCompactAtFullCollection -XX:+CMSClassUnloadingEnabled  -XX:CMSInitiatingOccupancyFraction=80 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime -XX:-OmitStackTraceInFastThrow -Dcom.sun.management.jmxremote=true -Djava.rmi.server.hostname=10.132.67.100 -Dcom.sun.management.jmxremote.port=18787 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/jvmlogs -Xloggc:/var/jvmlogs/app-heap_dump.log" 4、在webapps目錄添加app.xml <?xml version="1.0"  encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Set name="contextPath">/app</Set>
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/app.war</Set>
  <Set name="tempDirectory"><SystemProperty name="jetty.home" default="."/>/tmp</Set>
  <Set name="persistTempDirectory">true</Set>
   <Set name="handler">
     <New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler">
       <Set name="requestLog">
          <New id="RequestLogImpl" class="org.eclipse.jetty.server.NCSARequestLog">
            <Set name="filename"><Property name="jetty.logs" default="./logs"/>/yyyy_mm_dd.request.log</Set>
            <Set name="filenameDateFormat">yyyy_MM_dd</Set>
            <Set name="LogTimeZone">Asia/Shanghai</Set>
            <Set name="retainDays">60</Set>
            <Set name="append">true</Set>
          </New>
       </Set>
     </New>
  </Set>
</Configure>  5、把war放在webapps目錄 6、jetty.sh restart 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.