resin4.0配置运行总结

安装

Install JDK 6 or later and link /usr/java to the Java home or define the environment variable JAVA_HOME.
tar -vzxf resin-4.0.x.tar.gz
cd resin-4.0.x #修改文件名貌似会出问题
./configure --prefix=`pwd`
some details on the ./configure options.
make
sudo make install
Execute sudo resinctl start
or run java -jar lib/resin.jar start
Browse to http://localhost:8080

启动

resinctl

  1. Start resin with resinctl start
  2. Stop resin with resinctl stop
  3. Restart resin with resinctl restar

resin.sh

bin/resin.sh start|restart|stop -server 

配置

概念和命名约定

  • cluster - a collection of identically-configured servers.
  • environment - isolated class-loader contexts with shared resources: server, host and web-app are the main environments.
  • host - a HTTP virtual host.
  • proxy cache - HTTP proxy cache.
  • resource - drivers or services available to the application though JNDI or CDI like databases, JMS queues, custom CDI-configured service. Resin-specific resources include security, authenticators, health-checks and the rewrite/dispatch system.
  • rewrite/dispatch - the configuration for dispatching HTTP URLs to servlets and response codes like Apache's mod_rewrite.
  • server - a Resin JVM instance. There may be multiple servers on a machine.
  • watchdog - a JVM instance which watches over the Resin server and restarts the server if necessary.
  • web-app - a HTTP web-application which runs servlets.

resin.xml

删除社区版不支持的功能

health



loadbalance


    

删除不需要的cluster


    ...


    ...


    ...

只保留即可

server

端口

resin server涉及的端口

  • WatchDog 的端口,默认6600
  • Server 监控端口,默认6800
  • 应用的HTTP端口,默认8080

单个server

 
    6601 
     

多个server

  
    6601  
      

jvm参数


    
        -Xms32m
        -Xmx512m
        -Xss1m
        -verbosegc
        -Dfoo=bar
        -Dcaucho.smallmem
        -agentlib:resin
        -Xdebug
            
        
    
    
    ...

参考

http://www.caucho.com/resin-4.0/admin/starting-resin-command-line.xtp

删除doc


    
        
    

添加自定义应用

  
 

应用参数

防止避免hash collision dos攻击、日志


    100
      
      

host 配置举例

同一个域名下多个子app


    
    

    
      
      
    

    
    
      
        
      
    

    
    
      
      
      
    

 


多个域名,虚拟主机(virtual host)


    
    
    
      
      
    

    
    
      
        
      
    

    
    
      
    

    
      
    

 

resin.xml举例




  
  

  
     
  


  
  
               
  
   
  
  

  
  

  
  
  
  
  
    
    
    
  

  
  ${cluster_system_key}

  
  ${dependency_check_interval?:'2s'}

  
  ${home_cluster}
  ${home_server}
  ${elastic_server}
  ${elastic_dns}

  
  
    
    
     
        6601 
         
    

    
      
      
    

    
    
      
        
      
    

      
      
        100
          
          
      
      
        100
          
          
      
    
  




resin.properties

web_admin_enable : false  
session_store : false  
resin_doc : false  
dev_mode:false
# 集群端口
app.http: 8080

你可能感兴趣的:(resin4.0配置运行总结)