Install jdk + tomcat + mysql in Linux

Source: Internet
Author: User
Tags import database
Install jdk + tomcat + mysql in Linux-Linux Enterprise Application-Linux server application information. 1. Install MySQL 5.0 in Linux
Because MySQL3 or MySQL4 in Linux is not required by the system. The original
Uninstall MySQL and then install the new one.
1.1 search for the original MySQL
[Root @ server tmp] rpm-qa | grep mysql
List Installed packages
[Root @ server tmp] rpm-qa | grep MySQL
List Installed packages
1.2 uninstall the packages listed above
[Root @ server tmp] # rpm-ev MySQL-3.23.57-1
[Root @ server tmp] # rpm-ev MySQL-shared-3.23.57-1
[Root @ server tmp] # rpm-ev MySQL-devel-3.23.57-1
......

1.3 download new MySQL
Log onto www.mysql.com and download the page
Http://dev.mysql.com/downloads/m... atic-x86-32bit-rpms
Select the machine architecture and operating system version you want to install.
If it is a common i386 PC and an open-source Linux version is installed, you can choose
Linux x86 generic RPM (statically linked against glibc 2.2.5) downloads

Download the correct version and continue.

1.4 install new MySQL
[Root @ server tmp] # rpm-ivh MySQL-server-5.0.37-0.i386.rpm
If you want to use a Client, you must also install the Client.
[Root @ server tmp] # rpm-ivh MySQL-client-5.0.37-0.i386.rpm

2. initialize the database
2.1 log on to the MySQL database
[Root @ server tmp] # mysql
2.2 create database ydobjectflow
Mysql> create database ydobjectflow;
Query OK, 1 row affected (0.00 sec)
2.3 create a database Login User
Mysql> grant all privileges on ydobjectflow. * to samland identified by "123456 ";
Query OK, 0 rows affected (0.00 sec)
Mysql> grant all privileges on ydobjectflow. * to samland @ localhost identified by "123456 ";
Query OK, 0 rows affected (0.00 sec)
2.4 import database structure and initial data
[Root @ server tmp] # mysql-usamland-p123456 ydobjectflow If you export data from mysql in windows to linux, you may encounter garbled data. The solution is to export the corresponding encoding file again, and the solution is to manually execute the SQL code of gbk. SQL.
Importing files exported from Linux to the same Linux system is normal.

3. Install JDK 1.4.2 (jdk1.5 and jdk1.6 are the same)
Download jdk1.4.2. If the rpm package is used, run the rpm-ivh command to install it.
If the package is self-decompressed by j *. rpm. bin, run
Chmod + x j *. rpm. bin
Then run./j *. rpm. bin to decompress it to j *. rpm.
Run again
Rpm-ivh j *. rpm

Add/etc/profile to Environment Variable
(Assume that jdk is installed on/usr/java/jdk1.4.2-08. Check the actual installation status)
Export JAVA_HOME =/usr/java/jdk1.4.2-08
Export CLASSPASTH =.:/usr/java/jdk1.4.2-08/lib:/usr/java/jdk1.4.2-08/jre/lib

* If jdk of different versions has been installed, You can uninstall it by uninstalling mysql.

4. install Tomcat
Download the Tomcat 5.0 compressed package, such as tomcat5.tar.gz (install tomcat5.5 and tomcat6)
Find a directory and decompress it.
[Root @ server local] # cd/usr/local
[Root @ server local] # tar-zxvf/tmp/Tomcat5.tar.gz

Modify/etc/profile and add variables
Export CATALINA_HOME =/usr/local/tomcat
You can also add the Automatic startup command as needed.
$ CATALINA_HOME/bin/startup. sh

5. Deploy the application
5.1 first copy the application code to a directory, such
/Opt/samland/myapp

5.2 create a deployment File
$ CATALINA_HOME/conf/Catalina/localhost/{myappname}. xml
The content is as follows:

DocBase = "/opt/samland/myapp" path = "/objectflow" reloadable = "false">

6. start tomcat
$ CATALINA_HOME/bin/startup. sh
Disable tomcat
$ CATALINA_HOME/bin/shutdown. sh
Related Article

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.