sudo tar -zxvf apache-tomcat-7.0.59.tar.gz -C /usr/local
sudo gedit /etc/environment
sudo cd /usr/local/apache-tomcat-7.0.59/bin sudo gedit catalina.sh
在文件末尾添加
CATALINA_HOME=/usr/local/apache-tomcat-7.0.59
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_67
sudo ./startup.sh
sudo tar -zxvf solr-4.10.2.tgz sudo cp -r ./solr-4.10.2/example/solr /usr/local
sudo cp -r ./solr-4.10.2/example/lib/ext /usr/local/apache-tomcat-7.0.59/lib sudo cp -r ./solr-4.10.2/example/resources /usr/local/apache-tomcat-7.0.59/lib
sudo cp ./solr-4.10.2/example/dist/solr-4.10.2.war /usr/local/apache-tomcat-7.0.59/webapps/solr.war
sudo cd /usr/local/solr sudo mkdir data sudo chmod a+w data
<dataDir>${solr.data.dir:}</dataDir>改为
<dataDir>${solr.data.dir:/usr/local/solr/data}</dataDir>
sudo gedit /usr/local/solr/collection1/conf/solrconfig.xml
sudo gedit /usr/local/apache-tomcat-7.0.59/conf/Catalina/localhost/solr.xml
添加也下内容:注意:检查文件格式是否正确,如果浏览器打开solr.xml能正常打开,则格式正确
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="/usr/local/apache-tomcat-7.0.59/webapps/solr.war" debug="0" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/usr/local/solr" override="true" />
</Context>
<!--
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>/put/your/solr/home/here</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
–->
修改为
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>/usr/local/solr</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
sudo cd /usr/local/apache-tomcat-7.0.59/bin sudo ./shutdown.sh sudo ./startup.sh sudo gedit /usr/local/apache-tomcat-7.0.59/webapps/solr/WEB-INF/web.xml