(newbie q) Connector vs running standalone Tomcat as root

2004-05-06 Thread Barnet Wagman
I'd like to hear people's opinions on the best way to have Tomcat 
accessible via standard ports (80 and 443).

As I understand it, under Linux (and other unixes), ports  1000 must be 
run as root.  I've also read that there are some difficulties running 
Tomcat as root.  I gather that the alternative is to run Tomcat via a 
connector from Apache.

I have no particular need to run Apache - nearly everything on the site 
I'm putting together requires Tomcat.  Is running Tomcat as a root 
process really impossible and/or problematic (under Linux)?  Are there 
any other downsides to running Tomcat as a standalone server?

Thanks

bw

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: (newbie q) Connector vs running standalone Tomcat as root

2004-05-06 Thread Parsons Technical Services
commons daemon

three machines
two TAOLinux  Tomcat 5.0.19
one RH9 Tomcat 4.1.29

Working fine.

For overkill here is a write-up I did for another poster.

How To set up RH9 and clones to start automatically and use port 80 with a
non root user.

If you have not created the user that you plan to specify in the script then
do this first.

Follow the directions under Tomcat setup located at:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/setup.html

This will create the executable needed by the script to start Tomcat.

If you followed the directions you will find the file jsvc in
$CATALINA_HOME/bin

In the$CATALINA_HOME/bin/jsvc-src/native directory there is a file named
Tomcat.sh or if you have the non Alpha package both a Tomcat.sh and
Tomcat5.sh

For this How To we are using TC5.

I renamed my file to tomcat to match the other files in init.d

#cp $CATALINA_HOME/bin/jsvc-src/native/Tomcat5.sh /etc/init.d/tomcat

#cd /etc/init.d

#vi tomcat   OR your editor of choice

Now edit the file to contain the proper environment setting for your
machine. When you are done it will look something like this:

# Adapt the following lines to your configuration
JAVA_HOME=/tomcat/java
CATALINA_HOME=/tomcat/tc5
DAEMON_HOME=/tomcat/tc5/bin
TOMCAT_USER=tomcat
TMP_DIR=/var/tmp
CATALINA_OPTS=
CLASSPATH=\
$JAVA_HOME/lib/tools.jar:\
$CATALINA_HOME/bin/commons-daemon.jar:\
$CATALINA_HOME/bin/bootstrap.jar

case $1 in
  start)
#
# Start Tomcat
#
$DAEMON_HOME/jsvc \
-user $TOMCAT_USER \
-home $JAVA_HOME \
-Dcatalina.home=$CATALINA_HOME \
-Djava.io.tmpdir=$TMP_DIR \
-outfile $CATALINA_HOME/logs/catalina.out \
-errfile '1' \
$CATALINA_OPTS \
-cp $CLASSPATH \
-Xms256m \
-Xmx384m \
org.apache.catalina.startup.Bootstrap
#
# To get a verbose JVM
#-verbose \
# To get a debug of jsvc.
#-debug \
;;

  stop)
#
# Stop Tomcat
#
PID=`cat /var/run/jsvc.pid`
kill $PID
;;

  *)
echo Usage tomcat start/stop
exit 1;;
esac

This is for an install of Tomcat 5 to the directory of /tomcat/tc5
The java home dir is /tomcat/java
If you followed the install directions your jsvc executable(DAEMON_HOME)
will be in /tomcat/tc5/bin ($CATALINA_HOME/bin) if not then do a search for
jsvc.

If you do not have the Tomcat5 version then change the line:

 org.apache.catalina.startup.BootstrapService

to this:

org.apache.catalina.startup.Bootstrap

I have added two setting for my memory:

-Xms256m \
-Xmx384m \

There are other way to set this in the file but mine works for me so I left
it alone. Set the values to meet your needs or delete if you plan to run the
default.

Now while you are still in the init.d directory
#./tomcat start
tomcat should start up and if you do a ps -ax you will see jsvc listed.

If you do then it's all down hill from here.

#cd /etc/rc3.d
#ln -s ../init.d/tomcat /etc/rc3.d/S15tomcat
#ln -s ../init.d/tomcat /etc/rc4.d/S15tomcat
#ln -s ../init.d/tomcat /etc/rc5.d/S15tomcat

Now to make life a little easier

#ln -s /etc/init.d/tomcat /usr/sbin/tomcat

Now from any prompt enter #tomcat stop or #tomcat start to stop/start
tomcat.

Just a note: The httpd starts at S15 also. If you are running both Tomcat
and Apache set this to either 16 to start it after Apache or 14 to start it
before Apache. I only run Tomcat so I used 15.

And just to let those who don't know only files that are named SXXsomething,
where XX is a two digit number that indicates the starting order of the
files, are started.

 The file with a KXXxx are not started. And yes that is an upper case S
or it will be ignored.

Good luck and watch for typos.

Doug
www.parsonstechnical.com


- Original Message - 
From: Barnet Wagman [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, May 06, 2004 4:45 PM
Subject: (newbie q) Connector vs running standalone Tomcat as root


 I'd like to hear people's opinions on the best way to have Tomcat
 accessible via standard ports (80 and 443).

 As I understand it, under Linux (and other unixes), ports  1000 must be
 run as root.  I've also read that there are some difficulties running
 Tomcat as root.  I gather that the alternative is to run Tomcat via a
 connector from Apache.

 I have no particular need to run Apache - nearly everything on the site
 I'm putting together requires Tomcat.  Is running Tomcat as a root
 process really impossible and/or problematic (under Linux)?  Are there
 any other downsides to running Tomcat as a standalone server?

 Thanks

 bw


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: (newbie q) Connector vs running standalone Tomcat as root

2004-05-06 Thread QM
On Thu, May 06, 2004 at 03:45:13PM -0500, Barnet Wagman wrote:
: As I understand it, under Linux (and other unixes), ports  1000 must be 
: run as root.

Yes and no.  The port must be *bound* by root, at which point the
process may switch to another user to perform the real work.



: I gather that the alternative is to run Tomcat via a 
: connector from Apache.

That's one of several options.
Others range from proxying to f/w redirects to commons-daemon ...

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: (newbie q) Connector vs running standalone Tomcat as root

2004-05-06 Thread Diego Algorta Casamayou
The easier way is just leave tomcat listening on 8080 and add a port 
redirection rule using netfilter.

- You just have to redirect incoming conections on port 80 to port 8080.
- Add proxyPort=80 on the Connector tag in server.xml.
Voila!
You're done.
Bytes
DAC
Barnet Wagman escribió:

I'd like to hear people's opinions on the best way to have Tomcat 
accessible via standard ports (80 and 443).

As I understand it, under Linux (and other unixes), ports  1000 must 
be run as root.  I've also read that there are some difficulties 
running Tomcat as root.  I gather that the alternative is to run 
Tomcat via a connector from Apache.

I have no particular need to run Apache - nearly everything on the 
site I'm putting together requires Tomcat.  Is running Tomcat as a 
root process really impossible and/or problematic (under Linux)?  Are 
there any other downsides to running Tomcat as a standalone server?

Thanks

bw

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]