作者:多米音乐_34306427 | 来源:互联网 | 2023-05-18 21:36
下载
wget http://mirror.bjtu.edu.cn/apache/lucene/solr/3.1.0/apache-solr-3.1.0.tgz
wget http://labs.renren.com/apache-mirror/tomcat/tomcat-7/v7.0.12/bin/apache-tomcat-7.0.12.tar.gz
tar zxvf apache-solr-3.1.0.tgz
tar zxvf apache-tomcat-7.0.12.tar.gz
mv apache-solr-3.1.0 /usr/local/solr
mv apache-tomcat-7.0.12 /usr/local/tomcat
配置
vi /etc/profile
#加在最底下
export Java_HOME=/usr/lib/jvm/jre-1.6.0-openjdk
export CLASSPATH=.:$JAVA_HOME/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
export TOMCAT_HOME=/usr/local/tomcat
export JAVA_OPT="$JAVA_OPTS -Dsolr.solr.home=/usr/local/solr/example/solr"
cp /usr/local/solr/dist/apache-solr-3.1.0.war /usr/local/tomcat/webapps/solr.war
vi /usr/local/tomcat/conf/Catalina/localhost/solr.xml
docBase="/usr/local/tomcat/webapps/solr.war" debug="0" crossContext="true">
name="solr/home" type="java.lang.String" value="/usr/local/solr/example/solr" override="true" />
>
vi /usr/local/solr/example/solr/conf/solrconfig.xml
#初始
<dataDir>${solr.data.dir:}dataDir>
#修改为
<dataDir>${solr.data.dir:/usr/local/solr/example/solr/data}dataDir>
vi /usr/local/tomcat/conf/tomcat-users.xml
#去掉注释块,加入以下内容
rolename="admin-gui"/>
rolename="admin-script"/>
rolename="manager-gui"/>
rolename="manager-script"/>
rolename="manager-jmx"/>
rolename="manager-status"/>
username="tomcat" password="s3cret" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-script,admin-gui"/>
启动
/usr/local/tomcat/bin/startup.sh
浏览
http://localhost:8080/manager/status
#
http://localhost:8080/solr/
#