标签:
先下载相应的软件yum search java | grep -i --color JDK升级:
yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel
unzip apache-tomcat-7.0.54.zip mv apache-tomcat-7.0.54 /data/tomcat7修改端口:/data/tomcat7/conf/server.xml
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />启动tomcat7:
cd /data/tomcat7/bin chmod +x ./shutdown.sh ./startup.sh ./catalina.sh ./startup.sh提示如下表示成功:
Using CATALINA_BASE: /data/tomcat7 Using CATALINA_HOME: /data/tomcat7 Using CATALINA_TMPDIR: /data/tomcat7/temp Using JRE_HOME: /usr Using CLASSPATH: /data/tomcat7/bin/bootstrap.jar:/data/tomcat7/bin/tomcat-juli.jar Tomcat started.访问:http://localhost:8080 查看
vi /data/tomcat7/conf/tomcat-users.xml将:
<!-- <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"/> -->改为:
<role rolename="manager-gui"/> <user username="你的账号" password="密码" roles="manager-gui"/>
unzip solr-4.9.0.zip cd solr-4.9.0 cp solr-4.9.0/dist/solr-4.9.0.war /data/tomcat7/webapps/solr.war修改solr索引文件主目录:/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> -->改为:
<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>创建solr索引目录:
mkdir -p /data/solr cp -rf solr-4.9.0/example/solr/* /data/solr/修改/data/solr/collection1/conf/solrconfig.xml:
${solr.data.dir:}改为:
${solr.data.dir:/data/solr/collection1/data}最后复制相应的jar文件(重要):
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最后重启tomcat7:
/data/tomcat7/bin/shutdown.sh /data/tomcat7/bin/startup.sh
标签:
原文地址:http://my.oschina.net/mejinke/blog/295146