Replace the original OpenJDK in CentOS and install Tomcat

Source: Internet
Author: User

Replace the original OpenJDK in CentOS and install Tomcat

In CentOS Linux, install JDK and Tomcat independently.

Jdk is replaced by the original openjdk with the jdk-Oracle-6u38 version.

[Root @ kakaka usr] # java-version
Java version "1.6.0 _ 38"
Java (TM) SE Runtime Environment (build 1.6.0 _ 38-b05)
Java HotSpot (TM) Server VM (build ipv13-b02, mixed mode)

Download jdk-6u38-linux-i586-rpm.bin to/usr directory
Change executable permissions and install

[Root @ bkjia usr] # chmod + x jdk-6u38-linux-i586-rpm.bin
[Root @ bkjia usr] #./jdk-6u38-linux-i586-rpm.bin
[Root @ bkjia usr] # vi/etc/profile

Add environment variables at the end of the file

Export JAVA_HOME =/usr/java/jdk1.6.0 _ 38
Export CLASSPATH =.: $ JAVA_HOME/jre/lib/rt. jar: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export PATH = $ JAVA_HOME/bin: $ PATH

Make environment variables take effect

[Root @ bkjia usr] # source/etc/profile

Install tomcat

Bytes


Create user, view and SET Password

# Groupadd webserver
# Useradd-m-g webserver-G webserver webapp
# Id webapp
# Passwd webapp
 
# Vi/etc/sudoers

Find the line root ALL = (ALL) ALL and add it to the bottom

Webapp ALL = (ALL) ALL

Create a directory, change permissions, and install

# Mkdir/usr/local/tomcat
# Chown-R webapp: webserver/usr/local/tomcat
# Su webapp

Use webapppermission to put apache-tomcat-6.0.36.tar.gz to/usr/local/tomcat

$ Cd/usr/local/tomcat
$ Tar-zxvf apache-tomcat-6.0.36.tar.gz
$ Vi ~ /. Bash_profile

Add Environment Variables

CATALINA_BASE =/usr/local/tomcat/apache-tomcat-6.0.36
CATALINA_HOME =/usr/local/tomcat/apache-tomcat-6.0.36
PATH = $ PATH: $ HOME/bin: $ CATALINA_HOME/bin
Export PATH

Make environment variables take effect

$ Source ~ /. Bash_profile

In/usr/local/tomcat/apache-tomcat-6.0.36/conf, modify the tomcat-user.xml

<Role rolename = "manager"/>
<User username = "webapp" password = "webapp123" roles = "manager"/>

Modify the encoding in server. xml

<Connector port = "8080" URIEncoding = "UTF-8" protocol = "HTTP/1.1"
ConnectionTimeout = "20000"
RedirectPort = "8443" type = "regxph" text = "yourobjectname"/>

Modify bin/catalina. sh and add a line in row 230 to increase tomcat runtime memory.

JAVA_OPTS = "-server-Xms1024m-Xmx2048m-XX: PermSize = 128 M-XX: MaxPermSize = 256 m"

 

Load Balancing between Apache and multiple Tomcat clusters in Linux

Nginx Tomcat Cluster load balancing solution notes

Instance details Tomcat component installation + Nginx reverse proxy Tomcat + Apache use mod_jk and mod_proxy Reverse Proxy and load balancing

Install and configure JDK-7 in Linux CentOS 6.5

Install JDK 7 In Ubuntu (with Clojure download)

Install JDK 12.04 in Ubuntu

CentOS6.3 install JDK and environment Configuration

Install JDK 8 on Ubuntu 14.04

Install JDK graph analysis in Ubuntu

Build an Apache + Tomcat environment (JK deployment process)

Tomcat details: click here
Tomcat: click here

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.