How do I set an option for a specific servlet if Tomcat is running as a service?

2009-08-16 Thread Aaron Aberg
Hi,

I'm using Linux CentOS with Plesk 9.2.1, Tomcat 5.5 and Solr 1.3.0. I
installed the solr war file through the plesk control panel but it
doesnt start up. The logs reveal that solr/home property needs to be
set before it can be started up. After some googling, I found out that
I could set the property in web.xml in the war file. This didn't seem
to work for me.

When I was first playing with solr, it was on a Windows machine and
its very simple to set this property. You can do it through the tomcat
service system tray application. However, I am using Linux now and I
believe that I need to set this option in JAVA_OPTS. I have seen a
bunch of examples where someone will export the variable etc and then
run the catalina.sh command. I can't do that. I need to start and stop
the service via plesk.

This is what I'm thinking. I see in /etc/passwd that the tomcat user
has a default path of /usr/share/tomcat5. I'm wondering if I could put
a .bashrc file in that directory and set the option there. Would that
work? Does anyone have an idea as to how I can solve this problem?

By the way the option should be something like:
JAVA_OPTS=-Dsolr.solr.home='/usr/share/tomcat5/solr'

Thanks in advance,
Aaron

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



Re: How do I set an option for a specific servlet if Tomcat is running as a service?

2009-08-16 Thread André Warnier

Aaron Aberg wrote:

Hi,

I'm using Linux CentOS with Plesk 9.2.1, Tomcat 5.5 and Solr 1.3.0. I
installed the solr war file through the plesk control panel but it
doesnt start up. The logs reveal that solr/home property needs to be
set before it can be started up. After some googling, I found out that
I could set the property in web.xml in the war file. This didn't seem
to work for me.

When I was first playing with solr, it was on a Windows machine and
its very simple to set this property. You can do it through the tomcat
service system tray application. However, I am using Linux now and I
believe that I need to set this option in JAVA_OPTS. I have seen a
bunch of examples where someone will export the variable etc and then
run the catalina.sh command. I can't do that. I need to start and stop
the service via plesk.

This is what I'm thinking. I see in /etc/passwd that the tomcat user
has a default path of /usr/share/tomcat5. I'm wondering if I could put
a .bashrc file in that directory and set the option there. Would that
work? Does anyone have an idea as to how I can solve this problem?

By the way the option should be something like:
JAVA_OPTS=-Dsolr.solr.home='/usr/share/tomcat5/solr'


Short answer :
In the directory where the Tomcat scripts (like startup.sh and 
catalina.sh) are located on your system, create the file setenv.sh if 
it does not exist yet, and add a line with your JAVA_OPTS there.  You 
probably want :

JAVA_OPTS=$JAVA_OPTS -Dsolr.solr.home='/usr/share/tomcat5/solr'
so as to not override any existing options.


Other than that, your question should really be posted to a CentOS 
forum, or a Solr forum.
People here know how a standard Tomcat package - as downloaded from 
tomcat.apache.org - gets installed and works, but do not know whatever 
changes the packagers for the CentOS version of Tomcat or Plesk or Solr 
have done to it.
It might or might not use the standard Tomcat startup scripts, like the 
setenv.sh mentioned above.
Your Tomcat probably gets started via a shell script like 
/etc/init.d/tomcat5.
You should read that script, see what it calls, then read those scripts, 
etc... to find out what really happens.



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



Re: How do I set an option for a specific servlet if Tomcat is running as a service?

2009-08-16 Thread David Smith
Aaron Aberg wrote:
 Hi,

 I'm using Linux CentOS with Plesk 9.2.1, Tomcat 5.5 and Solr 1.3.0. I
 installed the solr war file through the plesk control panel but it
 doesnt start up. The logs reveal that solr/home property needs to be
 set before it can be started up. After some googling, I found out that
 I could set the property in web.xml in the war file. This didn't seem
 to work for me.

 When I was first playing with solr, it was on a Windows machine and
 its very simple to set this property. You can do it through the tomcat
 service system tray application. However, I am using Linux now and I
 believe that I need to set this option in JAVA_OPTS. I have seen a
 bunch of examples where someone will export the variable etc and then
 run the catalina.sh command. I can't do that. I need to start and stop
 the service via plesk.

 This is what I'm thinking. I see in /etc/passwd that the tomcat user
 has a default path of /usr/share/tomcat5. I'm wondering if I could put
 a .bashrc file in that directory and set the option there. Would that
 work? Does anyone have an idea as to how I can solve this problem?

 By the way the option should be something like:
 JAVA_OPTS=-Dsolr.solr.home='/usr/share/tomcat5/solr'

 Thanks in advance,
 Aaron

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

   
So ... what I'm reading is you are starting tomcat as a service.  In
that case, there should be a script in /etc/init.d for starting/stopping
tomcat.  Take a look at that.  If the settings aren't in there, the
script may have comments pointing you in the right direction.  I don't
think the .bashrc will work because the tomcat account is probably
disabled.  That's the way all accounts used by linux/unix services are
for security reasons.  There is no interactive login to run a .bashrc
file from when tomcat starts or stops.

--David

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