Running Solr on Apache Tomcat

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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值