First check the installed version: Debian 7.2
The rest came from the open-source sharing of @ huazai, a fellow who rarely made any improvements. I am sorry for your respect for rewriting.
First create an automatic installation script install. sh:
#! /Bin/bash
JETTY_VERSION = 7.6.12.v20130726
Wget requests
Tar xfz jetty-distribution-$JETTY_VERSION.tar.gz-C/opt
Ln-fs/opt/jetty-distribution-$ JETTY_VERSION/opt/jetty
Cp/opt/jetty/bin/jetty. sh/etc/init. d
The update-rc.d jetty. sh defaults.
I have never learned bash scripts, but I have to figure out the code.
#! In/bin/bash linux, the script file starts with this to point out the shell for interpreting the script. bash is used here.
Defines a variable JETTY_VERSION that specifies the jetty version to be downloaded and used.
Wget uses http or ftp protocol to download files from the Internet to the current directory
Tar decompress the file to the/opt directory
After the ln link is decompressed, go to/opt/jetty. If the target directory exists, delete it first.
Cp copies the jetty. sh file to the/etc/init. d directory.
The update-rc.d sets it to boot by default
Then add the execution permission to the document owner:
Sudo chmod u + x install. sh
Run:
Sudo./install. sh
OK. After a while, you 'd better restart your computer.
We access the IP address + port 8080 of the installation HOST: http: // 192.168.1.116: 8080/
The problems found are:
1. This method fails when a newer jetty version is used. Therefore, an old version is installed.
2. Debian6 and later versions use insserv to replace the update-rc.d and have more strict format requirements for the command script.
Jetty details: click here
Jetty's: click here
Recommended reading:
Use Jetty as an Embedded Server
Jetty source code analysis
Debian 7.0 Wheezy test experience
Debian 7.0 Wheezy released!
Install Debian 7.0 Wheezy on a USB flash drive