You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Duong BaTien <du...@gmail.com> on 2005/08/16 17:24:10 UTC
Re: How to automatically start tomcat 5.5.9 under linux using
local user
Greetings:
I set tomcat 5.5.9 running in port 8080 so it can be started without
using the root user. However, when I start tomcat using linux rc.local
at system start up (/apps/tomcat-5/bin/startup.sh), it seems that the
tomcat instance is started under root.
Question: Where do i set the user that starts tomcat instance via Redhat
Fedora Core start up?
Thanks.
BaTien
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: How to automatically start tomcat 5.5.9 under linux
using local user
Posted by Duong BaTien <du...@gmail.com>.
Thanks. I will take a look at it.
BaTien
On Tue, 2005-08-16 at 20:31 +0100, Darryl L. Miles wrote:
> Duong BaTien wrote:
>
> >I set tomcat 5.5.9 running in port 8080 so it can be started without
> >using the root user. However, when I start tomcat using linux rc.local
> >at system start up (/apps/tomcat-5/bin/startup.sh), it seems that the
> >tomcat instance is started under root.
> >
> >Question: Where do i set the user that starts tomcat instance via Redhat
> >
> >
> >Fedora Core start up?
> >
> >
>
> READ: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/setup.html
>
> Check out the "-user <username>" argument to "jsvc" which may not be so
> well documented.
>
>
> For non-root running check out "jsvc" bundled with Tomcat:
>
> Extracted TC to /opt/jakarta-tomcat-5.5.9
>
> # To run it as java service need to build jsvc
> cd $CATALINA_HOME/bin
> tar -zxvf jsvc.tar.gz
> cd jsvc-src
> autoconf
> JAVA_HOME="/opt/jdk1.5.0_04"
> export JAVA_HOME
> sh ./configure
> make
> cp jsvc ..
> cd ..
>
> # Create a system user for tomcat
> /usr/sbin/groupadd -g 155 jakarta
> /usr/sbin/useradd -u 155 -g jakarta -s /sbin/nologin jakarta
>
> # Fix all the permissions on the $CATALINA_HOME with
> chown jakarta. -R $CATALINA_HOME
>
> # This bit below you can put into your own startup script for TC and
> call each time
> JAVA_HOME="/opt/jdk1.5.0_04"
> export JAVA_HOME
> PATH="$JAVA_HOME/bin:$PATH"
> export PATH
>
> CATALINA_HOME=/opt/jakarta-tomcat-5.5.9
> export CATALINA_HOME
>
> cd $CATALINA_HOME
> ./bin/jsvc -Djava.endorsed.dirs=./common/endorsed -cp
> ./bin/bootstrap.jar \
> -outfile ./logs/catalina.out -errfile ./logs/catalina.err \
> -pidfile "./logs/jsvc.pid" \
> -user jakarta \
> org.apache.catalina.startup.Bootstrap
>
>
>
>
>
> Maybe you create a script in /etc/init.d/mytomcat that works the same
> way at the others in there ? Then symlink from each useful runlevel
> /etc/rc.d/rc[345].d/mytomcat -> /etc/initd.d/mytomcat, use
> /sbin/runlevel to see which you are at already.
>
> Maybe you are lazy and simply add a few lines to /etc/rc.local ?
>
>
> Eitherway should do the trick.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: How to automatically start tomcat 5.5.9 under linux using local
user
Posted by "Darryl L. Miles" <da...@netbauds.net>.
Duong BaTien wrote:
>I set tomcat 5.5.9 running in port 8080 so it can be started without
>using the root user. However, when I start tomcat using linux rc.local
>at system start up (/apps/tomcat-5/bin/startup.sh), it seems that the
>tomcat instance is started under root.
>
>Question: Where do i set the user that starts tomcat instance via Redhat
>
>
>Fedora Core start up?
>
>
READ: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/setup.html
Check out the "-user <username>" argument to "jsvc" which may not be so
well documented.
For non-root running check out "jsvc" bundled with Tomcat:
Extracted TC to /opt/jakarta-tomcat-5.5.9
# To run it as java service need to build jsvc
cd $CATALINA_HOME/bin
tar -zxvf jsvc.tar.gz
cd jsvc-src
autoconf
JAVA_HOME="/opt/jdk1.5.0_04"
export JAVA_HOME
sh ./configure
make
cp jsvc ..
cd ..
# Create a system user for tomcat
/usr/sbin/groupadd -g 155 jakarta
/usr/sbin/useradd -u 155 -g jakarta -s /sbin/nologin jakarta
# Fix all the permissions on the $CATALINA_HOME with
chown jakarta. -R $CATALINA_HOME
# This bit below you can put into your own startup script for TC and
call each time
JAVA_HOME="/opt/jdk1.5.0_04"
export JAVA_HOME
PATH="$JAVA_HOME/bin:$PATH"
export PATH
CATALINA_HOME=/opt/jakarta-tomcat-5.5.9
export CATALINA_HOME
cd $CATALINA_HOME
./bin/jsvc -Djava.endorsed.dirs=./common/endorsed -cp
./bin/bootstrap.jar \
-outfile ./logs/catalina.out -errfile ./logs/catalina.err \
-pidfile "./logs/jsvc.pid" \
-user jakarta \
org.apache.catalina.startup.Bootstrap
Maybe you create a script in /etc/init.d/mytomcat that works the same
way at the others in there ? Then symlink from each useful runlevel
/etc/rc.d/rc[345].d/mytomcat -> /etc/initd.d/mytomcat, use
/sbin/runlevel to see which you are at already.
Maybe you are lazy and simply add a few lines to /etc/rc.local ?
Eitherway should do the trick.
--
Darryl L. Miles
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org