Tomcat Building and Java applications

Source: Internet
Author: User


we need to build tomcat before we build the opencms. Mysql Database

    1. Install the JDK First anddownload the JDK and apache-tomcat packages.

    2. (1) unpack the package first during the JDK installation command:tar–zxvf jdk–c/usr/local (JDK installation path )

(2) you will then need to add in the environment variable file

Exportjava_home=/usr/local/jdk1.6.0_45

Exportjre_home=/usr/local/jdk1.6.0_45/jre

Exportpath= $PATH: $JAVA _home/bin

Exportclasspath=.: $JAVA _home/lib

use command source/etc/profile to make it effective

we can use java–version to detect if the JDK was successfully installed.

If it appears:

[[Email protected]]# java-version

Javaversion "1.6.0_45"

Java (TM) SE Runtime Environment (build 1.6.0_45-b06)

Javahotspot (TM) 64-bit Server VM (build 20.45-b01, Mixed mode)

Indicates that the installation was successful.

If it appears:

Do not worry about the following situations

Usage:gij [OPTION] ... CLASS [ARGS] ...
To invoke Class.main, or
Gij-jar [OPTION] ... Jarfile [ARGS] ...
To execute a JAR file
Try ' gij--help ' for more information.

Feel very strange, how to appear gij, in the online search error occurred because the Linux system is not the default point to the JDK version of the installation , so, to view the next

[email protected] ~]# which Java
/usr/bin/java
[email protected] ~]# ls/usr/bin/java-l
lrwxrwxrwx. 1 root root 22 September 11:37/usr/bin/java-/etc/alternatives/java
[email protected] ~]# Ll/etc/alternatives/java
lrwxrwxrwx. 1 root root 35 September 11:37/etc/alternatives/java-/usr/lib/jvm/jre-1.5.0-gcj/bin/java
[email protected] ~]# java-version
java Version "1.5.0"
gij (GNU libgcj) version 4.4.7 20120313 (Red Hat 4.4.7-3)
Copyright (C) Free Software Foundation, Inc.
This was free software; see the source for copying conditions. There is NO
warranty; not even for merchantability or FITNESS for A particular PURPOSE.
OK, we see that the red font does point to the JDK I just installed myself, and the index needs to be introducedUse the Alternatives tool to modify:

[Email protected] ~]# Alternatives--install/usr/bin/java Java/usr/java/jdk1.7.0_25/bin/java 300

re-enter the java-version command to verify that there is still no change, OK, and one more important action:

[Email protected] ~]# Alternatives--config java

A total of 2 programs provide "Java".

Select command
-----------------------------------------------
*+ 1/usr/lib/jvm/jre-1.5.0-gcj/bin/java
2/usr/java/jdk1.7.0_25/bin/java

Press Enter to save the current selection [+], or type the selection number: 2

Be sure to execute source/etc/profile to make it effective ...

OK, all the changes have been completed, let's enter the Java command, see the results we want, problem solving.

    1. Start installing Tomcat

(1). TAR–ZXVF apache-tomcat-c/usr/local/tomcat

You can use cd/usr/local/tomcat/bin/

Execute the Startup script: /startup.sh

Netstat–an |grep:8080

to view the process . Ps-eaf |grep Tomcat

Access can also be seen.

    1. Yum install mysq-server msql Database

At first , MySQL didn't have a password.

Mysql-u root–p can log in directly.

You can use this command to modify the root password: set password for 'root'@'localhost'= PASSWORD('newpassword');

    1. we need to use the command UNIZP opencms will appear a Opencms.war

Copy the file to Tomcat 's WebApps .

when visiting: HTPP : //ip/cms/setup follow the steps to the line. Do not directly access the CMS will be an error. 404 will encounter a problem that needs to be/etc/my.cnf

Mysqld area. Add max_allowed_packet=16m . Restart the service.

Ok

Visit Http://ip/opencms/opencms/overview


This article from "The Dark before Dawn" blog, declined reprint!

Tomcat Building and Java applications

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.