File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes best practice for port stuff with Tomcat 4 on Linux? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "best practice for port stuff with Tomcat 4 on Linux?" Watch "best practice for port stuff with Tomcat 4 on Linux?" New topic
Author

best practice for port stuff with Tomcat 4 on Linux?

Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
I want to move to Tomcat 5 right now, but can't yet, and for the time being we need to move from Tomcat 4.1.23 on Windows to 4.1.31 on Red Hat, so I'm now facing a question of what to do about the port Tomcat runs on. I've read stuff online that suggests it's best to leave it at 8080 since 80 is a privileged port on *nix.

But from that point, I'm not sure what the best practice would be, though I've read different options, like user space port forwarding, kernal space port forwarding, or using using a port forwarder (portfwd or redir4a), none of which I'm familiar with. What do you Tomcat users suggest would be a good approach for someone who's only a beginner/intermediate with Linux and using standalone Tomcat? In case it matters, note that we are also moving from our single Windows web server to 2 Linux web servers (each running standalone Tomcat), and we're trying to configure a load balancer hardware appliance in front of the two web servers.

Thanks for your suggestions,
Stephen
Scott Dunbar
Ranch Hand

Joined: Sep 23, 2004
Posts: 245
What is your concern about running as root, security? Yes, by default port numbers < 1024 are "privileged" ports. But Tomcat can run on port 80 just fine.

One alternative is to have Apache httpd in front of Tomcat. In this way Tomcat can run on whatever port you want and only Apache needs to run as root. Since httpd is used things like CGI, SSI, PHP, and others can be used in addition to the facilities of Tomcat.


<a href="http://forums.hotjoe.com/forums/list.page" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
Apache would be great, but I don't think we have time for learning it right now. Running Tomcat as root isn't a popular idea:
http://www-106.ibm.com/developerworks/java/library/l-secjav.html

Here are other resources I'm reading:

http://www.klawitter.de/tomcat80.html

http://linux.org.mt/article/tomcat-ports

They mention user and kernal space port forwarding...
lawrence mier
Greenhorn

Joined: Dec 09, 2004
Posts: 6
try using jsvc to run tomcat on ports <1024.

jsvc.tar is in your bin folder.

Instructions here:

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/setup.html

it starts tomcat as root to get access to <1024 then switches to another user so ur not running as root.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: best practice for port stuff with Tomcat 4 on Linux?
 
Similar Threads
Is it feasible to do Serial Port Reading with Struts?
send email attachment
Interesting tiles/struts making a menu question
ANT and Eclipse "Java Build Path"
Environment setup/configuration