The goal here is to get you up and running with solr using the default example core as quickly as possible. While this configuration can be used as a base for getting a production system ready, if you are new to solr keep in mind there are no security constraints here and are expected to have an application and/or proxy between solr and the public internet.
I've used these same instructions on CentOS 7, so that is an excellent option as well.
Download and extract the latest copy of solr from Apache's site and enter the extracted directory. I prefer to copy the example directory to production so there is a reference available to me later.
mkdir -p /srv/solr cp -R * /srv/solr/ cp -R /srv/solr/example /srv/solr/production
Create the user for this solr instance and set the permissions appropriately.
useradd -r solr -U chown -R solr:solr /srv/solr
Save the following with your preferred text editor at
[Unit] Description=Apache Solr After=network.target [Service] User=solr Group=solr WorkingDirectory=/srv/solr/production ExecStart=/usr/bin/java -jar start.jar [Install] WantedBy=multi-user.target
Now if you get an error that prevents you from starting the server, check the status of the solr service for logged details. In my case I recieved the following message and the
setsebool command resolved the issue.
If jvm exited with Out of Memory Error it is quite likely that your SELinux policy doesn't allow execmem access for the JVM. To solve this problem, use
setsebool -P httpd_execmem 1to allow execmem acces for processes in the httpd domain. Please bear in mind that this might affect other processess. For more information see