Install java 8 or greater, check with:
Install solr:
Download /var/solr/data/dovecot/conf/solrconfig.xml:
Download /var/solr/data/dovecot/conf/schema.xml:
Re-start solr, enable it in chkconfig:
Configure dovecot for solr:
Edit custom/dovecot/configure.dovecot and add:
Run:
Enable plugin in dovecot:
Create /etc/dovecot/conf.d/90-solr.conf:
Rewrite dovecot confs:
Optional: Don't track user solr processes in lfd:
Logs are stored /var/solr/logs/solr.log, /var/log/maillog shouldn't show errors regarding fts_solr too.
Code:
java -version
Install solr:
Code:
wget -O solr-7.7.0.tgz http://apache.mirror.vu.lt/apache/lucene/solr/7.7.0/solr-7.7.0.tgz
tar xzf solr-7.7.0.tgz solr-7.7.0/bin/install_solr_service.sh --strip-components=2
bash install_solr_service.sh solr-7.7.0.tgz
su -m solr -c "/opt/solr/bin/solr create_core -c dovecot"
curl http://localhost:8983/solr/dovecot/config -d '{"set-user-property": {"update.autoCreateFields":"false"}}'
rm -f /var/solr/data/dovecot/conf/managed-schema
Download /var/solr/data/dovecot/conf/solrconfig.xml:
Code:
wget -O /var/solr/data/dovecot/conf/solrconfig.xml https://raw.githubusercontent.com/dovecot/core/master/doc/solr-config-7.7.0.xml
Download /var/solr/data/dovecot/conf/schema.xml:
Code:
wget -O /var/solr/data/dovecot/conf/schema.xml https://raw.githubusercontent.com/dovecot/core/master/doc/solr-schema-7.7.0.xml
Re-start solr, enable it in chkconfig:
Code:
service solr restart
chkconfig solr on
Configure dovecot for solr:
Code:
cd /usr/local/directadmin/custombuild
mkdir -p custom/dovecot/
cp -p configure/dovecot/configure.dovecot custom/dovecot/
Edit custom/dovecot/configure.dovecot and add:
Code:
--with-solr
Run:
Code:
./build dovecot
Enable plugin in dovecot:
Code:
mkdir -p custom/dovecot/conf/
echo 'mail_plugins = $mail_plugins quota zlib fts fts_solr' > custom/dovecot/conf/mail_plugins.conf
Create /etc/dovecot/conf.d/90-solr.conf:
Code:
plugin {
fts = solr
fts_solr = url=http://localhost:8983/solr/dovecot/
}
Rewrite dovecot confs:
Code:
./build dovecot_conf
Optional: Don't track user solr processes in lfd:
Code:
echo 'user:solr' >> /etc/csf/csf.pignore
service lfd restart
Logs are stored /var/solr/logs/solr.log, /var/log/maillog shouldn't show errors regarding fts_solr too.
Last edited: