Deploy the Java web program running environment in the same network as the program.

Source: Internet
Author: User
Tags rpmbuild
Deployment path: Tomcat7.0.11/usr/local/tomcatJDK7/usr Deployment path:
Tomcat 7.0.11/usr/local/tomcat
JDK 7/usr/java/jdk1.7.0
MySQL 5.5.15
Eclipse/usr/local/eclipse (optional)
---------------------------------------------------------------------------------
Installation description:

JDK installation download rpm, installed in/usr/java/jdk1.7.0 (http://jdk7.java.net /)

Tomcat installation is simple, just download Binary Distributions (:Http://tomcat.apache.org/download-70.cgi), decompress to/usr/local/tomcat.

Install the matching server and client in MySQL5.5.15

Rpm Package installation reference command:
Rpm-ivh xxx. rpm installation rpm Package
Rpm-qa -- last | less: displays installed packages based on the installation date
Rpm-qa | grep mysql-I query whether the mysql package is installed (-I, case-insensitive)
Rpm-e delete the installed software package
Rpm-e mysql * -- nodpes force delete related software packages
Rpm -- test installation
Run rpm-qi to query the description of mysql suite.
Run rpm-qpl xxx. rpm to view the content in the rpm package.
Rpm-qc [d] configuration file and description file
Rpm-Uvh upgrade and installation
Rpmbuild -- bb SPECS/xxx. spec reinstall to compile xxx. spec Into an rpm package.
Rpmbuild -- rebuild packagename. src. rpm re-compile. src. rpm into an rpm package.

Source code compilation and installation (Classic)
./Configure check system information (./configure -- help | more help information, you can see the relevant parameter settings)
Make clean clear the files left before
Make compilation
Make install installation
Note: INSTALL the source code package. generally, decompress the file first. the installation process is roughly the previous steps. For more information, see INSTALL and READEME in the directory .)
---------------------------------------------------------------------------------
Rpm Package Installation notes:

Check whether it has been installed. uninstall the old version:

For example:
Check whether mysql is installed before
Command: rpm-qa | grep-I mysql
Delete Command: rpm-e -- nodeps package name
(Rpm-ev mysql-4.1.12-3.RHEL4.1)

Find the installation directory of mysql:
Command: find/-name mysql

Bytes -------------------------------------------------------------------------------------
Environment variable
If both jdk and tomcat are installed, you can configure environment variables.
According to the previously set path, the environment variable should be set as follows:
Export JAVA_HOME =/usr/java/jdk1.7.0
Export TOMCAT_HOME =/usr/local/tomcat
Export CLASSPATH =.: JAVA_HOME/lib/dt. jar: JAVA_HOME/lib/tools. jar: $ TOMCAT_HOME/common/lib:
Export PATH =/usr/java/jdk1.7.0/bin
Of course, there are many ways to set the environment variables. Here we provide a script that is directly executed in shell.
Bytes --------------------------------------------------------------------------------------
Start/Stop a service

After completing the preceding steps, run the following command in shell: java
Check whether java works properly.

Start tomcat:
Switch to TOMCAT_HOME/bin and execute
./Startup. sh
Or execute:
./Catalina. sh run
Both of them can start tomcat. The difference is that the latter can view the details!

When you stop tomcat,
Sometimes we execute commands
./Catalina. sh stop
Tomcat cannot be stopped because there are other processes that depend on it,

Bytes -----------------------------------------------------------------------------------------
View/kill processes
So how to kill these processes?

For example, if we cannot stop tomcat, we want to check who is using port 8080 and execute the following command:
Lsof-I: 3306
Here lsof refers to (list open files)
This will list all related processes and their IDs.
We can run the following command to kill these processes:
Kill-9 processid (replace processid with the relevant process id)

Sometimes, the pity will happen again, and some dead processes that can't be killed will come into being. it seems that you can only restart the system.
Bytes ------------------------------------------------------------------------------------
Deploy applications

Put war in the webapps Directory
Import mysql
Source test. SQL
Bytes ------------------------------------------------------------------------------------
View tomcat logs:

Viewing logs is fundamental to solving the problem.
There are several types of logs, including service startup logs and access logs.
They are under/TOMCAT_HOME/logs
Access logs are disabled by default.

To enable:
In server. xml Add
Directory = "logs" prefix = "localhost_access_log." suffix = ". txt"
Pattern = "common" resolveHosts = "false"/>
Bytes --------------------------------------------------------------------------------------

The ssh-based java web application developed in tomcat6.0 cannot run under tomcat5.5. after you click submit form, it does not jump to the controller specified by action for processing, this is because of the tomcat version.

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.