You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2008/05/27 19:32:45 UTC

[Solr Wiki] Update of "SolrTomcat" by NoblePaul

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The following page has been changed by NoblePaul:
http://wiki.apache.org/solr/SolrTomcat

------------------------------------------------------------------------------
     <Environment name="solr/home" type="java.lang.String" value="/my/solr/home" override="true" />
  </Context>
  }}}
+ 
+ ==== Setting Solr Home from web.xml of solr web app ====
+ Unzip the solr war into Tomcat webapp folder and add  the  following snippet into web.xml 
+ {{{
+  <env-entry>
+     <env-entry-name>solr/home</env-entry-name>
+     <env-entry-type>java.lang.String</env-entry-type>
+     <env-entry-value>/put/your/solr/home/here</env-entry-value>
+ </env-entry>
+ }}}
+ 
  
  A few things to keep in mind:
     * The "conf/Catalina/localhost" directory may not exist by default in your installation.  You may have to create it.

Re: [Solr Wiki] Update of "SolrTomcat" by NoblePaul

Posted by Chris Hostetter <ho...@fucit.org>.
: 2) The other options we have are not as easy as this (at least for a
: casual user). The most common means of deploying an app in tomcat is
: dropping the war file in the webapps folder. And the most common place
: to put in JNDI variables is web.xml

the casual user should not have to unwar and edit the web.xml -- 
particularly since doing so is something that would then need to be done 
on every upgrade -- that's what context fragments in tomcat are for.

Bottom line: the web.xml is not a "configuration" file, In general, users 
shouldn't need to worry about it's existence unless they wnat to (as 
"experienced" java users.

: 3) The documentation must be there in the wiki. Let us decide on where
: to keep it.

A new "Hacking Solr" page perhaps?



-Hoss


Re: [Solr Wiki] Update of "SolrTomcat" by NoblePaul

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
1) This is not tomcat specific
2) The other options we have are not as easy as this (at least for a
casual user). The most common means of deploying an app in tomcat is
dropping the war file in the webapps folder. And the most common place
to put in JNDI variables is web.xml
3) The documentation must be there in the wiki. Let us decide on where
to keep it.
--Noble

On Wed, May 28, 2008 at 1:34 AM, Chris Hostetter
<ho...@fucit.org> wrote:
>
> : +
> : + ==== Setting Solr Home from web.xml of solr web app ====
>
> 1) is this really Tomcat specific? I thought this could be done with any
> servlet container?
>
> 2) while this is another way to specify the Solr Home using JNDI, It
> doesn't seem right to classify this as "Configuring" because it requires
> people to muck with the war ... which makes upgrading harder.
>
> i would prefer to keep this info off the wiki, or move it somewhere where
> it's more clear that it's only for people who really wnat to "HACK" on the
> solr war.  (commented out in the web.xml like "path-prefix" perhaps?)
>
> Either way, i'm moving the info within SolrTomcat for the time being ...
> it was inserted in between an example context file and the notes about the
> example.
>
>
>
>
> -Hos

Re: [Solr Wiki] Update of "SolrTomcat" by NoblePaul

Posted by Chris Hostetter <ho...@fucit.org>.
: Some feedback from the user base. We build Solr from source (to include our
: site-specific customisations), and modify the web.xml before it goes into

I wouldn't categorize you as a basic user of Solr -- you know java, 
you write customizations and you build Solr from source.  You'd probably 
consider building Solr from source even if you weren't going to customize 
it.  you sir are not a "Solr User" you are a "Solr Hacker"

We have to be aware that there is a large population of Solr users that 
don't know anything about *writing* java -- nor should they.  It's enough 
that they learn about *running* java (and if they use a freindly servlet 
container, they don't even need to know that)

hence the importance of keeping information about "using solr" and 
"configuring solr" simple for non-Java speakers.


-Hoss


Re: [Solr Wiki] Update of "SolrTomcat" by NoblePaul

Posted by Andrew Savory <as...@apache.org>.
Hi,

2008/5/31 Chris Hostetter <ho...@fucit.org>:


> I think you are being a little too presumptuious about the user base ...
> just because people use a java app doesn't mean they understand the
> internals of how a WAR or JAR file works -- nor should they.


Some feedback from the user base. We build Solr from source (to include our
site-specific customisations), and modify the web.xml before it goes into
the war. I wouldn't be surprised if other people do similar. (I was on-site
with a bank not so long ago, who deployed to Websphere by unarchiving wars,
patching files, rearchiving and then deploying. Not best practice, but
common practice.)


