On Tue, Sep 7, 2010 at 3:40 PM, Pid <p...@pidster.com> wrote:
> On 07/09/2010 06:14, jan gestre wrote:
>> On Tue, Sep 7, 2010 at 1:02 PM, Wesley Acheson <wesley.ache...@gmail.com> 
>> wrote:
>>> On Tue, Sep 7, 2010 at 4:34 AM, jan gestre <ipcopper...@gmail.com> wrote:
>>>> I'm using the latest 6.0.29 binary
>>>> distribution, and I don't have an idea where to download jsvc, if it's
>>>> already included I don't know the location, could someone please
>>>> enlighten me on how to do this.
>>>>
>>> It can be downloaded as part of this bundle
>>> http://commons.apache.org/daemon/download_daemon.cgi. Instructions are
>>> here http://commons.apache.org/daemon/jsvc.html. Dunno how to use it
>>> even after reading the instructions though.
>
> Conveniently, the binary you need is included in tomcat/bin:
>
>  commons-daemon-native.tar.gz
>
> I'll assume Linux, as you didn't state explicitly which OS you're using.
>
>  tar -zxvf commons-daemon-native.tar.gz
>  cd commons-daemon-1.0.2-native-src
>  more RELEASE-NOTES.txt
>
>  cd unix
>  more INSTALL.txt
>
> ... follow the instructions therein.
>
>
> p
>

Hi Pid,

I've followed your instructions and was able to create the executable
jsvc however I don't know the next step, should I incorporate jsvc to
tomcat's init.d script, and change server.xml respectively? If yes,
how will I do it?
Tomcat is running as an unprivilege user.

Here is my tomcat start up file and server.xml  if it matters

#!/bin/bash
#
# tomcat       Starts Tomcat Java server.
#
#
# chkconfig: 345 88 12
# description: Tomcat is the server for
# Java servlet applications.
### BEGIN INIT INFO
# Provides: $tomcat
### END INIT INFO

JAVA_HOME=/usr/java/jdk1.6.0_21
export JAVA_HOME
TOMCAT_HOME=/usr/src/tomcat/bin
START_TOMCAT=/usr/src/tomcat/bin/startup.sh
STOP_TOMCAT=/usr/src/tomcat/bin/shutdown.sh

# Source function library.
. /etc/init.d/functions

[ -f $START_TOMCAT ] || exit 0
[ -f $STOP_TOMCAT ] || exit 0
RETVAL=0

umask 077

start() {
       echo -n $"Starting Tomcat Java server: "
       daemon su -c $START_TOMCAT tomcat
       echo
       return $RETVAL
}
stop() {
       echo -n $"Shutting down Tomcat Java server: "
       daemon su -c $STOP_TOMCAT tomcat
       echo
       return $RETVAL
}
restart() {
       stop
       start
}
case "$1" in
 start)
start
        ;;
  stop)
        stop
        ;;
  restart|reload)
        restart
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
esac

exit $?

-----

server.xml

<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
 <Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
<Listener className="org.apache.catalina.core.JasperListener" />
 <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"
/>
 <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener 
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
/>
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>
<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
</Host>
    </Engine>
  </Service>
</Server>

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

Reply via email to