配置resin web方式部署项目

写在前面,推荐下载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 reporting
dev_mode      : false

# How often Resin should check for updated files.
# dependency_check_interval : 5m

# Enable /resin-doc Resin documentation
resin_doc      : false
resin_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-2
app_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 cluster
home_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 : 8081
app.http          : 80
app.https         : 8443

web.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 80
setuid_user   :
setuid_group  : 

# Arg passed directly to the JVM
jvm_args  : -Xms1500m -Xmx1500m -XX:PermSize=206m -XX:MaxPermSize=206m
# jvm_args  : -Xmx2048m -XX:MaxPermSize=256m
jvm_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 port
port_thread_max   : 1000
accept_thread_max : 1000
accept_thread_min : 200
keepalive_max   : 512

# Enable JNI TCP speed optimizations
tcp_cork : true
sendfile : true
keepalive_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 memory
proxy_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 console
web_admin_enable : true
web_admin_host   :

# Permit access to /resin-admin from non-local network ip-addresses
web_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容器都会自动重启。不用手动重启,感觉很爽有没有。。。

时间: 2024-08-02 02:50:23

配置resin web方式部署项目的相关文章

java web 手动部署项目步骤

java Web 手动部署项目步骤 1 在tomcat下面的webapps下面建立需要部署的文件夹(eg:demo);2 在demo下建立 WEB-INF WETA-INF src 文件夹;3 在src下建立新的servlet.java文件4 在WEB-INF下面建立classes和web.xml文件 5通过命令“javac -d 目录地址 文件名” 编译servlet,前提是必须把tomcat目录下的lib里面的servlet-api.jar拷贝到当前的servlet源文件目录下. 在配置环境

Eclipse使用Alibaba Cloud Toolkit极速部署项目

个人博客 地址:https://www.wenhaofan.com/a/20190716205809 什么是Alibaba Cloud Toolkit Cloud Toolkit 是针对 IDE 平台为开发者提供的一款插件,帮助开发者更高效地开发.测试.诊断并部署应用.通过插件,您可以将本地应用一键部署到云端(ECS.EDAS.容器服务 Kubernetes 等)和任意服务器:并且它还内嵌了 Arthas 程序诊断. Terminal Shell 终端和 MySQL 执行器等工具. 安装Alib

tomcat入门(一)几种常见的使用tomcat部署项目的方式

1.常规方式部署 直接把web项目复制到tomcat安装目录下的%Tomcat_Home%/webapps/{web项目} 2.使用控制台进行部署 若一个web应用结构为D:\workspace\WebApp\AppName\WEB-INF\*,利用控制台进行部署的方式如下:进入tomcat的manager控制台的deploy区域--在Context path中键入"XXX"(可任意取名)--在WAR or Directory URL:键入D:\workspace\WebApp\App

Tomcat部署项目的几种常见方式

以前学习的时候只知道在Eclipse或者MyEclipse中发布项目到Tomcat,最近实习时发现不同的项目还有不同的发布方式,所以特地学习了Tomcat发布项目的方式,在此记录下来. 1 直接将web项目文件件拷贝到webapps目录中 这是最常用的方式,Tomcat的Webapps目录是Tomcat默认的应用目录,当服务器启动时,会加载所有这个目录下的应用.如果你想要修改这个默认目录,可以在conf下的server.xml文件里修改Host标签里的appBase值. 这个方法实际上和在IDE

将web应用部署到Tomcat的三种方式

Tomcat作为Servlet/JSP容器(服务器)挺不错的,开源免费,需要知道的是Tomcat是一个Web服务器,其符合Servlet/JSP规范,但是却没有实现所有JavaEE规范,所以我们还是应该规范说法,称Tomcat为一个JavaWeb服务器,而不是JavaEE服务器 我们使用IDE部署JavaWeb项目基本上都是一键完成,这是IDE给我们该来的好处,但是还是有必要了解一下部署项目的细节 要将JavaWeb应用部署到Tomcat,需要显式或隐式定定义一个Tomcat上下文.在Tomca

Java Web开发: Tomcat中部署项目的三种方法

web开发,在tomcat中部署项目的方法: 注意大小写 1.在conf目录中新建Catalina\localhost目录,在该目录中新建一个xml文件,名字可以随意取,只要和当前文件中的文件名不重复就行了,改xml文件的内容为: <Context path="/qxmobile"  docBase="/usr/local/webroot/qxmobile" reloadable="false"  debug="0" p

Tomcat的安装配置与web项目发布

Tomcat的安装配置与web项目发布 今日内容 1.Web开发基本概念(了解) 2.tomcat的安装和配置(必会) 3.web项目的发布(必会) 4.Http协议简介(理解) Web开发基本概念 1.软件的架构 常用的软件:QQ.京东.淘宝.kgc 1)C/S架构 解释:客户端/服务器. 特点:需要下载并安装,每次更新需要下载,客户端和服务器有可能都需要更新 控件炫酷,因为它调用的是系统底层的图形的API 2)B/S架构 解释:浏览器/服务器架构.它是基于Http协议的,用的是请求/响应模式

01_Nginx安装,nginx下部署项目,nginx.conf配置文件修改,相关文件配置

?? 1.下载Nginx,进入Nginx下载地址:http://nginx.org/ 点击nginx-1.8.0,进入:http://nginx.org/en/download.html,下载文件: 2 下载pcre,这个是一个正则表达式的库,Nginx做rewriter的时候回用到这个库: 进入pcre的官网(rewrite模式需要pcre):http://www.pcre.org/ 选中右击复制所需要的版本: 3 下载zlib库(gzip模块需要zlib):http://www.zlib.n

走进云背后:微软Azure web 项目通过web service部署web site

探索云那不为人知的故事(一):Web Services部署web site 前奏:Windows Azure是微软基于云计算的操作系统,现在更名为“Microsoft Azure”,和Azure Services Platform一样,是微软“软件和服务”技术的名称.Windows Azure的主要目标是为开发者提供一个平台,帮助开发可运行在云服务器.数据中心.Web和PC上的应用程序.云计算的开发者能使用微软全球数据中心的储存.计算能力和网络基础服务.Azure服务平台包括了以下主要组件:Wi