同一台服务器上一个resin配置多个应用,启动独立

同一台服务器上一个resin配置多个应用,每个应用的启动独立。
resin.conf
<!--
   - Resin 3.1 configuration file.
  -->
<resin xmlns="http://caucho.com/ns/resin"
       xmlns:resin="http://caucho.com/ns/resin/core">

  <!-- adds all .jar files under the resin/lib directory -->
  <class-loader>
    <tree-loader path="${resin.home}/lib"/>
    <tree-loader path="${resin.root}/lib"/>
  </class-loader>

  <!--
     - Management configuration
    -->
  <management path="${resin.root}/admin">
  </management>

  <!--
     - Logging configuration for the JDK logging API.
    -->
  <log name="" path="stdout:" timestamp="[%H:%M:%S.%s] "/>

  <!--
     - 'info' for production
     - 'fine' or 'finer' for development and troubleshooting
    -->
  <logger name="com.caucho" level="info"/>

  <logger name="com.caucho.java" level="config"/>
  <logger name="com.caucho.loader" level="config"/>

  <!--
     - For production sites, change dependency-check-interval to something
     - like 600s, so it only checks for updates every 10 minutes.
    -->
  <dependency-check-interval>2s</dependency-check-interval>

  <!--
     - SMTP server for sending mail notifications
    -->
  <system-property mail.smtp.host="127.0.0.1"/>
  <system-property mail.smtp.port="25"/>

  <!--
     - You can change the compiler to "javac", "eclipse" or "internal".
    -->
  <javac compiler="internal" args="-source 1.5"/>


  <cluster id="app-tier">
    <!-- sets the content root for the cluster, relative to server.root -->
    <root-directory>.</root-directory>

    <resin:import path="${resin.home}/conf/app-default.xml"/>

    <!-- configures a deployment directory for virtual hosts -->
    <host-deploy path="hosts">
      <host-default>
         <access-log path="logs/app1-access.log"
            format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
            rollover-period="1D"/>
        <resin:import path="host.xml" optional="true"/>
      </host-default>
    </host-deploy>

    <server id="app1" port="6801">
      <http id="" port="8081"/>
    </server>
    <host id="" root-directory=".">
    <log name="" level="info" path="log/stdout_app1.log" timestamp="[%H:%M:%S.%s] "
     archive-format="stdout_app1.log.%Y-%m-%d.gz"
     rollover-period="1D"/>

      <web-app id="/app1" root-directory="/usr/app5/app/webapps/app1"/>
      <!--<web-app id="/" root-directory="webapps/dgyb"/>-->
      <web-app id="/resin-admin" root-directory="${resin.home}/php/admin">
        <prologue>
          <resin:set var="resin_admin_user" value="admin"/>
          <resin:set var="resin_admin_password" value="kkkkkkkkkkkkkkkkkkkkkkkkkkkkk"/>
          <resin:set var="resin_admin_external" value="true"/>
        </prologue>
      </web-app>
    </host>
   
   
  </cluster>

  <cluster id="app-tier2">
    <!-- sets the content root for the cluster, relative to server.root -->
    <root-directory>.</root-directory>

    <resin:import path="${resin.home}/conf/app-default.xml"/>

    <!-- configures a deployment directory for virtual hosts -->
    <host-deploy path="hosts">
      <host-default>
         <access-log path="logs/app3-access.log"
            format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
            rollover-period="1D"/>
        <resin:import path="host.xml" optional="true"/>
      </host-default>
    </host-deploy>

    <server id="app3" port="6802">
      <http id="" port="8082"/>
    </server>
    <host id="" root-directory=".">
    <log name="" level="info" path="log/stdout_app3.log" timestamp="[%H:%M:%S.%s] "
     archive-format="stdout_app3.log.%Y-%m-%d.gz"
     rollover-period="1D"/>
    <log name="com.caucho.java" level="config" path="log/stdout_app3.log"
       timestamp="[%H:%M:%S.%s] "/>
    <log name="com.caucho.loader" level="config" path="log/stdout_app3.log"
       timestamp="[%H:%M:%S.%s] "/>

      <web-app id="/" root-directory="/usr/app5/app/webapps/app3"/>
    </host>
  </cluster>
  

  <cluster id="app-tier3">
    <!-- sets the content root for the cluster, relative to server.root -->
    <root-directory>.</root-directory>

    <resin:import path="${resin.home}/conf/app-default.xml"/>

    <!-- configures a deployment directory for virtual hosts -->
    <host-deploy path="hosts">
      <host-default>
         <access-log path="logs/app4-access.log"
            format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
            rollover-period="1D"/>
        <resin:import path="host.xml" optional="true"/>
      </host-default>
    </host-deploy>

    <server id="app4" port="6803">
      <http id="" port="8083"/>
    </server>
    <host id="" root-directory=".">
     <log name="" level="info" path="log/stdout_app4.log" timestamp="[%H:%M:%S.%s] "
     archive-format="stdout_app4.log.%Y-%m-%d.gz"
     rollover-period="1D"/>

      <web-app id="/" root-directory="/usr/app5/app/webapps/comicapp4/smsapp/webapps/comicapp4/"/>
    </host>
  </cluster>

  <cluster id="app-tier4">
    <!-- sets the content root for the cluster, relative to server.root -->
    <root-directory>.</root-directory>

    <resin:import path="${resin.home}/conf/app-default.xml"/>

    <!-- configures a deployment directory for virtual hosts -->
    <host-deploy path="hosts">
      <host-default>
         <access-log path="logs/app4-app5.log"
            format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
            rollover-period="1D"/>
        <resin:import path="host.xml" optional="true"/>
      </host-default>
    </host-deploy>

    <server id="app5" port="6804">
      <http id="" port="8084"/>
    </server>
    <host id="" root-directory=".">
     <log name="" level="info" path="log/stdout_app5.log" timestamp="[%H:%M:%S.%s] "
     archive-format="stdout_app4.log.%Y-%m-%d.gz"
     rollover-period="1D"/>

      <web-app id="/" root-directory="/usr/app5/app/webapps/report"/>
    </host>
  </cluster>

  <cluster id="app-tier5">
    <!-- sets the content root for the cluster, relative to server.root -->
    <root-directory>.</root-directory>

    <resin:import path="${resin.home}/conf/app-default.xml"/>

    <!-- configures a deployment directory for virtual hosts -->
    <host-deploy path="hosts">
      <host-default>
         <access-log path="logs/access-httpcreate.log"
            format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
            rollover-period="1D"/>
        <resin:import path="host.xml" optional="true"/>
      </host-default>
    </host-deploy>

    <server id="create" port="6805">
      <http id="" port="8085"/>
    </server>
    <host id="" root-directory=".">
     <log name="" level="info" path="log/stdout_create.log" timestamp="[%H:%M:%S.%s] "
     archive-format="stdout_create.log.%Y-%m-%d.gz"
     rollover-period="1D"/>

      <web-app id="/" root-directory="/usr/app5/app/webapps/httpcreate"/>
    </host>
  </cluster>

  <cluster id="app-tier6">
    <!-- sets the content root for the cluster, relative to server.root -->
    <root-directory>.</root-directory>

    <resin:import path="${resin.home}/conf/app-default.xml"/>

    <!-- configures a deployment directory for virtual hosts -->
    <host-deploy path="hosts">
      <host-default>
         <access-log path="logs/access-app2.log"
            format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
            rollover-period="1D"/>
        <resin:import path="host.xml" optional="true"/>
      </host-default>
    </host-deploy>

    <server id="app2" port="6806">
      <http id="" port="8086"/>
    </server>
    <host id="" root-directory=".">
     <log name="" level="info" path="log/stdout_app2.log" timestamp="[%H:%M:%S.%s] "
     archive-format="stdout_app2.log.%Y-%m-%d.gz"
     rollover-period="1D"/>

      <web-app id="/" root-directory="/usr/app5/app/webapps/app2"/>
    </host>
  </cluster>

