You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jim Coble <Ji...@duke.edu> on 2002/09/28 16:11:01 UTC

Re: Start Apache/Jakarta-Tomcat as Non-root user

I accomplished this yesterday on Solaris 8 using the following script 
called at system startup (linked to S40tomcat in rc3.d)  ... Replace 
"tomcat" after the two su commands with the user you want Tomcat to run as 
and, of course, change the paths as appropriate for your system.  You'll 
also need to make sure your tomcat user has appropriate permissions on 
your tomcat directories.
--Jim

#!/sbin/sh
#
# Jim Coble 09 Jun 02
# Modified 27 Sep 02 to try to get to run as user tomcat
 
CATALINA_HOME=/usr/local/tomcat;export CATALINA_HOME
JAVA_HOME=/usr/java;export JAVA_HOME
 
case "$1" in
start)
        su tomcat /usr/local/tomcat/bin/startup.sh
        sleep 5
        ;;
stop)
        su tomcat /usr/local/tomcat/bin/shutdown.sh
        ;;
*)
        echo "Usage: $0 {start|stop}"
        exit 1
        ;;
esac
 
exit 0

==================================
Jim Coble
Senior Technology Specialist
Center for Instructional Technology
Email: jim.coble@duke.edu
Voice: 919-660-5974  Fax: 919-660-5923
Box 90198, Duke University
Durham, NC 27708-0198
==================================





Lars Nielsen Lind <mo...@worldonline.dk>
09/28/2002 10:12 AM
Please respond to "Tomcat Users List"

 
        To:     tomcat-user@jakarta.apache.org
        cc: 
        Subject:        Start Apache/Jakarta-Tomcat as Non-root user


Hi.

Are the some easy ways to start Apache / Jakarta-Tomcat as Non-root user 
- for instance with a  user created for the purpose?

Are the any security risks (for instance access to root) to be aware of?

Best regards,

Lars Nielsen Lind


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>




RE: Start Apache/Jakarta-Tomcat as Non-root user

Posted by Thad Humphries <th...@mindwrap.com>.
In the example below, Jim Coble also set CATALINA_HOME and JAVA_HOME in
his S40tomcat script.

On Mon, 2002-09-30 at 10:12, Matt Raible wrote:
> I've modified your script for RedHat Linux 7.3, but my tomcat instance
> still won't start on bootup.  I can execute ./S40tomcat, enter the
> tomcat user's password and everything works fine.  Any ideas or log
> files I can check?
> 
> #!/bin/bash
> #
> # Matt Raible 29 Sep 2002
> # For use on RedHat Linux - tested on v7.3
> 
> case "$1" in
> start)
>         su tomcat /usr/local/tomcat1/bin/startup.sh
>         sleep 5
>         ;;
> stop)
>         su tomcat /usr/local/tomcat1/bin/shutdown.sh
>         ;;
> *)
>         echo "Usage: $0 {start|stop}"
>         exit 1
>         ;;
> esac
> 
> exit 0
> 
> 
> > -----Original Message-----
> > From: Jim Coble [mailto:Jim.Coble@duke.edu] 
> > Sent: Saturday, September 28, 2002 8:11 AM
> > To: Tomcat Users List
> > Subject: Re: Start Apache/Jakarta-Tomcat as Non-root user
> > 
> > 
> > I accomplished this yesterday on Solaris 8 using the following script 
> > called at system startup (linked to S40tomcat in rc3.d)  ... Replace 
> > "tomcat" after the two su commands with the user you want 
> > Tomcat to run as 
> > and, of course, change the paths as appropriate for your 
> > system.  You'll 
> > also need to make sure your tomcat user has appropriate 
> > permissions on 
> > your tomcat directories.
> > --Jim
> > 
> > #!/sbin/sh
> > #
> > # Jim Coble 09 Jun 02
> > # Modified 27 Sep 02 to try to get to run as user tomcat
> >  
> > CATALINA_HOME=/usr/local/tomcat;export CATALINA_HOME 
> > JAVA_HOME=/usr/java;export JAVA_HOME
> >  
> > case "$1" in
> > start)
> >         su tomcat /usr/local/tomcat/bin/startup.sh
> >         sleep 5
> >         ;;
> > stop)
> >         su tomcat /usr/local/tomcat/bin/shutdown.sh
> >         ;;
> > *)
> >         echo "Usage: $0 {start|stop}"
> >         exit 1
> >         ;;
> > esac
> >  
> > exit 0
> > 
> > ==================================
> > Jim Coble
> > Senior Technology Specialist
> > Center for Instructional Technology
> > Email: jim.coble@duke.edu
> > Voice: 919-660-5974  Fax: 919-660-5923
> > Box 90198, Duke University
> > Durham, NC 27708-0198
> > ==================================
>...
-- 
------------------------------------------------------------------------
Thad Humphries              "...no religious test shall ever be required
Web Development Manager      as a qualification to any office or public
Phone: 540/675-3015, x225    trust under the United States." -Article VI


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Start Apache/Jakarta-Tomcat as Non-root user

