Chris Baty escribĂ­o:
Hi guys,
I want to serve a site with few graphics so I decided to use Tomcat 5.5 as my 
server.  But I'm having difficulty getting  it to  run on port 80.  I read 
http://www.ibm.com/developerworks/java/library/l-secjav.html and decided to try 
xinetd.  I added this to /etc/xinetd/:
# Redirects any port 80 requests to port 8180 (to Tomcat)
service tomcat
{
    socket_type    = stream
    protocol    = tcp
    user        = root
    wait        = no
    port        = 80
    redirect    = localhost 8180
    disable        = no
}
it works great on that machine if I point my browser but remotely I get zilch.  
I've tried plugging in my ip address instead of localhost: zilch.  Could anyone 
point me in the right  direction?
Thanks.
Chris




      
____________________________________________________________________________________
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


You can also use the java service launcher that is located in the bin directory of the distribution. You need to compile it and install it. What it does is launch tomcat on port 80 as root, but changes the owner to be something else, like 'tomcat'. That way, you can run it on port 80, but not as root.

A way of launching it from say /etc/init.d is with a script like the following:


#!/bin/sh
#
# chkconfig: 345 86 15
# description: Tomcat Server
#
# Small shell script to show how to start/stop Tomcat using jsvc
# If you want to have Tomcat running on port 80 please modify the server.xml
# file:
#
#    <!-- Define a non-SSL HTTP/1.1 Connector on port 80 -->
#    <Connector className="org.apache.catalina.connector.http.HttpConnector"
#               port="80" minProcessors="5" maxProcessors="75"
#               enableLookups="true" redirectPort="8443"
#               acceptCount="10" debug="0" connectionTimeout="60000"/>
#
#
# Adapt the following lines to your configuration
JAVA_HOME=/usr/jdk
CATALINA_HOME=/opt/tomcat
CATALINA_BASE=/opt/webBaseDir
DAEMON_HOME=/usr/local/bin
TOMCAT_USER=tomcat
TMP_DIR=$CATALINA_BASE/temp
CATALINA_OPTS=" -Djava.library.path=/usr/local/apr/lib
 -Djava.awt.headless=true
 -Xms128M -Xmx512M
 -XX:+UseParallelOldGC
"
CLASSPATH=\
$CATALINA_HOME/bin/commons-daemon.jar:\
$CATALINA_HOME/bin/tomcat-juli.jar:\
$CATALINA_HOME/bin/bootstrap.jar

case "$1" in
  start)
    #
    # Start Tomcat
    #
    $DAEMON_HOME/jsvc \
    -user $TOMCAT_USER \
    -home $JAVA_HOME \
    -jvm server \
    -Dcatalina.home=$CATALINA_HOME \
    -Dcatalina.base=$CATALINA_BASE \
    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
    -Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties \
    -Djava.endorsed.dirs=$CATALINA_BASE/endorsed \
    -Djava.io.tmpdir=$TMP_DIR \
    -outfile $CATALINA_BASE/logs/catalina.out \
    -errfile '&1' \
    $CATALINA_OPTS \
    -cp $CLASSPATH \
    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.sh start/stop"
    exit 1
    ;;
esac

--
Brian Millett - [ Ivanova, "The Geometry of Shadows"]
"If it gets too bad I'll just gnaw it off at the ankle."


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to