Aliyun Ubuntu 14.04 64bit openjdk tomcat7 install

Source: Internet
Author: User
Tags nginx reverse proxy aliyun

My work environment:

Aliyun Ubuntu 14.04 64-bit


First phase: APT-Get Update (it is very important, otherwise will cause 404 error)

Second Phase: Installation referenced by other website information;

Install openjdk
[Email protected]: ~ $ Sudo apt-get-y install openjdk-7-jdk

Check JDK installation path:
[Email protected]: ~ $ Ls/usr/lib/JVM
Java-1.7.0-openjdk-i386 java-7-openjdk-commonjava-7-openjdk-i386 (some machine is amd64bit: java-1.7.0-openjdk-amd64 java-7-openjdk-commonjava-7-openjdk-amd64)

[Email protected]: ~ $ Ls/usr/lib/JVM/java-7-openjdk-i386
[Email protected]: ~ $ Ls/usr/lib/JVM/java-7-openjdk-i386/bin

Add JDK environment variables:
[Email protected]: ~ $ Sudo nano/etc/profile

Export java_home =/usr/lib/JVM/java-7-openjdk-i386
Export jre_home =$ {java_home}/JRE
Export classpath =. :$ {java_home}/lib :$ {jre_home}/lib
Export path =$ {java_home}/bin :$ {jre_home}/bin: $ path


If machine CPU is amd 64bit:


[Email protected]: ~ $ Sudo nano/etc/profile

Export java_home =/usr/lib/JVM/java-7-openjdk-amd64
Export jre_home =$ {java_home}/JRE
Export classpath =. :$ {java_home}/lib :$ {jre_home}/lib
Export path =$ {java_home}/bin :$ {jre_home}/bin: $ path


 

Reboot Linux system, check Java Configuration:

[Email protected]: ~ $ ENV
[Email protected]: ~ $ Java-version
[Email protected]: ~ $ Echo $ java_home

 

 

Install apache2 and tomcat7

[Email protected]: ~ $ Sudo apt-get-y install apache2 apache2-prefork-dev libapr1-dev libaprutil1-dev
[Email protected]: ~ $ Sudo apt-Get update
[Email protected]: ~ $ Sudo apt-get-y install tomcat7 tomcat7-admin

 

After tomcat7 installation, the location and configuration as bellow:

/Usr/share/tomcat7
/Var/lib/tomcat7/webapps
/Etc/tomcat7/Catalina/localhost

 

From http://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/ Download sample. War, pubt sample. War to/var/lib/tomcat7/webapps and reboot tomcat7:

[Email protected]: ~ $ Sudo/etc/init. d/tomcat7 restart

 

Input the website as bellow in Explorer (My Host IP address 192.168.56.10)

Http: // 192.168.56.10: 8080/sample

Now you can see Sample Page, then we can make sure JDK and tomcat7 work normal.

 

 

Install SOLR 4.3.0


[Email protected]: ~ $ Sudo/etc/init. d/tomcat7 stop


[Email protected]: ~ $ Sudo tar xzvf solr-4.3.0.tgz

[Email protected]: ~ $ Ls solr-4.3.0/Dist.

Solr-4.3.0.war

 

Copy the extracted solr-4.3.0.war to tomcat7/webapps and change it to SOLR. War.

[Email protected]: ~ $ Sudo CP solr-4.3.0/Dist/solr-4.3.0.war/var/lib/tomcat7/webapps/SOLR. War

 

Create a directory/var/SOLR as the SOLR home directory (SOLR. SOLR. Home)

[Email protected]: ~ $ Sudo mkdir-P/var/SOLR

 

Copy the decompressed example/SOLR to the SOLR. SOLR. Home directory. This will be an instance of collection1.
[Email protected]: ~ $ Sudo CP-r solr-4.3.0/example/SOLR/*/var/SOLR

[Email protected]: ~ $ Ls/var/SOLR

[Email protected]: ~ $ Sudo chown-r tomcat7/var/SOLR

We recommend a SOLR. xml file in/etc/tomcat7/Catalina/localhost to specify the SOLR path.

[Email protected]: ~ $ Sudo nano/etc/tomcat7/Catalina/localhost/SOLR. xml

<Context docbase = "/var/lib/tomcat7/webapps/SOLR. War" DEBUG = "0" privileged = "true" allowlinking = "true" crosscontext = "true">
<Environment name = "SOLR/home" type = "Java. Lang. String" value = "/var/SOLR" override = "true">
</Environment>
</Context>

 

In the preceding settings, my SOLR. War (including the SOLR directory generated later) is stored in/var/lib/tomcat7/webapps.

While instance collection1 is stored in/var/SOLR

 

Put the instance collection1 (and core0, core1) path to the system variable (in the file/etc/profile ):


[Email protected]: ~ $ Sudo nano/etc/profile

Export java_options = "-dsolr. SOLR. Home =/var/SOLR $ java_options"

Copy the decompressed SOLR-related lib to the/lib directory of Tomcat 7:
[Email protected]: ~ $ Ls solr-4.3.0/example/lib/EXT

Jcl-over-slf4j-1.6.6.jar log4j-1.2.16.jar slf4j-log4j12-1.6.6.jar
Jul-to-slf4j-1.6.6.jar slf4j-api-1.6.6.jar

[Email protected]: ~ $ Ls/usr/share/tomcat7/lib

[Email protected]: ~ $ Sudo CP-r solr-4.3.0/example/lib/EXT/*/usr/share/tomcat7/lib

[Email protected]: ~ $ Sudo CP solr-4.3.0/example/resources/log4j. properties/usr/share/tomcat7/lib

Tomcat details: click here
Tomcat: click here

Related reading:

Upgrade Ubuntu 13.04 to maven3.10 to support openjdk7 http://www.linuxidc.com/Linux/2013-08/88844.htm

Compile and install openjdk 7 http://www.linuxidc.com/Linux/2013-03/81948.htm in Ubuntu 12.10

Http://www.linuxidc.com/Linux/2012-01/51731.htm of load balancing between APACHE and multiple Tomcat clusters in Linux

Nginx Tomcat Cluster load balancing solution notes http://www.linuxidc.com/Linux/2013-07/86827.htm

Example details Tomcat component installation + nginx reverse proxy Tomcat + Apache use mod_jk and mod_proxy Reverse Proxy and load balancing http://www.linuxidc.com/Linux/2013-06/85290.htm

Apache + Tomcat environment setup (jk deployment process) http://www.linuxidc.com/Linux/2012-11/74474.htm

In-depth analysis of Tomcat PDF http://www.linuxidc.com/Linux/2013-11/92595.htm

This article from the Linux community website (www.linuxidc.com) original link: http://www.linuxidc.com/Linux/2014-02/96398.htm




Aliyun Ubuntu 14.04 64bit openjdk tomcat7 install

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.