RE: One question about change port to 80

2010-06-30 Thread Caldarale, Charles R
 From: Yue Yuanyuan [mailto:yue.yuany...@gmail.com]
 Subject: One question about change port to 80
 
 The server.xml file was modified to
 Connector port=80 protocol=HTTP/1.1
 nnector port=8080 protocol=HTTP/1.1
connectionTimeout=2
redirectPort=8443 /

Well, that 'nnector port=8080' you've got in there doesn't look particularly 
attractive...

 But I am using root directly to do the operation.

Which you really, really shouldn't be doing.
http://wiki.apache.org/tomcat/HowTo#How_to_run_Tomcat_without_root_privileges.3F

 Then I tried to change the port into  or others. 
 They all do not work.

Fix your editing of the Connector element, then check the firewall and 
iptables settings.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: One question about change port to 80

2010-06-30 Thread Yue Yuanyuan
Thank you. That is just the copy/paste mistake.
Even the file is right:
 Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 /
It still does not work.  I tried iptables -F. It still does not work.
And I tried to install apache httpd on the server. It could work on port 80
and there is no problem for apache.
By the way, when I changed the port to . I could see that the tomcat is
listening on  but I cannot connect to it.  Only 8080 works.
Thank you for the helps.
best,
gavin


On Wed, Jun 30, 2010 at 3:31 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Yue Yuanyuan [mailto:yue.yuany...@gmail.com]
  Subject: One question about change port to 80
 
  The server.xml file was modified to
  Connector port=80 protocol=HTTP/1.1
  nnector port=8080 protocol=HTTP/1.1
 connectionTimeout=2
 redirectPort=8443 /

 Well, that 'nnector port=8080' you've got in there doesn't look
 particularly attractive...

  But I am using root directly to do the operation.

 Which you really, really shouldn't be doing.

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

  Then I tried to change the port into  or others.
  They all do not work.

 Fix your editing of the Connector element, then check the firewall and
 iptables settings.

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you received
 this in error, please contact the sender and delete the e-mail and its
 attachments from all computers.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




RE: One question about change port to 80

2010-06-30 Thread Caldarale, Charles R
 From: Yue Yuanyuan [mailto:yue.yuany...@gmail.com]
 Subject: Re: One question about change port to 80
 
 And I tried to install apache httpd on the server. It 
 could work on port 80 and there is no problem for apache.

So have you tried using the non-root mechanisms for Tomcat as described in the 
link I gave you?

 By the way, when I changed the port to . I could see 
 that the tomcat is listening on  but I cannot connect
 to it.

Since you're running on an Amazon VM, they might not have opened up that port 
on the underlying real server.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: One question about change port to 80

2010-06-30 Thread Yue Yuanyuan
I think i figure out what is going on. I need to run tomcat using root. But
even I su to root and start tomcat using /etc/init.d/tomcat6 start. It
stills runs under tomcat users.
So how could I run it using root?
Thank you.
Best,
Gavin

On Wed, Jun 30, 2010 at 3:46 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Yue Yuanyuan [mailto:yue.yuany...@gmail.com]
  Subject: Re: One question about change port to 80
 
  And I tried to install apache httpd on the server. It
  could work on port 80 and there is no problem for apache.

 So have you tried using the non-root mechanisms for Tomcat as described in
 the link I gave you?

  By the way, when I changed the port to . I could see
  that the tomcat is listening on  but I cannot connect
  to it.

 Since you're running on an Amazon VM, they might not have opened up that
 port on the underlying real server.

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you received
 this in error, please contact the sender and delete the e-mail and its
 attachments from all computers.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: One question about change port to 80

2010-06-30 Thread Paweł Zuzelski
On Wed, 30 Jun 2010, Yue Yuanyuan wrote:

 I think i figure out what is going on. I need to run tomcat using root. But
 even I su to root and start tomcat using /etc/init.d/tomcat6 start. It
 stills runs under tomcat users.
 So how could I run it using root?

It is a bad idea. Just use iptables to redirect 80 to .

iptables -A PREROUTING -t nat -p tcp -dport 80 -j REDIRECT --to-ports 

(not tested, see man iptables for details).

It is the simplest and the most reliable way to run tomcat on port 80.

-- 
Regards,
Paweł

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: One question about change port to 80

2010-06-30 Thread Yue Yuanyuan
is it a good idea to use vhost like this :
http://www.javathinking.com/2007/10/tomcat-with-apache2-virtual-hosts/
Thank you.
Best,
Gavin

2010/6/30 Paweł Zuzelski z...@xatka.net

 On Wed, 30 Jun 2010, Yue Yuanyuan wrote:

  I think i figure out what is going on. I need to run tomcat using root.
 But
  even I su to root and start tomcat using /etc/init.d/tomcat6 start. It
  stills runs under tomcat users.
  So how could I run it using root?

 It is a bad idea. Just use iptables to redirect 80 to .

 iptables -A PREROUTING -t nat -p tcp -dport 80 -j REDIRECT --to-ports 

 (not tested, see man iptables for details).

 It is the simplest and the most reliable way to run tomcat on port 80.

 --
 Regards,
 Paweł

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: One question about change port to 80

2010-06-30 Thread Pid
On 30/06/2010 21:51, Yue Yuanyuan wrote:
 is it a good idea to use vhost like this :
 http://www.javathinking.com/2007/10/tomcat-with-apache2-virtual-hosts/
 Thank you.
 Best,
 Gavin

That's an article from 2007.  Things have moved on since then.

