Results 1 to 2 of 2
- 12-17-2010, 03:21 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 1
- Rep Power
- 0
Can't listen on ports < 1024 in linux
Hi,
This is not quite a noobie question, so I would really appreciate your opinion on this topic.
Is there any way to implement something like Apache web server does:
- one process running as root, listening on port 80 (proc_root)
- other processes running as non-root (proc_user)
in that way proc_root can accept() incoming tcp/ip connections and pass some information (handle, object, anything) to proc_user, which will continue handling that connection?
The problem is that I don't want my user process to run as root, just to be able to listen on port < 1024 (in linux). Also, I'm more interested in methods of passing sockets between java processes, if that is possible at all in Java.
Is there any trick to do this in Java?
Thanks in advance.
- 12-17-2010, 07:11 PM #2
yes, this is possible, this is how apache and tomcat usually connect with mod_jk. where i have apache started a root user to bind to port 80. then my tomcat instance runs as a non-root user on the standard ajp13 port, so requests thru apache are sent thru the mod_jk connector to tomcat. it should likely be possible to do this pattern with two java processes too. the trick is the operating system level where we 'run this process as a given user'. I don't know of a way to have a process ran as another user inside java, you would need a shell script wrapper to start it up, or at least have the java program invoke a "su - $user" kind of launch child process thing.
Similar Threads
-
serversocket listen connection
By gisler in forum NetworkingReplies: 1Last Post: 12-17-2009, 02:57 AM -
Listen for changes in a JTextField
By matzahboy in forum AWT / SwingReplies: 5Last Post: 10-13-2009, 04:15 PM -
Cannot Listen TAB key
By sh4dyPT in forum AWT / SwingReplies: 5Last Post: 07-16-2009, 01:45 PM -
[SOLVED] Windows Linux conflict - TrayIcon image not display in Linux
By Eranga in forum Advanced JavaReplies: 6Last Post: 04-08-2009, 04:05 AM -
how to listen for buttons between jpanels?
By pjr5043 in forum New To JavaReplies: 17Last Post: 09-29-2008, 03:37 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks