On 3/19/2016 5:39 PM, Daniel Savard wrote:
André,
I was just trying to understand why this was a so hard requirement to
run on port 80. The provided answers didn't help to understand why
this was hardly needed. I was just questioning and sometimes, we, yes
I include myself, look at a problem with a narrow view how to solve it
and it may be helpful to be provided alternate solutions.
The most common reason to run TC on port 80 is for simplicity of
configuration, on production, but not huge-traffic web sites which can
tolerate a small amount of down time.
But, anyway, enough on this.
-
Daniel Savard
2016-03-19 17:02 GMT-04:00 André Warnier (tomcat) :
Daniel,
first of all, stop top-posting (this applies to both of you). This is not
the style of posting desired on this list.
See http://tomcat.apache.org/lists.html#tomcat-users, #6.
Secondly,
the original poster (lyallex) wants to run Tomcat under Linux, without a
front-end, as a webserver, listening on port 80, but running as a user which
is not root.
This is a legitimate way of running Tomcat, and it is not for you to tell
him to run it otherwise. Presumably, he knows what he is doing, under his
circumstances.
Tomcat by itself cannot do that, because it cannot by itself start as root,
bind to port 80, and then switch users.
The jsvc program (a "wrapper" for the JVM which runs Tomcat) allows this,
which is why the OP wants to use it.
But he has problems configuring this to run under systemd.
And this was his question : how to run Tomcat as non-root under a JVM under
jsvc under systemd, listening on port 80.
I have not yet tried it myself, so I cannot really help.
But I have a feeling that the information that you have provided earlier,
can be extrapolated to the configuration which lyallex wants.
So thank you for providing that information, and let's leave it at that.
There is no need and no point in transforming this conversation into a flame
now.
On 19.03.2016 21:33, Daniel Savard wrote:
I still don't see how the number of concurrent sessions is related to
the port number.
The default ports for Tomcat are 8080 and 8443.
For huge websites, usually you have a load balancer as a front-end
anyway. You then get the capability to distribute the workload on more
than one instance of Tomcat and/or servers, so, sticking on a single
port isn't desirable since many instances on a single server cannot
run on the same port. You get the capability to eliminate any
single-point of failure as well as getting the capability to implement
a non-stop environment making a Tomcat cluster.
-
Daniel Savard
2016-03-19 15:40 GMT-04:00 Lyallex :
On 19 March 2016 at 19:19, Daniel Savard wrote:
I see what you were trying to achieve, however I don't see much
interest in that.
Really, I've been running a successful commercial web site for the
last 4 years using Tomcat as a standalone web server
and servlet container using exactly this solution. 1000 concurrent
sessions pose no problem
I mentioned this in my first post, sorry if you missed it.
1) Obviously, if you were expecting systemd to solve that problem, you
were wrong and it is a sane behavir of systemd to not allow that
neither
No, you misunderstood. I was trying to start jsvc from a systemd service
file
Please read more carefully.I never suggested that systemd would solve
the problem
2) Your solution to your problem is lying on jsvc alone.
3) I believe is bad security practice to insist to bind on privileged
ports for process that don't need that level of privilege.
Btw, even if you switch to another user to run the code, you actually
are binding to port 80 as root.
Maybe you can explain us why you want to do such a thing and using any
other unprivileged port isn't a solution to your problem.
What is the default port for non.-encrypted http traffic to a web server?
Anyway, I see no reason to start a slanging match, I have better things
to do.
It's all working quite nicely now anyway, thank you for your input.
To learn about jsvc see
http://commons.apache.org/proper/commons-daemon/jsvc.html
You'll need an up to date ANSI C compiler (I use gcc)
Lyallex
Regards,
-
Daniel Savard
2016-03-19 12:10 GMT-04:00 Lyallex :
It's the simplest way to find out which port you have Tomcat listening
on
*NIX based systems don't allow non root uses bind to ports < 1024
jsvc
http://commons.apache.org/proper/commons-daemon/jsvc.html
solves this problem, nobody seems to have grasped that this is what I
was asking about.
I know of no way to start the container, on port 80 using either
startup.sh or catalina.sh using start, run or anything else.
If I'm wrong then I would love to see how it's done.
CentOS Linux release 7.2.1511 (Core)
On 19 March 2016 at 13:46, Daniel Savard
wrote:
Why? What is the point? The server.xml has nothing to do with
integration with systemd.
-
Daniel Savard
2016-03-19 1:40 GMT-04:00 Lyallex :
Would you mi