jetty 9使用

 

 

jetty 9 使用

下载jdk 7

  http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html#jdk-7u45-oth-JPR  下载适合操作系统的jdk

 

jetty 9依赖jdk7 ,最新发布的jdk7u51 jetty9.1.1不支持

 

下载jetty 9

打开网页      http://download.eclipse.org/jetty/

选择jetty9-stable

下载

 

 

运行jetty

解压到  D:/jetty-9.1.1

 

   cd D:/jetty-9.1.1

   java –jar start.jar

 

 

使用浏览器访问  http://localhost:8080

返回404错误

查看  d:/jetty-9.1.1/webapps/  目录为空

将d:/jetty-91.1/demo-base/webapps/  目录下的  ROOT 目录copy 到 D:/jetty-9.1.1/webapps 

 

 

可以看到ROOT被热部署

 

再次访问  http://localhost:8080

可以看到jetty的欢迎页面

 

 

查看jetty配置

 

D:\jetty-9.1.1>java -jar start.jar --list-config

 

依次展示 java 环境 jetty 环境,jvm参数,系统属性,classpath,服务器配置文件

 

 

 

 

 修改jetty端口

D:\jetty-9.1.1\start.d\http.ini 文件

--module=http

## HTTP Connector Configuration

jetty.port=8080

http.timeout=30000

 

修改   jetty.port=18080

 

 

 

启动后发现jetty端口变化

 

 

 

jetty 模块

 

java -jar start.jar --list-modules

 

 

 

查看   d:/jetty-9.1.1/start.ini文件

 

 

 

--module=server

## Server Threading Configuration

# minimum number of threads

threads.min=10

# maximum number of threads

threads.max=200

# thread idle timeout in milliseconds

threads.timeout=60000

# What host to listen on (leave commented to listen on all interfaces)

#jetty.host=myhost.com

# Dump the state of the Jetty server, components, and webapps after startup

jetty.dump.start=false

# Dump the state of the Jetty server, before stop

jetty.dump.stop=false

 

--module=deploy

--module=websocket

--module=jsp

--module=ext

--module=resources

 

 

增加模块

d:/jetty-9.1.1/start.ini 文件  增加 一行

--module=logging

 

 

 

日志文件配置可以查看   etc/jetty-logging.xml

posted on 2014-01-16 17:04  empireghost  阅读(2945)  评论(0编辑  收藏  举报

导航