Unless you really need HTTPD for some reason - you'll know if you do -
Tomcat is perfectly adequate and serves static files just as fast as HTTPD.

Instead of trying lots of different ways of installing Tomcat when you
run into a problem, let's try and resolve the particular issue you're
having.


If you've run Tomcat as root, and then run it as user 'tomcat' using
jsvc, you must remember to check all of the ownership permissions have
been changed on the tomcat installation to the 'tomcat' user.

Was the server actually running?

Did you check to see if Tomcat was actually listening on the port?


p


 2010/6/30 Paweł Zuzelski z...@xatka.net
 
 On Wed, 30 Jun 2010, Yue Yuanyuan wrote:

 I think i figure out what is going on. I need to run tomcat using root.
 But
 even I su to root and start tomcat using /etc/init.d/tomcat6 start. It
 stills runs under tomcat users.
 So how could I run it using root?

 It is a bad idea. Just use iptables to redirect 80 to .

 iptables -A PREROUTING -t nat -p tcp -dport 80 -j REDIRECT --to-ports 

 (not tested, see man iptables for details).

 It is the simplest and the most reliable way to run tomcat on port 80.

 --
 Regards,
 Paweł

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 




signature.asc
Description: OpenPGP digital signature


Re: One question about change port to 80

2010-06-30 Thread Yue Yuanyuan
It is running. I did iptables now it works fine. I also did test on my
ubuntu. There is no problem. I just do not get it why I run the tomcat using
ROOT, but still I do not have the privilege to bind 80 port.


2010/6/30 Pid p...@pidster.com

 On 30/06/2010 21:51, Yue Yuanyuan wrote:
  is it a good idea to use vhost like this :
  http://www.javathinking.com/2007/10/tomcat-with-apache2-virtual-hosts/
  Thank you.
  Best,
  Gavin

 That's an article from 2007.  Things have moved on since then.

 Unless you really need HTTPD for some reason - you'll know if you do -
 Tomcat is perfectly adequate and serves static files just as fast as HTTPD.

 Instead of trying lots of different ways of installing Tomcat when you
 run into a problem, let's try and resolve the particular issue you're
 having.


 If you've run Tomcat as root, and then run it as user 'tomcat' using
 jsvc, you must remember to check all of the ownership permissions have
 been changed on the tomcat installation to the 'tomcat' user.

 Was the server actually running?

 Did you check to see if Tomcat was actually listening on the port?


 p


  2010/6/30 Paweł Zuzelski z...@xatka.net
 
  On Wed, 30 Jun 2010, Yue Yuanyuan wrote:
 
  I think i figure out what is going on. I need to run tomcat using root.
  But
  even I su to root and start tomcat using /etc/init.d/tomcat6 start. It
  stills runs under tomcat users.
  So how could I run it using root?
 
  It is a bad idea. Just use iptables to redirect 80 to .
 
  iptables -A PREROUTING -t nat -p tcp -dport 80 -j REDIRECT --to-ports
 
 
  (not tested, see man iptables for details).
 
  It is the simplest and the most reliable way to run tomcat on port 80.
 
  --
  Regards,
  Paweł
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 





Re: One question about change port to 80

2010-06-30 Thread André Warnier

Yue Yuanyuan wrote:

It is running. I did iptables now it works fine. I also did test on my
ubuntu. There is no problem. I just do not get it why I run the tomcat using
ROOT, but still I do not have the privilege to bind 80 port.



Probably because you are /not/ running Tomcat as root.
You are running the script /etc/init.d/tomcatx.y as root.
But that script does not run Tomcat directly. It runs jsvc, which runs Tomcat as another 
user (probably tomcat, check with ps -ef).

Examine the script /etc/init.d/tomcatx.y, to see what it does.

It is a good way to run Tomcat, so don't change it.


By the way, that script is not a part of the official Tomcat distribution from 
http://tomcat.apache.org. It is a script created by the people who packaged Tomcat for 
CentOS.  So not many people here know what it really does.





2010/6/30 Pid p...@pidster.com


On 30/06/2010 21:51, Yue Yuanyuan wrote:

is it a good idea to use vhost like this :
http://www.javathinking.com/2007/10/tomcat-with-apache2-virtual-hosts/
Thank you.
Best,
Gavin

That's an article from 2007.  Things have moved on since then.

Unless you really need HTTPD for some reason - you'll know if you do -
Tomcat is perfectly adequate and serves static files just as fast as HTTPD.

Instead of trying lots of different ways of installing Tomcat when you
run into a problem, let's try and resolve the particular issue you're
having.


If you've run Tomcat as root, and then run it as user 'tomcat' using
jsvc, you must remember to check all of the ownership permissions have
been changed on the tomcat installation to the 'tomcat' user.

Was the server actually running?

Did you check to see if Tomcat was actually listening on the port?


p



2010/6/30 Paweł Zuzelski z...@xatka.net


On Wed, 30 Jun 2010, Yue Yuanyuan wrote:


I think i figure out what is going on. I need to run tomcat using root.

But

even I su to root and start tomcat using /etc/init.d/tomcat6 start. It
stills runs under tomcat users.
So how could I run it using root?

It is a bad idea. Just use iptables to redirect 80 to .

iptables -A PREROUTING -t nat -p tcp -dport 80 -j REDIRECT --to-ports



(not tested, see man iptables for details).

It is the simplest and the most reliable way to run tomcat on port 80.

--
Regards,
Paweł

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org










-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org