Re: Starting tomcat as user apache instead of root

2002-11-17 Thread Nikola Milutinovic
Randy Paries wrote:

Thanks
The problem is that they have to both read and write files

The weird thing is if I do a 
su - apache -c $TOMCAT_HOME/bin/startup.sh

It does not start

But if I do a 

su - tomcat -c $TOMCAT_HOME/bin/startup.sh

Is does. The one diff is that in the etc/passwd file
apache:x:48:48:Apache:/var/www:/bin/false
tomcat:x:505:48::/home/tomcat:/bin/bash 

su - user will execute login scripts and activate user's shell. As Apache 
has /bin/false for a shell, it will exit immediately. You should try su 
user -c instead. On our Tru64 UNIX su will complain if you try both - and 
-c.

So I assume it can not start because of the shell.

So how does apache start.


su apache -c /usr/local/apache2/bin/apachectl start


Should I just give apache a shell?


No.

Nix.


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




Re: Starting tomcat as user apache instead of root

2002-11-16 Thread jmong
That's one way and I've used that method successfully. The other is if 
the tomcat user simply needs read access to the files (not write 
access) just create a group that has both users and change the group 
perms on the directory

for example (assumes that web user is apache and tomcat user is tomcat)

webgroup::6:apache,tomcat

chmod 750 directory
chmod 640 file
chgrp webgroup directory
chgrp webgroup file

I'm pretty confident that should work and your tomcat server will be 
able to read the doc root 

Hope that helps

Jan-Michael

- Original Message -
From: Randy Paries [EMAIL PROTECTED]
Date: Saturday, November 16, 2002 6:08 am
Subject: Starting tomcat as user apache instead of root

 Hello,
 Currently I am starting tomcat as root. This is not the best thing to
 say the least
 Both tomcat and apache have to share files. (Actually I upload files
 using both)
 So I need to start tomcat as the user apache
 
 So how is this best way to do that?
 
 Should I do a su - apache -c $TOMCAT_HOME/bin/startup.sh
 ?
 
 Thanks
 
 
 --
 To unsubscribe, e-mail:   mailto:tomcat-user-
 [EMAIL PROTECTED]For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 


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




RE: Starting tomcat as user apache instead of root

2002-11-16 Thread Randy Paries
Thanks
The problem is that they have to both read and write files

The weird thing is if I do a 
su - apache -c $TOMCAT_HOME/bin/startup.sh

It does not start

But if I do a 

su - tomcat -c $TOMCAT_HOME/bin/startup.sh

Is does. The one diff is that in the etc/passwd file
apache:x:48:48:Apache:/var/www:/bin/false
tomcat:x:505:48::/home/tomcat:/bin/bash 

So I assume it can not start because of the shell.

So how does apache start. 

Should I just give apache a shell?

Thanks for any help

Randy


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, November 16, 2002 10:33 AM
To: Tomcat Users List
Cc: 'Tomcat Users List'
Subject: Re: Starting tomcat as user apache instead of root


That's one way and I've used that method successfully. The other is if 
the tomcat user simply needs read access to the files (not write 
access) just create a group that has both users and change the group 
perms on the directory

for example (assumes that web user is apache and tomcat user is tomcat)

webgroup::6:apache,tomcat

chmod 750 directory
chmod 640 file
chgrp webgroup directory
chgrp webgroup file

I'm pretty confident that should work and your tomcat server will be 
able to read the doc root 

Hope that helps

Jan-Michael

- Original Message -
From: Randy Paries [EMAIL PROTECTED]
Date: Saturday, November 16, 2002 6:08 am
Subject: Starting tomcat as user apache instead of root

 Hello,
 Currently I am starting tomcat as root. This is not the best thing to 
 say the least Both tomcat and apache have to share files. (Actually I 
 upload files using both)
 So I need to start tomcat as the user apache
 
 So how is this best way to do that?
 
 Should I do a su - apache -c $TOMCAT_HOME/bin/startup.sh
 ?
 
 Thanks
 
 
 --
 To unsubscribe, e-mail:   mailto:tomcat-user-
 [EMAIL PROTECTED]For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 


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


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