配置resin web方式部署項目

來源:互聯網
上載者:User

標籤:previous   update   jsp   imp   xms   代碼   must   沒有   memcached   

寫在前面,推薦下載resin4.0.47版本。其它版本沒有測試

最近打算做一個小項目,然後容器選用了resin。想通過web提交war檔案的方式 進行部署,更新代碼也方便。

試了resin最新的版本(目前最新版本為4.0.53),提交war檔案到webapps下面都是.tmp檔案。百度google一通還是沒找到解決辦法。

看了下公司用的resin版本,選擇4.0.47。下載後發現沒最新版本的上傳問題。

 

通過web提交war檔案方式步驟如下:

步驟一:修改resin.properties。推薦配置如下

resin.properties

# resin.properties - configuration variable values# # See resin.xml, cluster-default.xml, and health.xml for full configuration.# Any variable defined by ${...} can be set as a property in this file.# # Individual server overrides can be specified by prepending the server.id.# For example, increasing the log level for an individual server:## log_level : info# app-0.log_level : finest## Like Resin XML configuration, modification of this file will trigger# a restart.## General log level (modify resin.xml for more granular log level adjustments)# log_level     : finer# Enable verbose browser error reportingdev_mode      : false# How often Resin should check for updated files.# dependency_check_interval : 5m# Enable /resin-doc Resin documentationresin_doc      : falseresin_doc_host :# List Triad server ip-addresses:hmux-port for each tier, space separated# App tier Triad servers must be listed to enable web-tier to # app-tier load-balancing# web-tier Triad servers: web-0 web-1 web-2# web_servers      : 127.0.0.1:6810# app-tier Triad servers: app-0 app-1 app-2app_servers      : 127.0.0.1:6800# Configures Resin for a memcached server tier# memcached-tier Triad servers: memcached-0 memcached-1 memcached-2# memcached_servers    : 127.0.0.1:6820# memcached_port : 11211# proxycache tier: proxycache-0 proxycache-1 proxycache-2# proxycache_servers   : 127.0.0.1:6830# backend_servers       : 127.0.0.1:80# Allow elastic nodes to join the cluster (enable for cloud mode)# elastic_cloud_enable : true# The cluster that elastic nodes should join - each will contact a Triad server# Use a separate resin.properties file for each clusterhome_cluster : app# Used for an elastic server to join the cluster in home_cluster# elastic_server : true# Create a distinct webapps/ directory for each server, for vertical scaling# elastic_webapp : true# Used for cloud servers with dynamic IP addresses where the DNS name for the# server is assigned after the server starts. Resin will retry the start.# elastic_dns : true# specifies the --server in the config file# home_server : app-0# Set HTTP and HTTPS bind address# http_address  : *# Set HTTP and HTTPS ports.# Use overrides for individual server control, for example: app-0.http : 8081app.http          : 80app.https         : 8443web.http          : 80# web.https         : 8443# memcached.http      : 8080# memcached.https     : 8443# proxycache.http    : 8080# proxycache.https  : 8443# For security, Resin can switch to a non-root user after binding to port 80setuid_user   : setuid_group  : # Arg passed directly to the JVMjvm_args  : -Xms1500m -Xmx1500m -XX:PermSize=206m -XX:MaxPermSize=206m# jvm_args  : -Xmx2048m -XX:MaxPermSize=256mjvm_mode    : -server# This classpath has priority over the default classpath, like when you want to# use a third party library like Hibernate‘s JPA# jvm_classpath :# Local URLs for the watchdog to check to ensure the server is up,# space separated# http_ping_urls : http://127.0.0.1/test.jsp# Throttle the number of active threads for a portport_thread_max   : 1000accept_thread_max : 1000accept_thread_min : 200keepalive_max   : 512# Enable JNI TCP speed optimizationstcp_cork : truesendfile : truekeepalive_select_enable : true# OpenSSL certificate configuration# Keys are typically stored in the resin configuration directory.# openssl_file : keys/test.crt# openssl_key : keys/test.key# openssl_password : changeme# openssl_protocols : -sslv2 -sslv3# JSSE certificate configuration# Keys are typically stored in the resin configuration directory.# jsse_keystore_type : jks# jsse_keystore_file : /etc/resin/keys/server.keystore# jsse_keystore_password : changeme# In absence of a signed certificate, Resin will fallback to using a # self-signed development certificate if HTTPS is enabled# Enable the proxy-cache - for caching static content in memoryproxy_cache_enable : false# Sets the proxy cache memory size# proxy_cache_size : 256m# Enable clustered persistent sessions (for failover)session_store : true# disable the quercus *.php mapping when using Apache for PHP# quercus_disable : true# Web-apps named with numeric suffixes, e.g. foo-10.0.war and can be browsed# as /foo. When a new version of the web-app is deployed, Resin continues# to route active session requests to the previous web-app version while# new sessions go to the new version, so users will not be aware of the# application upgrade.# webapp_multiversion_routing : true# Set the email address to receive weekly and restart PDF reports# email : [email protected]# pdf_summary : true# Set a global password to prevent foreign Resin instances from connecting.# Must be identical between web, app, and cache clusters.# cluster_system_key : changeme# Enable remote admin (for remote CLI and for EC2 ext: triad discovery)# remote_admin_enable : true# Enable /resin-admin web administration consoleweb_admin_enable : trueweb_admin_host   :# Permit access to /resin-admin from non-local network ip-addressesweb_admin_external : true# Require HTTPS to access /resin-admin# web_admin_ssl : true# Enable Resin REST Admin# rest_admin_enable : true# Require SSL for REST Admin# rest_admin_ssl : true# Access to /resin-admin and remote CLI is password restricted.# Use "resinctl generate-password" and copy/paste here to set the admin# admin_user : admin# admin_password : {SSHA}xxxxxxxx# Enable reading EC2 user data as resin properties# properties_import_url : http://169.254.169.254/latest/user-data


resin.xml

<host id="youryuming.com" root-directory=".">            <web-app id="/" root-directory="webapps/testDeploy"/>    </host>

步驟二:訪問https://youryuming.com:8443/resin-admin/ 

  tips:如果沒有進行網域名稱映射,使用伺服器ip也可以

PS:為什麼要使用https,註冊不使用https也可以,通過youryuming.com:8443/resin-admin/ 也可以。後面進行上傳war包就會提示需要使用ssl。為了避免麻煩索性直接通過https進行註冊登入

點擊create configuration file 後根據頁面提示進行操作修改,這裡不再贅述。

resin容器檢測到有設定檔修改時,會進行自動重啟,修改設定檔時,不用關閉resin或者重啟。

步驟三:發布項目

 

 

 

 每次部署項目,resin容器都會自動重啟。不用手動重啟,感覺很爽有沒有。。。

配置resin web方式部署項目

相關文章

聯繫我們

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