Deploy J2EE + MySql in Linux

Source: Internet
Author: User
1. Download Software:

1. jdk:

Address: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u26-download-400750.html

Software: jdk-6u26-linux-i586-rpm.bin [can run directly]

2. tomcat:

Address: http://tomcat.apache.org/download-70.cgi tar.gz version]

Software: apache-tomcat-7.0.19.tar.gz

3. myeclipse:

Address: http://www.myeclipside.com

Software: myeclipse-10.0-offline-installer-linux.run [direct operation]

4. mysql database :-------


Ii. Install software: [according to the linux file system structure, the custom software is generally installed under/usr/local]

1. Install jdk

1) copy the jdk-6u26-linux-i586-rpm.bin to/usr/local under RHEL.

2) Modify file permissions and execute the chmod 755 jdk-6u26-linux-i586-rpm.bin

3) Start installation, execute./jdk-6u26-linux-i586-rpm.bin

[Root @ RHEL6 local] #./jdk-6u26-linux-i586-rpm.bin
Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu ).
Inflating: jdk-6u26-linux-i586.rpm
Inflating: sun-javadb-common-10.6.2-1.1.i386.rpm
Inflating: sun-javadb-core-10.6.2-1.1.i386.rpm
Inflating: sun-javadb-client-10.6.2-1.1.i386.rpm
Inflating: sun-javadb-demo-10.6.2-1.1.i386.rpm
Inflating: sun-javadb-docs-10.6.2-1.1.i386.rpm // documentation
Inflating: sun-javadb-javadoc-10.6.2-1.1.i386.rpm // documentation


4) set the environment variables and add the following environment variable configuration at the end of/etc/profile.

# Set java environment

JAVA_HOME =/usr/java/jdk1.6.0 _ 26

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

Path = $ java_home/bin: $ path

Export java_home classpath path

5) restart the terminal

6) verify whether the installation is successful and run Java-version. The following information is displayed:

Java version "1.6.0 _ 26"

Java (TM) se Runtime Environment (build 1.6.0 _ 26-b03)

Java hotspot (TM) Client VM (build between 1-b02, mixed mode, sharing)


2. install Tomcat

1) Under/usr/local,

Tar xzvf apache-tomcat-7.0.19.tar.gz ---> Get tomcat directory

2) start Tomcat, enter the./tomcat/bin directory, and execute./startup. Sh.

3) Verify that the installation is successful by entering http: // 127.0.0.1: 8080/in the browser to check whether the home page of Tomcat is displayed.

4) Close Tomcat and run/usr/local/tomcat/bin/shutdown. Sh.

5) modify the Tomcat port number, VI/usr/local/tomcat/CONF/server. XML, search for 8080, and query the following content:

<Connector Port = "8080" protocol = "HTTP/1.1"

Connectiontimeout = "20000"

Redirectport = "8443" type = "regxph" text = "yourobjectname"/>

Change 8080 to 80 or another port.


3. Install myeclipse

1) Under/usr/local,

/Myeclipse-10.0-offline-installer-linux.run


4. Install MySQL

1) Compile and install | download RPM package | install with RHEL System Disk

2) Change the MySQL password:

Mysqladm-u Root Password 'redhat'

3) Start MYSQL:

./Usr/local/MySQL/bin/mysqld_save -- user = MySQL &

4) log on to MySQL:

Mysql-u root-P

5) view MySQL Character Set charset

Mysql> show charset // view all supported charsets

Mysql> show variables like '% set %' // view the current Character Set

6) change the MySQL character set to utf8

In/etc/My. CNF,

[Client] default-character-set = utf8;

[Mysqld] default-character-set = utf8;


Iii. Deployment and integration

1. Integrate J2EE:

1) In myeclipse, configure and use your own jdk and tomcat




------------------- Error VS solution -------------------------------------------------

Error 1: Cannot create PoolableConnectionFactory (Access denied for user 'root' @ 'localhost' (using password: YES ))

Solution 1: grant all on mysql. * to 'root' @ 'localhost' identified by 'redhat' with grant option;


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.