Andrew.
--
asavory@apache.org / contact@andrewsavory.com
http://www.andrewsavory.com/

Re: [Solr Wiki] Update of "SolrTomcat" by NoblePaul

Posted by Chris Hostetter <ho...@fucit.org>.
: Adding the configuration as a comment in the actual web.xml is Ok, but
: then users should be informed that as an option (on the wiki). A user
: may never come to know that there is this comment in the web.xml which
: is an alternative way of specifying the solr home folder.

That is 100% exactly why i don't wnat this info on a wiki page about 
"configuring" solr -- if you don't already know what a web.xml file is, 
then you shouldn't be told about this information.  it is not a viable way 
to specify the solr home for typical users who might get confused into 
thinking the web.xml is a "configuration" file they should edit -- it's 
not.  it's part of the application, if you are customizing the application 
then fine, edit it as much as you want, edit the source code as much as 
you wnat to -- but users that expect things to just work when they upgrade 
will be really pissed off if they've muck with their web.xml based on this 
information.

I've pulled the info from SOlrTomcat and added it to a new HackingSolr 
page instead.






-Hoss


Re: [Solr Wiki] Update of "SolrTomcat" by NoblePaul

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
Adding the configuration as a comment in the actual web.xml is Ok, but
then users should be informed that as an option (on the wiki). A user
may never come to know that there is this comment in the web.xml which
is an alternative way of specifying the solr home folder.

On Sat, May 31, 2008 at 6:00 AM, Chris Hostetter
<ho...@fucit.org> wrote:
>
> :  In my general experience I have seen people deploying applications in
> : Tomcat by dropping in a war or by exploding the .war file  into
> : webapps folder. General tomcat users are more familiar with web.xml
> : than server.xml. So, this is a very useful information for that class
> : of users and this info was absent.
>
> I think you are being a little too presumptuious about the user base ...
> just because people use a java app doesn't mean they understand the
> internals of how a WAR or JAR file works -- nor should they.
>
> I'm pretty knowledgable about Java.  i understand WAR files, and yet: if i
> were evaluating a piece of java software whose configuration instructions
> suggested that i unpack the war and edit the web.xml to tell it where to
> get it's configuration file from, i would refuse to use that piece of
> software.  that's the java equivilent of a C program suggesting that you
> can specify it's config file by editing the bytes 1056 to 1311 of the
> executable to be the path to your config file.
>
> Absurd binary file editing analogies aside: even if editing web.xml is
> somewhat "easy" for people to do, it's a maintence headache anytime you
> want to upgrade solr. anyone who *isn't* very familiar with WAR files that
> follows this tip is going to decide Solr sucks the first time they
> go to upgrade because they are going to have to do it again (that's
> if we're lucky and remember they did it in the first place -- more
> then likely they'll forget they did it, upgrade, and everything
> will just stop working and they won't know why)
>
> Bottom line:
>  1) this is not about tomcat, so it doesn't belong on the tomcat wiki
>     page
>  2) this is not "configuration" so it doesn't belong on any
>     "configuration" based wiki page.
>
> : they do not know the exact syntax for adding one. (I myself googled to
> : figure it out, though I knew it was possible). Hence the
> : documentation.
>
> that seems to be an argument in favor of my suggestion: put a comment
> about this in the acutal web.xml -- then you don't have to look it up
> anywhere, it's already there.
>
>
> -Hoss
>
>



-- 
Regards,
Shalin Shekhar Mangar.

Re: [Solr Wiki] Update of "SolrTomcat" by NoblePaul

