Build a WEB application environment in Linux

Source: Internet
Author: User
Article Title: Build a WEB application environment in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

JAVA environment: j2sdk-1_4_2_05

Database Server: MySQL-4.0.20d

Web server: Tomcat5.0.27

JDBC driver: mysql-connector-java-3.0.14-production-bin.jar

1. Build a JAVA Runtime Environment

(1) to Sun Company download j2sdk-1_4_2_05-linux-i586-rpm.bin

(2) Change the file to an executable file:

[Root @ eframe62 tuzq] # chmod + x j2sdk-1_4_2_05-linux-i586-rpm.bin

(3) execute the self-extracting file:

[Root @ eframe62 tuzq] #./j2sdk-1_4_2_05-linux-i586-rpm.bin

(4) decompress to generate the rpm file j2sdk-1_4_2_05-linux-i586-rpm, install rpm:

[Root @ eframe62 tuzq] # rpm? Ivh j2sdk-1_4_2_05-linux-i586-rpm

(5) The file is installed in the/usr/java/j2sdk1.4.2 _ 05 directory. To facilitate a simple connection in the/usr directory:

[Root @ eframe62 usr] # ln? S/usr/java/j2sdk1.4.2 _ 05 jdk

(6) add environment variables:

[Root @ eframe62 usr] # export JAVA_HOME =/usr/jdk

[Root @ eframe62 usr] # export CLASSPATH = $ JAVA_HOME/lib: $ JAVA_HOME/jre/lib :.

[Root @ eframe62 usr] # export PATH = $ PATH: $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin

(7) Test the JAVA Runtime Environment: Write a java program for verification.

[Root @ eframe62 usr] # vi HelloWorld. java

Enter the following content:

Public class HelloWorld {

Public static void main (String args []) {

System. out. println ("Hello, Wrold ");

}

}

Write the disk and exit the Editor:

: Wq

[Root @ eframe62 usr] # javac HelloWorld. java

(No error)

[Root @ eframe62 usr] # java HelloWorld

Hello, World. The JAVA Runtime Environment has been set up.

2. Install the MySQL database

The MySQL database server can be downloaded from www.mysql.com. One is the two-step Installation Tool (compiled mysql-standard-4.0.20-pc-linux-i686.tar.gz). The installation is as follows:

(1) Add a user and group named mysql:

[Root @ eFrame62 root] # groupadd mysql

[Root @ eFrame62 root] # useradd-g mysql

(2) decompress the file to the/usr/local directory:

[Root @ eFrame62 root] # cd/usr/local

[Root @ eFrame62 local] # gunzip

(3) create a convenient connection:

[Root @ eFrame62 local] # ln-s/usr/local/mysql-standard-4.0.20-pc-linux-i686 mysql

(4) execute the mysql_install_db script to initialize the database (Create a system database and table ):

[Root @ eFrame62 local] # cd mysql

[Root @ eFrame62 mysql] # scripts/mysql_install_db -- user = mysql

If an error similar to the following occurs, add the -- force parameter:

Neither host 'eframe62' and 'localhost' cocould not be looked up with./bin/resolveip

(5) modify the owner:

[Root @ eFrame62 mysql] # chown-R root.

[Root @ eFrame62 mysql] # chown-R mysql data

[Root @ eFrame62 mysql] # chgrp-R mysql.

[1] [2] Next page

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.