K
K
KhanTengri2011-04-08 05:25:40
Java
KhanTengri, 2011-04-08 05:25:40

How to properly install Jetty (production ready)

Habralyudi, something I got a little stumped, enlighten me.

Before that, I had experience with Apache Tomcat, and there everything seemed logical and simple to me. Tomcat is just a servlet container ( wiki ), not a full-fledged server, and therefore it is usually not put in front (although some do), but pushed behind the Apache HTTP Server. Apache is put in the front, to which one or more Tomcats clung through mod_jk. Apache served static content and acted as a load balancer across multiple Tomcat instances, allowing for easy horizontal scaling. All this is written in the documentation for Tomcat ...

But now I switched to Jetty. There are circumstances that force...
In general, the application is written and locally everything works fine. But then the question arose of how to properly deploy Jetty so that it would be possible to scale horizontally by adding new jetty instances and distributing the load between them, sticky-sessions, and so on ...

And here is the most incomprehensible thing ...
In general, Jetty seems to represent is not only a servlet-container, but also a full-fledged server, wiki . In this regard, in the documentation for Jetty there is a very sarcastic statement:

Apache httpd is a HTTP server written in C, that is often used to front other web services. Jetty is a full functional and optimized HTTP server and has no need of an apache httpd instance between it and the internet. However, deployers often want to place an instance of apache between Jetty and the internet for some of the following "reasons"

( source )

Note that reasons are in quotation marks…

In general, in their view, pushing jetty behind apache is kind of like a tribute to the prevailing fashion, nothing more. But then what is right? How to deploy Jetty so that there is horizontal scalability? So that you can add new instances and distribute the load between them?

ZYZH Even transplanting jetty to port 80, for use in the front, in their view looks like a “crutch”, and not general use ... ( link ), how to be?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Puma Thailand, 2011-04-08
@opium

Deploy jetty behind nginx?

D
dborovikov, 2011-04-14
@dborovikov

Yes, the standard solution is to put nginx in front of Jetty. And in general, in any case, it is better not to give statics from Java, regardless of what they wrote there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question