Jetty download page<\/a>.<\/p>\r\n\r\n\r\n\r\nDownload Jetty 9.3.12 package:<\/p>\r\n\r\n\r\n\r\n
$ wget -c http:\/\/repo1.maven.org\/maven2\/org\/eclipse\/jetty\/jetty-distribution\/9.3.12.v20160915\/jetty-distribution-9.3.12.v20160915.zip\r\n<\/pre>\r\n\r\n\r\n\r\nNote:<\/strong><\/strong> Release notes can be found in theVERSION.txt<\/code><\/strong>file included with the distribution<\/p>\r\n\r\n\r\n\r\nExtract the Jetty package:<\/p>\r\n\r\n\r\n\r\n
$ unzip jetty-distribution-9.3.12.v20160915.zip<\/pre>\r\n\r\n\r\n\r\nRename the directory to jetty and move it to \/opt:<\/p>\r\n\r\n\r\n\r\n
$ mv jetty-distribution-9.3.12.v20160915 jetty<\/pre>\r\n\r\n\r\n\r\n$ mv jetty \/opt<\/pre>\r\n\r\n\r\n\r\nWe will create a user and group named jetty. First create the group first:<\/p>\r\n\r\n\r\n\r\n
$ sudo addgroup --quiet --system jetty<\/pre>\r\n\r\n\r\n\r\nCreate a user called jetty to run the Jetty web server on system start-up.<\/p>\r\n\r\n\r\n\r\n
$ adduser --quiet --system --ingroup jetty --no-create-home --disabled-password jetty<\/pre>\r\n\r\n\r\n\r\nModify the \/etc\/passwd entry to change home and group for the jetty user.<\/p>\r\n\r\n\r\n\r\n
$ usermod -c \"Jetty\" -d \/opt\/jetty -g jetty jetty<\/pre>\r\n\r\n\r\n\r\nChange ownership of \/opt\/jetty directory to user jetty and group jetty.<\/p>\r\n\r\n\r\n\r\n
$ chown -R jetty:jetty \/opt\/jetty<\/pre>\r\n\r\n\r\n\r\nSymlink the jetty.sh script to the \/etc\/init.d\/ directory to create a startup script file:<\/p>\r\n\r\n\r\n\r\n
$ ln -s \/opt\/jetty\/bin\/jetty.sh \/etc\/init.d\/jetty<\/pre>\r\n\r\n\r\n\r\nNow, you need to create a configuration file for Jetty. Open a file:<\/p>\r\n\r\n\r\n\r\n
$ nano \/etc\/default\/jetty<\/pre>\r\n\r\n\r\n\r\nNow paste the following:<\/p>\r\n\r\n\r\n\r\n
JETTY_HOME=\/opt\/jetty\r\nJETTY_USER=jetty\r\nJETTY_PORT=8080\r\nJETTY_HOST=your_server_IP\r\nJETTY_LOGS=\/opt\/jetty\/logs\/<\/pre>\r\n\r\n\r\n\r\nDon\u2019t forget to add your server IP address in the JETTY_HOST line.<\/p>\r\n\r\n\r\n\r\n
Navigate to the Jetty installation directory:<\/p>\r\n\r\n\r\n\r\n
# cd \/opt\/jetty<\/pre>\r\n\r\n\r\n\r\nNext, delete the webapps directory since there is nothing in it and copy the webapps directory from demo-base. It is a test and is demo data from Jetty.<\/p>\r\n\r\n\r\n\r\n
$ rm -rf webapps\/\r\n\r\n$ cp -r demo-base\/webapps\/ \/opt\/jetty\/<\/pre>\r\n\r\n\r\n\r\nFinally, start the Jetty server:<\/p>\r\n\r\n\r\n\r\n
$ service jetty start<\/pre>\r\n\r\n\r\n\r\n