• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

best practice for port stuff with Tomcat 4 on Linux?

 
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
snakes are really good at eating slugs. And you wouldn't think it, but so are tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic