Run TomCat on port 80?

D

Dundonald

How can I get TomCat to run on port 80? I'm not interested in having
apache serve static content, I just want Tomcat to serve everything.
So I'm not too interested in mod_jk to hook Apache up with tomcat.

Thanks
 
O

Owen Jacobson

How can I get TomCat to run on port 80? I'm not interested in having
apache serve static content, I just want Tomcat to serve everything.
So I'm not too interested in mod_jk to hook Apache up with tomcat.

Thanks

Since Java provides no mechanism for altering the OS user the JVM is
running as, running Tomcat on port 80 involves allowing Tomcat to run
as root. Apache gets around this by binding to 80 as root and then
dropping to a non-privileged account based on the contents of
httpd.conf.

Running Tomcat as root should give you pause, at the very least.
 
D

Dundonald

Since Java provides no mechanism for altering the OS user the JVM is
running as, running Tomcat on port 80 involves allowing Tomcat to run
as root. Apache gets around this by binding to 80 as root and then
dropping to a non-privileged account based on the contents of
httpd.conf.

Running Tomcat as root should give you pause, at the very least.

Yes it does if it means having to run as root. But that sucks! :(
 
E

Eric Sosman

Dundonald wrote On 10/22/07 17:25,:
Yes it does if it means having to run as root. But that sucks! :(

If you're running Solaris 10, you can use a non-root
account by granting it the PRIV_NET_PRIVADDR privilege.
This allows processes running under that account to bind
low-numbered ports without allowing them to do other
rootly things. "man -s5 privileges" (if applicable).
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Dundonald said:
How can I get TomCat to run on port 80? I'm not interested in having
apache serve static content, I just want Tomcat to serve everything.
So I'm not too interested in mod_jk to hook Apache up with tomcat.

Edit server.xml and change port 8080 to 80 ...

Arne
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Owen said:
Since Java provides no mechanism for altering the OS user the JVM is
running as, running Tomcat on port 80 involves allowing Tomcat to run
as root. Apache gets around this by binding to 80 as root and then
dropping to a non-privileged account based on the contents of
httpd.conf.

Not all OS's have "root" and not all OS's have the <port 1024 rule.

Arne
 
E

Ed Webb

Dundonald said:
How can I get TomCat to run on port 80? I'm not interested in having
apache serve static content, I just want Tomcat to serve everything.
So I'm not too interested in mod_jk to hook Apache up with tomcat.

Thanks

If you're using iptables you can create a rule to redirect port 80
traffic to port 8080.

Ed!
 
Z

Zsolt Koppany

Dundonald,

it is always the best to install apache und using tomcat via connector.
Alternatively you can use iptable.

Zsolt
 
D

Daniel Pitts

Zsolt said:
Dundonald,

it is always the best to install apache und using tomcat via connector.
Alternatively you can use iptable.

Zsolt

I would assume that Tomcat has a configuration file where you can set
the port. I only use Resin, so I don't know for sure. you might do a
grep on all the config files for 8080 (I assume thats the default Tomcat
port).

Good Luck,
Daniel.
 
L

Lew

...
Daniel said:
I would assume that Tomcat has a configuration file where you can set
the port. I only use Resin, so I don't know for sure. you might do a
grep on all the config files for 8080 (I assume thats the default Tomcat
port).
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Zsolt said:
it is always the best to install apache und using tomcat via connector.
Alternatively you can use iptable.

There are some cases where that is a good idea. But I would say that
there are also cases where it is just a completely unnecessary
complexity.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,110
Latest member
OdetteGabb
Top