Posted by Chris Hostetter <ho...@fucit.org>.
:  In my general experience I have seen people deploying applications in
: Tomcat by dropping in a war or by exploding the .war file  into
: webapps folder. General tomcat users are more familiar with web.xml
: than server.xml. So, this is a very useful information for that class
: of users and this info was absent.

I think you are being a little too presumptuious about the user base ... 
just because people use a java app doesn't mean they understand the 
internals of how a WAR or JAR file works -- nor should they.

I'm pretty knowledgable about Java.  i understand WAR files, and yet: if i 
were evaluating a piece of java software whose configuration instructions 
suggested that i unpack the war and edit the web.xml to tell it where to 
get it's configuration file from, i would refuse to use that piece of 
software.  that's the java equivilent of a C program suggesting that you 
can specify it's config file by editing the bytes 1056 to 1311 of the 
executable to be the path to your config file.

Absurd binary file editing analogies aside: even if editing web.xml is 
somewhat "easy" for people to do, it's a maintence headache anytime you 
want to upgrade solr. anyone who *isn't* very familiar with WAR files that 
follows this tip is going to decide Solr sucks the first time they 
go to upgrade because they are going to have to do it again (that's 
if we're lucky and remember they did it in the first place -- more 
then likely they'll forget they did it, upgrade, and everything 
will just stop working and they won't know why)

Bottom line:
  1) this is not about tomcat, so it doesn't belong on the tomcat wiki 
     page
  2) this is not "configuration" so it doesn't belong on any 
     "configuration" based wiki page.

: they do not know the exact syntax for adding one. (I myself googled to
: figure it out, though I knew it was possible). Hence the
: documentation.

that seems to be an argument in favor of my suggestion: put a comment 
about this in the acutal web.xml -- then you don't have to look it up 
anywhere, it's already there.


-Hoss


Re: [Solr Wiki] Update of "SolrTomcat" by NoblePaul

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
On Wed, May 28, 2008 at 10:13 AM, Chris Hostetter
<ho...@fucit.org> wrote:
>
> : FWIW, Tomcat *does* support mechanisms to configure JNDI resources
> : (including the Solr Home setting) *without* modifying the WAR file
> : itself.  Indeed, that was really the motivation behind having JNDI
> : resources in the first place.  Two easy approaches:
>
> ...well, yeah ... no ones disputing that.  <Context> based JNDI
> declarations have been documented on teh wiki for a long time ... i'm
> specificly questioning the recent addition suggesting that unpacking the
> war and editing the web.xml as a way to "configure" the Solr Home.

This probably is very good for production (server.xml). Those who
deploy it in production are not novice users.

 In my general experience I have seen people deploying applications in
Tomcat by dropping in a war or by exploding the .war file  into
webapps folder. General tomcat users are more familiar with web.xml
than server.xml. So, this is a very useful information for that class
of users and this info was absent.

>
> : > i would prefer to keep this info off the wiki, or move it somewhere where
> : > it's more clear that it's only for people who really wnat to "HACK" on the
> : > solr war.  (commented out in the web.xml like "path-prefix" perhaps?)
>
> : So you want to *hide* information that some users will find useful?
> : That doesn't seem very user friendly :-).
>
> neither is suggesting that people need to find the web.xml for their app
> ... i'm not suggesting we "hide" anything, i'm saying that the typical
> Solr user should not be expected to understand what or where a web.xml is.
>
> The type of user that is that might want to set JNDI properties directly
> in the web.xml is a) going to be looking at the web.xml; and b)
> probably already going to know that's possible to set arbitrary
> JNDI props that way without us telling them -- general
> documenting about declaring the Solr Home using JNDI (which we have) is
> enough.
>
I am still not convinced that people get confused by seeing that there
are more than one ways of setting JNDI properties in a webapp. But,
they do not know the exact syntax for adding one. (I myself googled to
figure it out, though I knew it was possible). Hence the
documentation.

> Our advanced users who "get" how WARs work don't need info like this, and
> it can only confuse our novice users who don't know (and don't want to
> know) that much about the internals of a WAR.
>
>
> -Hoss
>
>

