tomcat6-instance-create does not behave properly on setting a value less than 1024 for the control port

Bug #730259 reported by Abhinav Upadhyay
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tomcat6 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: tomcat6

On specifying any value less than 1024 for the -c option of tomcat6-instance-create, the server instance does not work as expected. It gets configured and gets started, but pages won't load in the browser.
For example, on running
$tomcat6-instance-create -c 1001 -p 8001 ~/my_tomcat

It configures the instance properly, the server also starts successfully. But, I cannot access http://localhost:8001/
The reason being that ports less than 1024 can be used by only those processes which are run as root.

But in my opinion, in such a case (where -c has value less than 1024), the server should refuse to start or at least give a warning that it should be run as root. Otherwise, user may be clueless, as why the pages are not loading.

I have following configuration:
Ubuntu 10.10
tomcat6-user 6.0.28-2ubuntu1.1
tomcat6 6.0.28-2ubuntu1.1
Architecture: x86

Revision history for this message
Abhinav Upadhyay (er-abhinav-upadhyay) wrote :
tags: added: tomcat6
Revision history for this message
Abhinav Upadhyay (er-abhinav-upadhyay) wrote :

Sorry, running tomcat6-instance-create as root, solved the issue. But I believe, it should have displayed an error that I need to run the server as root in order to bind to a port less than 1024, rather than stupidly say "server started".

Changed in tomcat6 (Ubuntu):
status: New → Invalid
description: updated
Changed in tomcat6 (Ubuntu):
status: Invalid → New
Revision history for this message
Abhinav Upadhyay (er-abhinav-upadhyay) wrote :

Changed the bug report. It should at least give a warning before starting the server, that without root privileges it won't be able to serve pages. (Running server as root is not such a good idea, but in case someone wants to ).

description: updated
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi there,

Thank you for reporting bugs and trying to make Ubuntu better.

Given that it is a known fact that non-root services cannot run in port higher than 1024, and not being a real issue and rather a usability bug, I believe that this bug report doesn't really affect the functioning of tomcat. Furthermore, as this is a known fact, maybe the logs have displayed the error message you were seeking for.

However, It can still be possible to run tomcat in "higher ports". This information can be found at [1].

For this reason, I'm marking this bug as incomplete as it doesn't really affect the functionality of tomcat.

[1]: http://wiki.apache.org/tomcat/HowTo#How_to_run_Tomcat_without_root_privileges.3F

Changed in tomcat6 (Ubuntu):
status: New → Incomplete
Revision history for this message
James Page (james-page) wrote :

Hi Abhinav

You should have received a warning from the tomcat6-create-instance command when using ports below 1024 (see output below):

ubuntu@ip-172-19-1-2:~$ tomcat6-instance-create -p 1000 -c 8005 tomcat
You are about to create a Tomcat instance in directory 'tomcat'
Warning: ports below 1024 are reserved to the super-user.
Type <ENTER> to continue, <CTRL-C> to abort.

It is possible for non-root users to bind to ports below 1024 using the authbind package (see man authbind for more details) - the main tomcat6 package has authbind as a dependency and can be configured to run on ports below 1024 if required.

I expect a similar approach could be applied to user instances of tomcat6 if required (but not recommended!)

Revision history for this message
Thierry Carrez (ttx) wrote :

Closing as Invalid since the current warnings sound good enough to me, please reopen (set back to New) if you disagree.

Changed in tomcat6 (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.