Build a java environment in linux and a java environment in linux

Source: Internet
Author: User
Tags pscp

Build a java environment in linux and a java environment in linux

We recommend that you use EXCEL to view

Prepare files

Tomcat web container apache-tomcat-7.0.57.tar

Server-jre-7u76-linux-x64.tar java jdk java Runtime Environment

Putty.exe ssh connection Tool

Pscp.exe ssh upload and download Tool

File Installation File Upload

C: \ pscp.exe-r local file path user @ target ip: target path

Directory Creation

Mkdir/usr/local/java environment directory

Mkdir/usr/local/java/jdk directory

Mkdir/usr/local/java/tomcat directory

Music apache-tomcat-7.0.57.tar.gz/usr/local/java/tomcat/

Music server-jre-7u76-linux-x64.tar.gz/usr/local/java/jdk/

Decompress the file

Tar zxvf/usr/local/java/tomcat/apache-tomcat-7.0.57.tar.gz.

Tar zxvf/usr/local/java/tomcat/server-jre-7u76-linux-x64.tar.gz.

Install Jdk 1. Set JDK Environment Variables

Vi/etc/profile

ExportJAVA_HOME =/usr/local/java/jdk/jdk1.7.0 _ 76

ExportJAVA_BIN =/usr/local/java/jdk/jdk1.7.0 _ 76/bin

Export PATH = $ PATH: $ JAVA_HOME/bin

ExportCLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar

Export JAVA_HOME JAVA_BIN PATH CLASSPATH

./Etc/profile

2. Set quick reference for java and javac

Switch to the/usr/bin directory

Reset the reference addresses of java and javac

Ln-s-f/usr/local/java/jdk/jdk1.7.0 _ 76/jre/bin/java

Ln-s-f/usr/local/java/jdk/jdk1.7.0 _ 76/bin/javac

3. view the version number

Tomcat installation 1. Design tomcat Environment Variables

Vi/etc/profile

ExportTOMCAT_HOME =/usr/local/java/tomcat/apache-tomcat-7.0.57

./Etc/profile

Configuration 1. tomcat removes project name access

Add <Context path = "" docBase = "item"/>

Item: Your project name.

2. Set tomcat to port 80

<Connector port = "8080" protocol = "HTTP/1.1" connectionTimeout = "20000" redirectPort = "8443"/> change port to 80

Note: Port ing

Vi/etc/sysconfig/iptables

Replace the command that has opened port 22 with port 8080:

-A input-m state -- state NEW-m tcp-p tcp -- dport 8080-j ACCEPT

-A input-m state -- state NEW-m tcp-p tcp -- dport 80-j ACCEPT

Service iptables restart

 

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.