1. Firstly, you need to install Apache Tomcat. The Tomcat installation is beyond the
scope of this book, so we will assume that you have already installed this servlet
container in the directory specified by the $TOMCAT_HOME system variable.
2. The next step is preparing the Apache Tomcat configuration files. To do that, we
need to add the following inscription to the connector definition in the server.xml
configuration file:
URIEncoding="UTF-8"
The portion of the modified server.xml file should look like this:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="UTF-8" />
3. Create a proper context file. To do that, create a solr.xml file in the $TOMCAT_
HOME/conf/Catalina/localhost directory. The contents of the file should
look like this:
<Context path="/solr">
<Environment name="solr/home" type="java.lang.String" value="/
home/solr/configuration/" override="true"/>
</Context>
4. The next thing is the Solr deployment. To do that, we need a solr.war file that
contains the necessary files and libraries to run Solr to be copied to the Tomcat
webapps directory. If you need some additional libraries for Solr to see, you should
add them to the $TOMCAT_HOME/lib directory.
5. The last thing we need to do is add the Solr configuration files. The files that you need
to copy are files like schema.xml, solrconfig.xml, and so on. Those files should
be placed in the directory specified by the solr/home variable (in our case, /home/
solr/configuration/). Please don't forget that you need to ensure the proper
directory structure. If you are not familiar with the Solr directory structure, please
take a look at the example deployment that is provided with standard Solr package.
6. Now we can start the servlet container by running the following command:
bin/catalina.sh start
In the log file, you should see a message like this:
Info: Server startup in 3097 ms
To ensure that Solr is running properly, you can run a browser, and point it to an address
where Solr should be visible, like the following: http://localhost:8080/solr/.
If you see the page with links to administration pages of each of the cores defined, that
means that your Solr is up and running.
scope of this book, so we will assume that you have already installed this servlet
container in the directory specified by the $TOMCAT_HOME system variable.
2. The next step is preparing the Apache Tomcat configuration files. To do that, we
need to add the following inscription to the connector definition in the server.xml
configuration file:
URIEncoding="UTF-8"
The portion of the modified server.xml file should look like this:
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="UTF-8" />
3. Create a proper context file. To do that, create a solr.xml file in the $TOMCAT_
HOME/conf/Catalina/localhost directory. The contents of the file should
look like this:
<Context path="/solr">
<Environment name="solr/home" type="java.lang.String" value="/
home/solr/configuration/" override="true"/>
</Context>
4. The next thing is the Solr deployment. To do that, we need a solr.war file that
contains the necessary files and libraries to run Solr to be copied to the Tomcat
webapps directory. If you need some additional libraries for Solr to see, you should
add them to the $TOMCAT_HOME/lib directory.
5. The last thing we need to do is add the Solr configuration files. The files that you need
to copy are files like schema.xml, solrconfig.xml, and so on. Those files should
be placed in the directory specified by the solr/home variable (in our case, /home/
solr/configuration/). Please don't forget that you need to ensure the proper
directory structure. If you are not familiar with the Solr directory structure, please
take a look at the example deployment that is provided with standard Solr package.
6. Now we can start the servlet container by running the following command:
bin/catalina.sh start
In the log file, you should see a message like this:
Info: Server startup in 3097 ms
To ensure that Solr is running properly, you can run a browser, and point it to an address
where Solr should be visible, like the following: http://localhost:8080/solr/.
If you see the page with links to administration pages of each of the cores defined, that
means that your Solr is up and running.