Re: [Solr Wiki] Update of "SolrTomcat" by NoblePaul

Posted by Chris Hostetter <ho...@fucit.org>.
: FWIW, Tomcat *does* support mechanisms to configure JNDI resources
: (including the Solr Home setting) *without* modifying the WAR file
: itself.  Indeed, that was really the motivation behind having JNDI
: resources in the first place.  Two easy approaches:

...well, yeah ... no ones disputing that.  <Context> based JNDI 
declarations have been documented on teh wiki for a long time ... i'm 
specificly questioning the recent addition suggesting that unpacking the 
war and editing the web.xml as a way to "configure" the Solr Home.

: > i would prefer to keep this info off the wiki, or move it somewhere where
: > it's more clear that it's only for people who really wnat to "HACK" on the
: > solr war.  (commented out in the web.xml like "path-prefix" perhaps?)

: So you want to *hide* information that some users will find useful?
: That doesn't seem very user friendly :-).

neither is suggesting that people need to find the web.xml for their app 
... i'm not suggesting we "hide" anything, i'm saying that the typical 
Solr user should not be expected to understand what or where a web.xml is.  

The type of user that is that might want to set JNDI properties directly 
in the web.xml is a) going to be looking at the web.xml; and b) 
probably already going to know that's possible to set arbitrary 
JNDI props that way without us telling them -- general 
documenting about declaring the Solr Home using JNDI (which we have) is 
enough.

Our advanced users who "get" how WARs work don't need info like this, and 
it can only confuse our novice users who don't know (and don't want to 
know) that much about the internals of a WAR.


-Hoss


Re: [Solr Wiki] Update of "SolrTomcat" by NoblePaul

Posted by Craig McClanahan <cr...@apache.org>.
On Tue, May 27, 2008 at 1:04 PM, Chris Hostetter
<ho...@fucit.org> wrote:
>
> : +
> : + ==== Setting Solr Home from web.xml of solr web app ====
>
> 1) is this really Tomcat specific? I thought this could be done with any
> servlet container?
>
> 2) while this is another way to specify the Solr Home using JNDI, It
> doesn't seem right to classify this as "Configuring" because it requires
> people to muck with the war ... which makes upgrading harder.
>

FWIW, Tomcat *does* support mechanisms to configure JNDI resources
(including the Solr Home setting) *without* modifying the WAR file
itself.  Indeed, that was really the motivation behind having JNDI
resources in the first place.  Two easy approaches:

* Define the <Context> element, including nested resource settings for
JNDI) in Tomcat's server.xml file.
  This isn't deploy-on-demand, but is perfectly reasonable for a
production environment.

* Using the manager app, deploy a context.xml file (including pointers
to the war and the JNDI settings)
  instead of deploying a war directly.  See the manager webapp docs
for more info.


> i would prefer to keep this info off the wiki, or move it somewhere where
> it's more clear that it's only for people who really wnat to "HACK" on the
> solr war.  (commented out in the web.xml like "path-prefix" perhaps?)
>

So you want to *hide* information that some users will find useful?
That doesn't seem very user friendly :-).

> Either way, i'm moving the info within SolrTomcat for the time being ...
> it was inserted in between an example context file and the notes about the
> example.
>
>
>
>
> -Hoss
>
>

Craig McClanahan

Re: [Solr Wiki] Update of "SolrTomcat" by NoblePaul

Posted by Chris Hostetter <ho...@fucit.org>.
: + 
: + ==== Setting Solr Home from web.xml of solr web app ====

1) is this really Tomcat specific? I thought this could be done with any 
servlet container?

2) while this is another way to specify the Solr Home using JNDI, It 
doesn't seem right to classify this as "Configuring" because it requires 
people to muck with the war ... which makes upgrading harder.

i would prefer to keep this info off the wiki, or move it somewhere where 
it's more clear that it's only for people who really wnat to "HACK" on the 
solr war.  (commented out in the web.xml like "path-prefix" perhaps?)

Either way, i'm moving the info within SolrTomcat for the time being ... 
it was inserted in between an example context file and the notes about the 
example.




-Hoss