[TYPO3-Solr] Tomcat or Jetty?

Michiel Roos [netcreators] michiel at netcreators.com
Thu Aug 5 19:51:59 CEST 2010


On 8/5/10 12:55 PM, Ingo Renner wrote:
> With Jetty you'd need to do all that yourself. But if you do so, please
> feel free to document that in the wiki
> http://forge.typo3.org/projects/extension-solr/wiki or provide an
> install script for Jetty.

Hi,

Well, no. You don't have to do anything. You just start solr using jetty
and your favorite command line options right from the directory you find
start.jar in (all in one line):

java -jar -server -Xmx128M -Dfile.encoding=UTF8 -Djava.headless=True
start.jar

That's it. You're up.

But, you're in a terminal and you're attached to the process. This is
nice because you can see all the process output scrolling by. If you
want to log out of the session and leave solr running, you can start it
inside a screen session:

cd /var/www/solr/multicore && screen -S java -jar -server -Xmx128M
-Dfile.encoding=UTF8 -Djava.headless=True  start.jar

You can put the following in the rc.local to make it start when the
system boots up:

su - your_username -c "cd /var/www/solr/multicore && screen -S java -jar
-server -Xmx128M -Dfile.encoding=UTF8 -Djava.headless=True  start.jar"

If you are worried about security and run your Solr on another machine
than the one using it, you can close the default port and configure
access to 8983 through another frontend (like Apache) that supports nice
and familiar access control:

<VirtualHost 1.2.3.4:80>
        ServerName solr.somedomain.com

        ServerAdmin webmaster at somedomain.com

	<Directory />
		Options -Indexes
        </Directory>

        ProxyRequests Off
        ProxyPreserveHost on
        ProxyPass / http://127.0.0.1:8983/
        ProxyPassReverse / http://127.0.0.1:8983/

        <LocationMatch "(/solr/www.someuser.nl/*)">
                Order deny,allow
                Deny from all

                # www.someuser.nl
                Allow from 4.4.4.6
        </LocationMatch>
        <LocationMatch "(/solr/www.someuser.nl/admin/ping)">
                Order deny,allow
                Deny from all

                # www.someuser.nl
                Allow from 4.4.4.6
        </LocationMatch>
</VirtualHost>

You can re-attach to the screen any time you like and then detach again.
In my experience, jetty is very robust, the process has only hung up on
me once. The cause was a too low memory setting for the start command.
After fixing that it ran fine again.

So, if you like a light weight solution, I recommend Jetty.

-- 
Met vriendelijke groet / Warm regards,

Michiel Roos
Chief Technical Officer
Netcreators: Open Source, Open Minds, Open People


More information about the TYPO3-project-solr mailing list