On the internet to see jetty feel very NB on the deployment of play, a long experience.
Download Jetty9 Address
Http://www.eclipse.org/jetty/previousversions.html
You can pick your own version here, I choose the 9 version here
Here I put the jetty in the./usr/local/jetty directory download a good upload and then tar unzip
TAR-XVF jetty-distribution-9.4.6.v20170531.tar.gz
JDK, I've got it deployed here.
Jdk1.7:http://download.oracle.com/otn/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz
Vim/etc/profile #在文件末尾添加如下几行
Export java_home=/java/jdk1.7.0_79 #JDK环境配置
Export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $PATH: $JAVA _home/bin
Export Maven_home=/usr/local/maven#maven Environment Configuration
Export path= $PATH: $MAVEN _home/bin
Export Jetty_home=/usr/local/jetty#jetty Environment Configuration
Export path= $PATH: $JETTY _home/bin
Source/etc/profile Making variables effective
Jetty directory Structure
Download jetty should be a compressed package, just unzip it to a directory. The extracted directory structure and what it contains
Directory file name Description
License-eplv10-aslv20.html#jetty license File
readme.txt# Getting Started information
Version.txt#release Information
bin/#运行Jetty的辅助shell脚本
demo-base/#演示demo
etc/#Jetty XML configuration file directory, mainly contains the configuration files required by each module
lib/#运行Jetty需要的所有JAR包
logs/#log目录
Modules/#模块定义目录, such as server, HTTP, HTTPS, etc. module definition file
Notice.html#license Information
Resources/#额外的资源信息, such as log4j configuration
Start.d/#包含一系列全局ini文件, where each INI file stores various command-line parameters
start.ini# the global command-line parameter file, the file contains content that is added to the command-line arguments, that is, Java-jar Start.jar [arg ...] parameter of the command
start.jar# running the jetty jar file
webapps/#webapps文件夹 (the Web projects and pages that run here are put here I recommend creating a root directory)
Test and start jetty
[[Email protected] ~] #cd/usr/local/jetty/bin
[Email protected] bin]#/jetty.sh restart
Stopping Jetty:2017-12-22 16:28:32.773:info:oejs. abstractconnector:thread-0: Stopped [Email protected]{http/1.1,[http/1.1]}{0.0.0.0:8080}
2017-12-22 16:28:32.773:info:oejs.session:thread-0: Stopped scavenging
2017-12-22 16:28:32.777:info:oejsh. contexthandler:thread-0: Stopped [Email Protected]{/,null,unavailable}{/root}
Ok
Starting jetty:2017-12-22 16:28:34.218:info::main:logging initialized @460ms to Org.eclipse.jetty.util.log.StdErrLog
2017-12-22 16:28:34.378:warn:oejs. HomeBaseWarning:main:This instance of Jetty is not running from a separate {jetty.base} directory, this is not recommende D. See documentation at Http://www.eclipse.org/jetty/documentation/current/startup.html
2017-12-22 16:28:34.412:info:oejs. server:main:jetty-9.4.6.v20170531
2017-12-22 16:28:34.433:INFO:OEJDP. ScanningAppProvider:main:Deployment Monitor [file:///usr/local/jetty/jetty/webapps/] at interval 1
2017-12-22 16:28:34.623:info:oeja. AnnotationConfiguration:main:Scanning Elapsed Time=69ms
2017-12-22 16:28:34.822:info:oejs.session:main:defaultsessionidmanager workername=node0
2017-12-22 16:28:34.822:info:oejs.session:main:no Sessionscavenger set, using defaults
2017-12-22 16:28:34.823:info:oejs.session:main:scavenging every 600000ms
2017-12-22 16:28:34.853:info:oejsh. ContextHandler:main:Started [Email Protected]{/,file:///usr/local/jetty/jetty/webapps/root/,available}{/root}
2017-12-22 16:28:34.867:info:oejs. AbstractConnector:main:Started [Email protected]{http/1.1,[http/1.1]}{0.0.0.0:8080}
2017-12-22 16:28:34.867:info:oejs. Server:main:Started @1109ms
OK Fri Dec 16:28:37 CST 2017
Test access ip:8080 But the return value is 404 because now there's no page in WebApps, something needs to go inside.
The following path is different for everyone.
Cp-r/usr/local/jetty/jetty/demo-base/webapps/root/usr/local/jetty/jetty/webapps/
This will allow you to visit ip:8080 again to access the
Start.ini file found in jetty directory default 8080 can be changed to 80
After the change, remember to restart the service bin# in the bin directory./jetty.sh restart
Linux under Jetty9 installation deployment