</resin>

stapp2.sh
if (test "$1" = "start")
    then
cd /usr/app5/app/resin-pro/
./bin/httpd.sh -server app2 start

elif(test "$1" = "stop")
    then
cd /usr/app5/app/resin-pro/
./bin/httpd.sh -server app2 stop

elif(test "$1" = "log")
    then
cd /usr/app5/app/resin-pro/
tail -f ./log/jvm-app2.log
elif(test "$1" = "std")
    then
    cd /usr/app5/app/resin-pro/
    tail -f ./log/stdout_app2.log

elif(test "$1" = "up")
    then
cd /usr/app5/app/weapps/app2
svn up
else
    echo '------app Args--------'
    echo 'start --start app'
    echo 'stop  --stop app'
    echo 'log   --view app log'
    echo 'up    --svn check up code'
fi

stapp3.sh

if (test "$1" = "start")
    then
cd /usr/app5/app/resin-pro/
./bin/httpd.sh -server app3 start

elif(test "$1" = "stop")
    then
cd /usr/app5/app/resin-pro/
./bin/httpd.sh -server app3 stop

elif(test "$1" = "log")
    then
cd /usr/app5/app/resin-pro/
tail -f ./log/jvm-app3.log
elif(test "$1" = "up")
    then
cd /usr/app5/app/weapp/app1
svn up
else
    echo '------app Args--------'
    echo 'start --start app'
    echo 'stop  --stop app'
    echo 'log   --view app log'
    echo 'up    --svn check up code'
fi

猜你喜欢

转载自jadewoo.iteye.com/blog/649646
今日推荐