ubuntu18配置jetty9

安装

sudo apt install jetty9

安装路径

/usr/share/jetty9

11

配置日志

进入/usr/share/jetty9目录执行以下命令

sudo java -jar start.jar --add-to-start=console-capture
sudo java -jar start.jar --add-to-start=logging-jetty

编辑start.d下的console-capture.ini文件,修改为以下内容

# --------------------------------------- 
# Module: console-capture
# Redirects JVMs console stderr and stdout to a log file,
# including output from Jetty's default StdErrLog logging.
# --------------------------------------- 
--module=console-capture

## Logging directory (relative to $jetty.base)
jetty.console-capture.dir=logs

## Whether to append to existing file
jetty.console-capture.append=true

## How many days to retain old log files
jetty.console-capture.retainDays=30

## Timezone of the log timestamps
jetty.console-capture.timezone=GMT

编辑usr/share/jetty9生成resources目录下的jetty-logging.properties文件

## Force jetty logging implementation
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog

## Set logging levels from: ALL, DEBUG, INFO, WARN, OFF
org.eclipse.jetty.LEVEL=WARN
com.example.LEVEL=WARN

## Hide stacks traces in logs?
com.example.STACKS=false

## Show the source file of a log location?
com.example.SOURCE=true

重启jetty9

systemctl start jetty9

部署应用

将编译好的war包直接放在webapps目录下即可,一个war包就是一个应用,应用和应用之间是隔离的,比如hello.war表示hello这个应用

访问方式:http://host/xxx

xxx为war包名

posted @ 2020-03-20 22:23  被罚站的树  阅读(592)  评论(0编辑  收藏  举报