安装 tomcat + solr

Standard
##### wget tomcat #####
[tester@svr ~]$ wget  http://apache.freelamp.com/tomcat/tomcat-6/v6.0.29/bin/apache-tomcat-6.0.29.tar.gz
[tester@svr ~]$ ls
apache-tomcat-6.0.29.tar.gz
[tester@svr ~]$ tar xvf apache-tomcat-6.0.29.tar.gz 
[tester@svr ~]$ sudo mv apache-tomcat-6.0.29 /usr/local/
[tester@svr ~]$ wget http://www.xlpar.com/files/3/19tp60r2vu6nt6/jdk-6u21-linux-x64-rpm.bin
[tester@svr ~]$ ls
jdk-6u21-linux-x64-rpm.bin
[tester@svr ~]$ sudo mv jdk-6u21-linux-x64-rpm.bin /usr/java/
 
######## install jdk #########
[tester@svr ~]$ sudo mkdir /usr/java
[tester@svr ~]$ sudo mv jdk-6u21-linux-x64-rpm.bin /usr/java/
[tester@svr ~]$ cd /usr/java/
[tester@svr java]$ ls
jdk-6u21-linux-x64-rpm.bin
[tester@svr java]$ sudo chmod a+x jdk-6u21-linux-x64-rpm.bin 
[tester@svr java]$ sudo ./jdk-6u21-linux-x64-rpm.bin 
[tester@svr java]$ ls
default                   jdk-6u21-linux-x64-rpm.bin             sun-javadb-common-10.5.3-0.2.i386.rpm  sun-javadb-docs-10.5.3-0.2.i386.rpm
jdk1.6.0_21               latest                                 sun-javadb-core-10.5.3-0.2.i386.rpm    sun-javadb-javadoc-10.5.3-0.2.i386.rpm
jdk-6u21-linux-amd64.rpm  sun-javadb-client-10.5.3-0.2.i386.rpm  sun-javadb-demo-10.5.3-0.2.i386.rpm
[tester@svr java]$ cd jdk1.6.0_21/
[tester@svr jdk1.6.0_21]$ ls
bin        demo     jre  man          README_ja.html     register.html     register_zh_CN.html  src.zip
COPYRIGHT  include  lib  README.html  README_zh_CN.html  register_ja.html  sample               THIRDPARTYLICENSEREADME.txt
[tester@svr jdk1.6.0_21]$ ./bin/java -version
 
###### export java env #########
[tester@svr jdk1.6.0_21]$ sudo vi /etc/profile
[tester@svr jdk1.6.0_21]$ tail /etc/profile
    if [ -r "$i" ]; then
        . $i
    fi
done
 
unset i
unset pathmunge
export JAVA_HOME=/usr/java/jdk1.6.0_21
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
[tester@svr jdk1.6.0_21]$ source /etc/profile
[tester@svr jdk1.6.0_21]$ java -version
 
#### alternate open-java to jdk
[tester@svr sbin]$ sudo ./alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_21/bin/java 300
[tester@svr sbin]$ sudo ./alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_21/bin/javac 300
 
[tester@svr sbin]$ java --version
[tester@svr sbin]$ sudo ./alternatives --display java
 
[tester@svr sbin]$ sudo ./alternatives --config java
[tester@svr sbin]$ sudo ./alternatives --config javac
 
[tester@svr sbin]$ java -version
 
####### start tomcat ######
[tester@svr sbin]$ cd /usr/local/apache-tomcat-6.0.29/
[tester@svr apache-tomcat-6.0.29]$ ./bin/startup.sh 
Using CATALINA_BASE:   /usr/local/apache-tomcat-6.0.29
Using CATALINA_HOME:   /usr/local/apache-tomcat-6.0.29
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.29/temp
Using JRE_HOME:        /usr/java/jdk1.6.0_21
Using CLASSPATH:       /usr/local/apache-tomcat-6.0.29/bin/bootstrap.jar
 
[tester@svr apache-tomcat-6.0.29]$ sudo /sbin/service httpd restart
 
##### rename tomcat dir #####
[tester@svr local]$ sudo mv apache-tomcat-6.0.29 tomcat
[tester@svr local]$ sudo vi /etc/profile
export TOMCAT_HOME="/usr/local/tomcat"
[tester@svr local]$ source /etc/profile
 
##### install solr #####
[tester@svr local]$ cd
[tester@svr ~]$ wget http://labs.renren.com/apache-mirror/lucene/solr/1.4.1/apache-solr-1.4.1.tgz
 
[tester@svr ~]$ tar xvf apache-solr-1.4.1.tgz 
[tester@svr ~]$ ls
apache-solr-1.4.1  apache-solr-1.4.1.tgz
 
###### start solr example #####
[tester@svr ~]$ sudo mv apache-solr-1.4.1 /usr/solr
[tester@svr ~]$ cd /usr/solr/
[tester@svr solr]$ cd example/
[tester@svr example]$ java -jar start.jar 
 
[tester@svr example]$ sudo vi /etc/rc.local 
/usr/local/tomcat/bin/startup.sh
/usr/java/jdk1.6.0_21/bin/java -jar /usr/solr/example/start.jar
 
#now visit your web site http://localhost:8983/solr/admin/

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.