- 浏览: 2550867 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Server Deployment - Jetty
I try to run jetty as the same deployment structure as apache tomcat.
3 multi instances run in one ubuntu Server with one copy of my dist war package.
I installed 3 versions of jetty servers, jetty-6.1.3, jetty-7.4.1, jetty-8.0.0.
1. The shell script
The shell script start-jetty1.sh
#!/bin/sh
JETTY_HOME="/home/luohua/tools/shellscript/jetty-6.1.3"
JETTY_BASE="/home/luohua/tools/shellscript/jetty1"
export JETTY_HOME JETTY_BASE
cd ${JETTY_HOME}
java -jar start.jar "${JETTY_BASE}/jetty.xml"
The shell script start-jetty2.sh
#!/bin/sh
JETTY_HOME="/home/luohua/tools/shellscript/jetty-7.4.1"
JETTY_BASE="/home/luohua/tools/shellscript/jetty2"
export JETTY_HOME JETTY_BASE
cd ${JETTY_HOME}
java -jar start.jar --ini "${JETTY_BASE}/jetty.xml" jetty.port=8084
The shell script start-jetty3.sh
#!/bin/sh
JETTY_HOME="/home/luohua/tools/shellscript/jetty-8.0.0"
JETTY_BASE="/home/luohua/tools/shellscript/jetty3"
export JETTY_HOME JETTY_BASE
cd ${JETTY_HOME}
java -jar start.jar --ini "${JETTY_BASE}/jetty.xml" jetty.port=8085
2. The jetty.xml configuration files in jetty1/jetty2/jetty3 directories
jetty1/jetty.xml (for jetty 6.1.3)
<Call name="addConnector">
<Arg>
<New class="org.mortbay.jetty.nio.SelectChannelConnector">
<Set name="port"><SystemProperty name="jetty.port" default="8083"/></Set>
<Set name="maxIdleTime">30000</Set>
<Set name="Acceptors">1</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesConnections">1000</Set>
<Set name="lowResourcesMaxIdleTime">500</Set>
</New>
</Arg>
</Call>
<Set name="handler">
<New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
<Set name="handlers">
<Array type="org.mortbay.jetty.Handler">
<Item>
<New class="org.mortbay.jetty.webapp.WebAppContext">
<Set name="contextPath">/easymarket</Set>
<Set name="resourceBase">/home/luohua/tools/shellscript/apps/easymarket</Set>
<Call name="addServlet">
<Arg>org.mortbay.jetty.servlet.DefaultServlet</Arg>
<Arg>/</Arg>
</Call>
</New>
</Item>
<Item>
<New id="RequestLog" class="org.mortbay.jetty.handler.RequestLogHandler"/>
</Item>
</Array>
</Set>
</New>
</Set>
jetty2/jetty.xml (for jetty 7.4.1)
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Set name="host"><Property name="jetty.host" /></Set>
<Set name="port"><Property name="jetty.port" default="8084"/></Set>
<Set name="maxIdleTime">300000</Set>
<Set name="Acceptors">2</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesConnections">20000</Set>
<Set name="lowResourcesMaxIdleTime">5000</Set>
</New>
</Arg>
</Call>
<Set name="handler">
<New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
<Set name="handlers">
<Array type="org.eclipse.jetty.server.Handler">
<Item>
<New class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/easymarket</Set>
<Set name="resourceBase">/home/luohua/tools/shellscript/apps/easymarket</Set>
<Call name="addServlet">
<Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
<Arg>/</Arg>
</Call>
</New>
</Item>
</Array>
</Set>
</New>
</Set>
jetty3/jetty.xml (for jetty 8.0.0)
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Set name="host"><Property name="jetty.host" /></Set>
<Set name="port"><Property name="jetty.port" default="8085"/></Set>
<Set name="maxIdleTime">300000</Set>
<Set name="Acceptors">2</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesConnections">20000</Set>
<Set name="lowResourcesMaxIdleTime">5000</Set>
</New>
</Arg>
</Call>
<Set name="handler">
<New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
<Set name="handlers">
<Array type="org.eclipse.jetty.server.Handler">
<Item>
<New class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/easymarket</Set>
<Set name="resourceBase">/home/luohua/tools/shellscript/apps/easymarket</Set>
<Call name="addServlet">
<Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
<Arg>/</Arg>
</Call>
</New>
</Item>
</Array>
</Set>
</New>
</Set>
The dist war package easymarket.war is unzip to a directory named easymarket.
3. Access the web page
http://localhost:8083/easymarket
http://localhost:8084/easymarket
http://localhost:8085/easymarket
references:
http://hi.baidu.com/luohuazju/blog/item/f74d2151c87a961e367abea4.html
http://docs.codehaus.org/display/JETTY/Running+Jetty-7.0.x
I try to run jetty as the same deployment structure as apache tomcat.
3 multi instances run in one ubuntu Server with one copy of my dist war package.
I installed 3 versions of jetty servers, jetty-6.1.3, jetty-7.4.1, jetty-8.0.0.
1. The shell script
The shell script start-jetty1.sh
#!/bin/sh
JETTY_HOME="/home/luohua/tools/shellscript/jetty-6.1.3"
JETTY_BASE="/home/luohua/tools/shellscript/jetty1"
export JETTY_HOME JETTY_BASE
cd ${JETTY_HOME}
java -jar start.jar "${JETTY_BASE}/jetty.xml"
The shell script start-jetty2.sh
#!/bin/sh
JETTY_HOME="/home/luohua/tools/shellscript/jetty-7.4.1"
JETTY_BASE="/home/luohua/tools/shellscript/jetty2"
export JETTY_HOME JETTY_BASE
cd ${JETTY_HOME}
java -jar start.jar --ini "${JETTY_BASE}/jetty.xml" jetty.port=8084
The shell script start-jetty3.sh
#!/bin/sh
JETTY_HOME="/home/luohua/tools/shellscript/jetty-8.0.0"
JETTY_BASE="/home/luohua/tools/shellscript/jetty3"
export JETTY_HOME JETTY_BASE
cd ${JETTY_HOME}
java -jar start.jar --ini "${JETTY_BASE}/jetty.xml" jetty.port=8085
2. The jetty.xml configuration files in jetty1/jetty2/jetty3 directories
jetty1/jetty.xml (for jetty 6.1.3)
<Call name="addConnector">
<Arg>
<New class="org.mortbay.jetty.nio.SelectChannelConnector">
<Set name="port"><SystemProperty name="jetty.port" default="8083"/></Set>
<Set name="maxIdleTime">30000</Set>
<Set name="Acceptors">1</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesConnections">1000</Set>
<Set name="lowResourcesMaxIdleTime">500</Set>
</New>
</Arg>
</Call>
<Set name="handler">
<New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
<Set name="handlers">
<Array type="org.mortbay.jetty.Handler">
<Item>
<New class="org.mortbay.jetty.webapp.WebAppContext">
<Set name="contextPath">/easymarket</Set>
<Set name="resourceBase">/home/luohua/tools/shellscript/apps/easymarket</Set>
<Call name="addServlet">
<Arg>org.mortbay.jetty.servlet.DefaultServlet</Arg>
<Arg>/</Arg>
</Call>
</New>
</Item>
<Item>
<New id="RequestLog" class="org.mortbay.jetty.handler.RequestLogHandler"/>
</Item>
</Array>
</Set>
</New>
</Set>
jetty2/jetty.xml (for jetty 7.4.1)
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Set name="host"><Property name="jetty.host" /></Set>
<Set name="port"><Property name="jetty.port" default="8084"/></Set>
<Set name="maxIdleTime">300000</Set>
<Set name="Acceptors">2</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesConnections">20000</Set>
<Set name="lowResourcesMaxIdleTime">5000</Set>
</New>
</Arg>
</Call>
<Set name="handler">
<New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
<Set name="handlers">
<Array type="org.eclipse.jetty.server.Handler">
<Item>
<New class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/easymarket</Set>
<Set name="resourceBase">/home/luohua/tools/shellscript/apps/easymarket</Set>
<Call name="addServlet">
<Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
<Arg>/</Arg>
</Call>
</New>
</Item>
</Array>
</Set>
</New>
</Set>
jetty3/jetty.xml (for jetty 8.0.0)
<Call name="addConnector">
<Arg>
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Set name="host"><Property name="jetty.host" /></Set>
<Set name="port"><Property name="jetty.port" default="8085"/></Set>
<Set name="maxIdleTime">300000</Set>
<Set name="Acceptors">2</Set>
<Set name="statsOn">false</Set>
<Set name="confidentialPort">8443</Set>
<Set name="lowResourcesConnections">20000</Set>
<Set name="lowResourcesMaxIdleTime">5000</Set>
</New>
</Arg>
</Call>
<Set name="handler">
<New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
<Set name="handlers">
<Array type="org.eclipse.jetty.server.Handler">
<Item>
<New class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/easymarket</Set>
<Set name="resourceBase">/home/luohua/tools/shellscript/apps/easymarket</Set>
<Call name="addServlet">
<Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
<Arg>/</Arg>
</Call>
</New>
</Item>
</Array>
</Set>
</New>
</Set>
The dist war package easymarket.war is unzip to a directory named easymarket.
3. Access the web page
http://localhost:8083/easymarket
http://localhost:8084/easymarket
http://localhost:8085/easymarket
references:
http://hi.baidu.com/luohuazju/blog/item/f74d2151c87a961e367abea4.html
http://docs.codehaus.org/display/JETTY/Running+Jetty-7.0.x
发表评论
-
Stop Update Here
2020-04-28 09:00 315I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 475NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 367Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 367Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 335Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 429Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 434Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 373Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 454VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 384Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 475NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 421Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 336Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 246GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 450GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 325GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 312Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 317Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 292Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 311Serverless with NodeJS and Tenc ...
相关推荐
6. **应用启动**:部署完成后,通过访问服务器的URL和应用的上下文路径(如http://server:port/deployment-demo)来启动应用。 7. **日志与监控**:部署后,监控应用的日志文件(通常位于服务器的logs目录)至关...
4. 将服务实现类和配置文件打包成WAR文件,然后部署到支持Java Web服务的服务器,如Tomcat、Jetty等。 5. 启动服务器,服务即按配置文件的指示对外提供服务。 总结来说,`server-config.wsdd`和`web.xml`在...
- `etc/jetty-contexts.xml`:上下文环境的配置。 #### 二、组件装配 Jetty采用了模块化的设计思路,使得各个组件可以灵活地组合在一起,从而构建出不同的服务架构。下面详细介绍Jetty中的主要组件及其装配过程。...
Manual deployment You can also deploy manually these two web applications in your favorite web applications server : - cas-shiro-demo-app on http://localhost:8080/app - cas-shiro-demo-server on ...
其他Web容器如Jetty、JBoss和GlassFish也支持Servlet和JSP。 **总结** “Java Servlets and Java Server Pages JSP”这本书涵盖了这些关键主题,帮助开发者深入了解如何利用Servlet和JSP技术构建高效、可维护的Web...
Updating deployment descriptor and deployment plan 308 Load balancing with Apache web server 310 Installing the Apache web server 310 Web app in Geronimo served through Apache web server 310 ...
* Multiple server HTTP connectors available, based on either Mortbay's Jetty or the Simple framework or Grizzly NIO framework. * AJP server connector available to let you plug behind an Apache ...
1. **Servlet容器**:如Tomcat,Jetty等,它们负责加载和管理Servlet。 2. **Servlet**:Java类,扩展了HttpServlet,用于处理HTTP请求。 3. **JSP**:HTML模板与Java代码的结合,用于生成动态内容。 4. **HTTP方法*...
7. **部署(Deployment)**:项目通常被打包成WAR文件,部署到支持Servlet容器(如Tomcat、Jetty)中运行。 为了深入了解这个jersey_server项目,你可以解压文件,查阅源代码,查看项目结构,理解各个组件的功能,...
- 右键点击项目,选择`Run As` -> `Run on Server`,选择你的Web服务器(如Tomcat、Jetty等)。 - 如果服务器不在列表中,需要先通过`Window` -> `Preferences` -> `Server` -> `Runtime Environments`添加。 ...
| └── zheng-upms-server -- 用户权限系统及SSO服务端[端口:1111] ├── zheng-cms -- 内容管理系统 | ├── zheng-cms-common -- cms系统公共模块 | ├── zheng-cms-dao -- 代码生成模块,无需开发 | ├──...
Server server = new Server(8080); ResteasyDeployment deployment = new ResteasyDeployment(); deployment.start(); // 设置扫描的包路径 deployment.setScanPackage("com.yourpackage"); // 将 RESTEasy ...
7. **Servlet容器**:JSP页面在服务器端被转换成Servlet,由Servlet容器(如Tomcat、Jetty等)负责编译、加载和执行。Servlet是Java Web应用程序的后端处理引擎,负责处理客户端请求和生成响应。 8. **生命周期**:...
在这里选择已下载并配置好路径的Tomcat v7.0 Server(或其他支持的Web容器,如Jetty),然后点击“Next”(下一步)。在接下来的界面中,会列出当前打开的Web项目,将要运行的项目添加到已配置的Server中。点击...
默认情况下,这些 Webshell 会被部署在 `\jboss-4.2.3.GA\server\default\tmp\deploy\` 目录,为了稳固权限,可以将 shell 移动到 `\jboss-4.2.3.GA\server\default\deploy\jmx-console.war`。 3. **JMX Console ...
51.4. Customizing the Management Server Address 51.5. Disabling HTTP Endpoints 52. Monitoring and Management over JMX 52.1. Customizing MBean Names 52.2. Disabling JMX Endpoints 52.3. Using Jolokia ...
6. **Tomcat或Jetty等应用服务器**:为了运行这个Java Web服务,你需要一个应用服务器,例如Apache Tomcat或Jetty,这些服务器可以解析和执行Servlets。 7. **客户端调用**:对于测试和使用这个时间服务器,你需要...
- JSP需要在Web服务器或Web容器(如Tomcat、Jetty)中运行,它们负责加载和执行JSP及Servlet。 9. **HTTP协议**: - 理解HTTP请求和响应的工作原理对于有效地开发JSP应用是必要的,因为它们是Web应用程序的基础。...
- **应用服务器**:如Tomcat、Jetty(Web容器)、GlassFish、WebLogic和JBoss,用于运行和管理J2EE应用。 **4. 部署和管理** - **应用部署描述符**(deployment descriptor):XML文件,定义了应用的配置和行为。 ...