Jetty 9 is a HTTP server just like Apache 2 or Nginx, and a Java servlet engine just like Apache Tomcat.
Jetty 9 has help for HTTP/2, WebSocket, OSGi, JMX, JNDI, JAAS and quite a few extra out of the box.
Jetty is open supply, versatile and extensible. Jetty performs asynchronously and due to its smaller sized footprint, it can be utilised in embedded devices as properly.
It is one particular of the finest enterprise grade net server for Java primarily based technologies.
In this short article, I am going to show you how to set up Jetty 9 on Ubuntu Server 18.04 LTS. Let’s get began.
It’s finest to upgrade all the packages of your Ubuntu Server 18.04 LTS ahead of installing new application packages. That way you can get all the bug fixes and safety updates.
Initially update the APT package repository cache with the following command:
$ sudo apt update
The APT package repository cache should really be updated. It says All the packages are up to date. If you have new package updates, you should really see it right here.
If you do have new package updates, then run the following command to update them:
$ sudo apt upgrade
As I do not have new package updates, none is upgraded.
As OpenJDK is accessible in the official package repository of Ubuntu Server 18.04 LTS, this is what I choose unless you have particular explanation to use Oracle JDK.
Run the following command to set up OpenJDK:
$ sudo apt set up openjdk-8-jdk
Now press y and then press to continue. OpenJDK should really be installed.
You can verify regardless of whether OpenJDK performs with the following command:
$ javac -version
Installing Jetty 9:
Jetty 9 is accessible in the official package repository of Ubuntu Server 18.04 LTS.
To set up Jetty 9, run the following command:
$ sudo apt set up jetty9
Now press y and then press to continue. Jetty 9 should really be installed.
Beginning Jetty 9 and Adding Jetty 9 to the Program Startup:
Now you can verify regardless of whether jetty9 service is operating with the following command:
$ sudo systemctl status jetty9
As you can see, jetty9 service is operating.
If jetty9 service is not operating, run the following command to get started it:
$ sudo systemctl get started jetty9
If you want jetty9 service to get started when your pc boots, run the following command to add it to the method startup:
$ sudo systemctl allow jetty9
Testing Jetty 9:
Jetty 9 runs on port 8080 by default. You can take a look at http://localhost:8080 from your Ubuntu Server 18.04 LTS exactly where you installed Jetty 9 to see regardless of whether it performs.
I utilised CURL to request http://localhost:8080 from the command line.
$ curl http://localhost:8080
As you can see, it performs.
If you want to connect to your Jetty 9 server from yet another pc on the network, initially you have to come across out the IP address of your Ubuntu Server 18.04 LTS exactly where you installed Jetty 9 with the following command:
$ ip a
As you can see, the IP address is 192.168.199.129 in my case.
Now take a look at http://192.168.199.129:8080 from any net browser on the network and it should really operate.
That’s how you can set up Jetty on your Ubuntu Server inside couple of minutes. I hope you like this tutorial, please share this short article with your colleagues.
If you want how to short article like this, please leave comment with the subject you want me to create.