Download the corresponding software first
Tomcat7.0 click to download
Solr4.9 click to download
Solr4.9 requires jdk1.7, so you must upgrade Java first:
View the current version:
yum search java | grep -i --color JDK
Upgrade:
yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel
Install Tomcat 7:
unzip apache-tomcat-7.0.54.zipmv apache-tomcat-7.0.54 /data/tomcat7
Modify the port:/data/tomcat7/CONF/server. xml
The 8080 is:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
Start Tomcat 7:
cd /data/tomcat7/binchmod +x ./shutdown.sh ./startup.sh ./catalina.sh./startup.sh
The prompt is as follows:
Using CATALINA_BASE: /data/tomcat7Using CATALINA_HOME: /data/tomcat7Using CATALINA_TMPDIR: /data/tomcat7/tempUsing JRE_HOME: /usrUsing CLASSPATH: /data/tomcat7/bin/bootstrap.jar:/data/tomcat7/bin/tomcat-juli.jarTomcat started.
Access: http: // localhost: 8080
Set Tomcat GUI permissions:
vi /data/tomcat7/conf/tomcat-users.xml
Set:
<!-- <role rolename="tomcat"/> <role rolename="role1"/> <user username="tomcat" password="tomcat" roles="tomcat"/> <user username="both" password="tomcat" roles="tomcat,role1"/> <user username="role1" password="tomcat" roles="role1"/>-->
Changed:
<Role rolename = "Manager-Gui"/> <User Username = "your account" Password = "password" roles = "Manager-Gui"/>
Install solr4.9
unzip solr-4.9.0.zipcd solr-4.9.0cp solr-4.9.0/dist/solr-4.9.0.war /data/tomcat7/webapps/solr.war
Modify SOLR index file home directory:/data/tomcat7/webapps/SOLR/WEB-INF/Web. xml
<!-- <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> -->
Changed:
<env-entry-name>solr/home</env-entry-name> <env-entry-value>/data/solr</env-entry-value> <env-entry-type>java.lang.String</env-entry-type> </env-entry>
Create solr index directory:
mkdir -p /data/solrcp -rf solr-4.9.0/example/solr/* /data/solr/
Modify/data/SOLR/collection1/CONF/solrconfig. xml:
${solr.data.dir:}
Changed:
${solr.data.dir:/data/solr/collection1/data}
Finally, copy the corresponding JAR file (important ):
cp -rf solr-4.9.0/example/lib/ext/* /data/tomcat7/lib/cp -rf solr-4.9.0/example/resources/log4j.properties /data/tomcat7/lib
Restart Tomcat 7:
/data/tomcat7/bin/shutdown.sh/data/tomcat7/bin/startup.sh
Centos5.8 install Tomcat 7 and solr4.9