在tomcat中运行solr-4.3.0

下载solr 4.3,tomcat,解压等操作不必多说.  

将解压后的solr下的dist目录中的solr-4.3.0.war ,copy到tomcat的webapps目录中,并改名为solr.war

 

Solr uses UTF-8 file encoding. That means that we need to ensure
that Apache Tomcat will be informed that all requests and responses made should use that
encoding. To do that, we modified the server.xml file in the way shown in the following code:

<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="UTF-8" />

 

The third step is to 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 the following code:

<Context path="/solr" docBase="/usr/share/tomcat/webapps/solr.war"
debug="0" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/
usr/share/solr/" override="true"/>
</Context>

以上配置中,docBase为tomcat/webapps/solr.war的路径,下面的路径为下载solr目录中example/solr的路径,根据自己需要更改配置

首先看这个http://wiki.apache.org/solr/SolrLogging   ,solr4.3的war包中不包含任何日志的jar包,你需要自己手动添加。将solr目录下example\lib\ext中的jar包copy到 tomcat的lib中。这时候虽然添加jar包,但是没有对应的日志配置,需要将example\resources中的 log4j.properties也放到tomcat/lib中。当然,你可以根据自己的需要更改配置。

 

启动tomcat,可以看到日志信息,确认已经成功启动  打开 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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值