Before you begin this guide, you should have a FreeBSD 10.1 server.
Solr needs the Java Runtime Environment (JRE) version 1.8 or higher.
You can install it with commands:
# cd /usr/ports/java/openjdk8
# make install clean
This OpenJDK implementation requires a few file systems to be mounted for full functionality. Run these commands to perform the required mounts immediately:
mount -t fdescfs fdesc /dev/fd
mount -t procfs proc /proc
To make it permanent, you need the following lines in /etc/fstab:
fdesc /dev/fd fdescfs rw 0 0
proc /proc procfs rw 0 0
Now you can check your Java version like this:
# java -version
openjdk version "1.8.0_152"
OpenJDK Runtime Environment (build 1.8.0_152-b16)
OpenJDK 64-Bit Server VM (build 25.152-b16, mixed mode)
Now you can install Apache Solr with commands:
# cd /usr/ports/textproc/apache-solr
# make install clean
Make sure to edit the following files to adapt to your setup:
/usr/local/etc/solr.in.sh
/var/db/solr/solr.xml
/var/db/solr/log4j.properties
All files are configured to have your solr instances running in
/var/db/solr/<instancename>
For more information how to configure solr check the manual.
The port is configured to listen only on localhost, port 8983.
To have a working initial config, use:
# cp -R /usr/local/solr/example/example-DIH/solr/solr /var/db/solr/
# chown -R www /var/db/solr/solr
To rotate solr log files include /var/log/solr/ to your log rotation
configuration.
To enable the port execute:
sysrc solr_enable="YES"
And start it with:
# service solr start