{"id":259,"date":"2015-09-07T16:05:52","date_gmt":"2015-09-07T16:05:52","guid":{"rendered":"http:\/\/onlinelab.info\/?p=259"},"modified":"2015-09-07T16:05:52","modified_gmt":"2015-09-07T16:05:52","slug":"install-jetty-web-server-on-centos-7-rhel-7","status":"publish","type":"post","link":"https:\/\/www.asianux.org.vn\/index.php\/2015\/09\/07\/install-jetty-web-server-on-centos-7-rhel-7\/","title":{"rendered":"Install Jetty web server on CentOS 7 \/ RHEL 7"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8067\" src=\"http:\/\/www.itzgeek.com\/wp-content\/uploads\/2014\/11\/Jetty_logo.png\" alt=\"Jetty_logo\" width=\"240\" height=\"69\" title=\"\"><\/p>\n<p>Jetty web server is a java based http server and servlet container, web servers are normally used for serving static content to client, nowadays jetty is used\u00a0 for server to server communication, within large frameworks. Jetty is developed under open source license,part of Eclipse foundation, it is used in multiple active products such as Apache ActiveMQ,Alfresco, Apache Geronimo,Apache Maven, Apache Spark and also in open source project such as Hadoop, Eucalyptus and Red5.<br \/>\nJetty supports the latest Java Servlet API as well as protocols SPDY and WebSocket, this guide will help you to set up jetty on CentOS 7 \/ RHEL 7.<\/p>\n<p>Jetty requires java jdk, go ahead and install it.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># \u00a0yum -y install java-1.7.0-openjdk wget<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Download latest version of jetty.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># wget http:\/\/download.eclipse.org\/jetty\/stable-9\/dist\/jetty-distribution-9.2.5.v20141112.tar.gz<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Extract the downloaded archive file to \/opt<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># tar zxvf jetty-distribution-9.2.5.v20141112.tar.gz -C \/opt\/<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Rename it to jetty<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># mv \/opt\/jetty-distribution-9.2.5.v20141112\/ \/opt\/jetty<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Create a user called jetty to run jetty web server on system start-up.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># useradd -m jetty<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Change ownership of extracted jetty directory.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># chown -R jetty:jetty \/opt\/jetty\/<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Copy or Symlink jetty.sh to \/etc\/init.d directory to create a start up script file for jetty web server.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># ln -s \/opt\/jetty\/bin\/jetty.sh \/etc\/init.d\/jetty<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Add script.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\"># chkconfig --add jetty<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Auto start at 3,4 and 5 levels.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\">chkconfig --level 345 jetty on<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Add the following information in \/etc\/default\/jetty, replace port and listening address with your value.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\">vi \/etc\/default\/jetty\n\u00a0\nJETTY_HOME=\/opt\/jetty\nJETTY_USER=jetty\nJETTY_PORT=8080\nJETTY_HOST=192.168.12.10\nJETTY_LOGS=\/opt\/jetty\/logs\/<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Now start the jetty service.<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"code\">\n<pre class=\"dos\">service jetty start<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Jetty can be accessed using web browser <strong>http:\/\/your-ip-address:8080.\u00a0<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jetty web server is a java based http server and servlet container, web servers are normally used for serving static content to client, nowadays jetty is used\u00a0 for server to server communication, within large frameworks.&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-259","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts\/259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/comments?post=259"}],"version-history":[{"count":0,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts\/259\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/media?parent=259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/categories?post=259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/tags?post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}