Posted by Matt Raible <ma...@raibledesigns.com>.
I've modified your script for RedHat Linux 7.3, but my tomcat instance
still won't start on bootup.  I can execute ./S40tomcat, enter the
tomcat user's password and everything works fine.  Any ideas or log
files I can check?

#!/bin/bash
#
# Matt Raible 29 Sep 2002
# For use on RedHat Linux - tested on v7.3

case "$1" in
start)
        su tomcat /usr/local/tomcat1/bin/startup.sh
        sleep 5
        ;;
stop)
        su tomcat /usr/local/tomcat1/bin/shutdown.sh
        ;;
*)
        echo "Usage: $0 {start|stop}"
        exit 1
        ;;
esac

exit 0


> -----Original Message-----
> From: Jim Coble [mailto:Jim.Coble@duke.edu] 
> Sent: Saturday, September 28, 2002 8:11 AM
> To: Tomcat Users List
> Subject: Re: Start Apache/Jakarta-Tomcat as Non-root user
> 
> 
> I accomplished this yesterday on Solaris 8 using the following script 
> called at system startup (linked to S40tomcat in rc3.d)  ... Replace 
> "tomcat" after the two su commands with the user you want 
> Tomcat to run as 
> and, of course, change the paths as appropriate for your 
> system.  You'll 
> also need to make sure your tomcat user has appropriate 
> permissions on 
> your tomcat directories.
> --Jim
> 
> #!/sbin/sh
> #
> # Jim Coble 09 Jun 02
> # Modified 27 Sep 02 to try to get to run as user tomcat
>  
> CATALINA_HOME=/usr/local/tomcat;export CATALINA_HOME 
> JAVA_HOME=/usr/java;export JAVA_HOME
>  
> case "$1" in
> start)
>         su tomcat /usr/local/tomcat/bin/startup.sh
>         sleep 5
>         ;;
> stop)
>         su tomcat /usr/local/tomcat/bin/shutdown.sh
>         ;;
> *)
>         echo "Usage: $0 {start|stop}"
>         exit 1
>         ;;
> esac
>  
> exit 0
> 
> ==================================
> Jim Coble
> Senior Technology Specialist
> Center for Instructional Technology
> Email: jim.coble@duke.edu
> Voice: 919-660-5974  Fax: 919-660-5923
> Box 90198, Duke University
> Durham, NC 27708-0198
> ==================================
> 
> 
> 
> 
> 
> Lars Nielsen Lind <mo...@worldonline.dk>
> 09/28/2002 10:12 AM
> Please respond to "Tomcat Users List"
> 
>  
>         To:     tomcat-user@jakarta.apache.org
>         cc: 
>         Subject:        Start Apache/Jakarta-Tomcat as Non-root user
> 
> 
> Hi.
> 
> Are the some easy ways to start Apache / Jakarta-Tomcat as 
> Non-root user 
> - for instance with a  user created for the purpose?
> 
> Are the any security risks (for instance access to root) to 
> be aware of?
> 
> Best regards,
> 
> Lars Nielsen Lind
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 
> 
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>