Skip to content
Timothy Legge edited this page Nov 20, 2018 · 7 revisions

Welcome to the docker-foswiki wiki!

Solr Notes

The following notes assume you have run Foswiki with the following command, configured, installed and enables SolrPlugin:

  1. sudo docker run --rm --name docker-foswiki -idt -p 80:80 -v foswiki_www:/var/www/foswiki:z -v nginx_conf:/etc/nginx/conf.d:z timlegge/docker-foswiki

Point {SolrPlugin}{Url} to the HostIP as the Solr Docker is accessible there

Grant Solr User access to Foswiki Solr Config

  1. sudo chown -R 8983:8983 /var/lib/docker/volumes/foswiki_www/_data/solr/configsets

Run Solr 5 temporarly and create the solr_foswiki directory

  1. sudo docker run --rm --name my_solr -d -P -p 8983:8983 -t solr:5
  2. sudo docker exec -it -u solr my_solr mkdir /opt/solr/server/solr/solr_foswiki
  3. sudo docker stop my_solr

Run Solr with the proper volumes mounted, assign proper permission and add Foswiki configs

  1. sudo docker run --rm --name my_solr -d -P -v solr_logs:/opt/solr/server/logs:z -v solr_configsets:/opt/solr/server/solr/configsets:z -v solr_foswiki:/opt/solr/server/solr/solr_foswiki:z -v foswiki_www:/var/www/foswiki:z -e GC_LOG_OPTS='' -e SOLR_LOG_LEVEL='WARN' -p 8983:8983 -t solr:5
  2. sudo chown -R 8983:8983 /var/lib/docker/volumes/solr_foswiki
  3. sudo docker exec -it -u solr my_solr cp -r /var/www/foswiki/solr/cores /opt/solr/server/solr/solr_foswiki/
  4. sudo docker exec -it -u solr my_solr ln -s /var/www/foswiki/solr/configsets/foswiki_configs /opt/solr/server/solr/configsets
  5. sudo docker stop my_solr

Final start to load the Foswiki Config

  1. sudo docker run --rm --name my_solr -d -P -v solr_logs:/opt/solr/server/logs:z -v solr_configsets:/opt/solr/server/solr/configsets:z -v solr_foswiki:/opt/solr/server/solr/solr_foswiki:z -v foswiki_www:/var/www/foswiki:z -e GC_LOG_OPTS='' -e SOLR_LOG_LEVEL='WARN' -p 8983:8983 -t solr:5

Testing Solr Index

Connect to foswiki container

Test the indexing

  1. cd /var/www/foswiki/tools
  2. ./solrindex Topic=WebHome

It should show you the files being indexed

Test the Search

  1. cd /var/www/foswiki/bin
  2. ./rest /SolrPlugin/search