jetty 9 使用
jetty 9依赖jdk7 ,最新发布的jdk7u51 jetty9.1.1不支持
选择jetty9-stable
下载
<a href="http://eclipse.org/downloads/download.php?file=/jetty/stable-9/dist/jetty-distribution-9.1.1.v20140108.zip&r=1">jetty-distribution-9.1.1.v20140108.zip</a>
解压到 D:/jetty-9.1.1
cd D:/jetty-9.1.1
java –jar start.jar
返回404错误
查看 d:/jetty-9.1.1/webapps/ 目录为空
将d:/jetty-91.1/demo-base/webapps/ 目录下的 ROOT 目录copy 到 D:/jetty-9.1.1/webapps
可以看到ROOT被热部署
可以看到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端口变化
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