You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Robin Rigby <ro...@josquin.com> on 2003/12/03 13:48:14 UTC

Auto start scripts

Have very limited experience of Linux or Tomcat.  Not even really sure
if this is a Tomcat issue or a Linux issue.

Main question:  How do I run a Tomcat4 script from /etc/rc.d/init.d so
that Tomcat starts automatically?

Tomcat works fine when I run startup.sh as root.  However, common sense
and many passing references on the mailing list suggest that root is not
the best choice.  

- What user do people normally use?
- Should I create a user for the purpose?
- What attributes and permissions should it have?
- Is this related to the "tomcat" "tomcat" element in the default
tomcat-users.xml?

I read somewhere that tar preserves file and directory permissions when
unpacking .tar.gz files.  However, everything now seems to be owned by
root (group also root), possibly because I unpacked it as root.  So when
I run Tomcat as tomcat, it dies of  'access denied'.  I have changed the
owner and group to tomcat for the logs and conf directories (so that
Tomcat can rewrite tomcat-users.xml ???) but I am very reluctant to do
too much of this without fully understanding why and what the downstream
consequences might be.  Most things now work but not the admin
application.

- What is the best practiced with regard to permissions?

Tomcat documentation seems to stop firmly at startup.sh and shutdown.sh
(unless I simply have not found the right page).  I have found FAQs and
tutorials that give sample scripts for various Linux distributions (none
so far for Fedora) but none of them work if the user and permissions are
not good.

- Can anyone please summarise what I need to do?  Best practice, even?
:-)
- Should it be documented?
- Would all this go away if there was an RPM?
- Is there an RPM?  :-)

Many thanks

Robin Rigby


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Auto start scripts

Posted by Nikola Milutinovic <Ni...@ev.co.yu>.
Robin Rigby wrote:
> Have very limited experience of Linux or Tomcat.  Not even really sure
> if this is a Tomcat issue or a Linux issue.
> 
> Main question:  How do I run a Tomcat4 script from /etc/rc.d/init.d so
> that Tomcat starts automatically?
> 
> Tomcat works fine when I run startup.sh as root.  However, common sense
> and many passing references on the mailing list suggest that root is not
> the best choice.  
> 
> - What user do people normally use?
> - Should I create a user for the purpose?
> - What attributes and permissions should it have?
> - Is this related to the "tomcat" "tomcat" element in the default
> tomcat-users.xml?

I'd sugest:

- download TC-4.1.24 RPMs and install them
- study it, see how it arranges files, permissions, etc...
- configure your own TC 4.1.29 accordingly
- or just (carefully) "paste" 4.1.29 over existing 4.1.24 RPM install

Setting up TC correctly or, even more, building your own RPMs can be very time 
consuming. The layout of 4.1.24 RPMs seams OK to me. There is a site, JPackage, 
I think, which has newer RPMs, but they have moved other packages from TC into 
separate ones (JavaMail, JDBC-ext,...), so getting it all together is not easy. 
Plus they have their own dependencies, which I couldn't provide on Mandrake.

Nixie.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org