同一台服务器上一个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
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com