Linux配置JDK1.7和Resin4.0

1、安装JDK1.7

  (1)下载

  官网下载路径:http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

  选择适合自己的版本下载。

  (2)安装解压即可

  

  (3)修改环境变量

》vi /etc/profile

文件末尾插入以下内容:
export JAVA_HOME=/opt/jdk1.7.0_79
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH

重新加载刚修改的配置文件:
》source /etc/profile

  (4)测试是否安装成功

》java -version

》javac

》whereis java

》which java(Java执行路径)

》echo $JAVA_HOME

》echo $PATH

 

  

2、安装Resion4.0

  (1)下载地址 :http://caucho.com/products/resin/download

  (2)配置conf/resion.xml

<resin xmlns="http://caucho.com/ns/resin" xmlns:resin="urn:java:com.caucho.resin">
        
  <!-- property-based Resin configuration -->
  <resin:properties path="${__DIR__}/resin.properties" optional="true"/>
  <resin:properties path="cloud:/resin.properties" optional="true" recover="true"/>

  <!-- Logging configuration for the JDK logging API -->
  <log-handler name="" level="all" path="stdout:"/>

  <stdout-log path="log/stdout.log" rollover-period="1D" timestamp="[%H:%M:%S.%s] "/>
  <stderr-log path="log/stderr.log" rollover-period="1D" timestamp="[%H:%M:%S.%s] "/>

  <logger name="" level="${log_level?:'info'}"/> 
  <logger name="com.caucho.java" level="config"/>
  <logger name="com.caucho.loader" level="config"/>

  <resin:import path="${__DIR__}/cluster-default.xml"/>

  <dependency-check-interval>${dependency_check_interval?:'600s'}</dependency-check-interval>

  <cluster id="calendar">
    <!-- define the servers in the cluster -->
    <server id="calendar" address="127.0.0.1" port="6600">
        <http address="*" port="8080"/>
        <watchdog-port>6666</watchdog-port>
         <!-- JVM性能参数 begin-->
        <jvm-arg>-Djava.rmi.server.hostname=${local_ip}</jvm-arg>
        <jvm-arg>-XX:+UnlockExperimentalVMOptions</jvm-arg>
        <jvm-arg>-XX:+UseG1GC</jvm-arg>
        <jvm-arg>-XX:MaxGCPauseMillis=50</jvm-arg>
        <jvm-arg>-XX:GCPauseIntervalMillis=200</jvm-arg>
        <jvm-arg>-XX:SurvivorRatio=6</jvm-arg>
        <jvm-arg>-Xmx1024m</jvm-arg>
        <jvm-arg>-Xms1024m</jvm-arg>
        <jvm-arg>-Xss1m</jvm-arg>
        <jvm-arg>-XX:MaxPermSize=512m</jvm-arg>
        <jvm-arg>-Xloggc:${resin.root}/log/jdk_gc.log</jvm-arg>
        <!-- JVM性能参数 end-->
    </server>

    <!-- the default host, matching any host name -->
    <host id="" root-directory=".">
        <web-app id="/" root-directory="webapps/ROOT"/> 
        <web-app id="/calendar/" root-directory="webapps/calendar/"/>
        <!-- access log 配置 --> 
        <access-log path="log/access_${cluster.id}.log"  archive-format='access_${cluster.id}.log.%Y%m%d%H' rollover-period="1h" />
    </host>
    <host-default>
         <web-app-deploy path="webapps"
                   expand-preserve-fileset="WEB-INF/work/**"
                   multiversion-routing="${webapp_multiversion_routing}"
                   path-suffix="${elastic_webapp?resin.id:''}"/>
    </host-default>
  </cluster>
</resin>

  同时Resi下面可以配置JVM监控和配置多个项目,请参考下面的博文:

  http://blog.csdn.net/hereiskxm/article/details/41843577

 

posted @ 2016-11-02 11:27  星星满天  阅读(429)  评论(0编辑  收藏  举报