CentOS Setup Configure Tomcat Environment

Source: Internet
Author: User
Tags chmod centos tomcat firewall

CentOS Installation Configuration Tomcat

Demo Environment

System: Linux CentOS 6.3 32 bits

Environment: None installed Apache, PHP, MySQL

Account Number: Root

First, download the relevant installation package

Note: You can first enter the #cd/usr/local//into the inside and then download (can also be based on their own circumstances)

1. Download JDK

2. Download Tomcat

Second, install JDK and Tomcat

Note: You can enter the #cd/usr/local//before executing the following command

1. Compile and install JDK

#chmod 777 Jdk-6u41-linux-i586-rpm.bin

#./jdk-6u41-linux-i586-rpm.bin

#按提示完成操作, the default installation path should be/usr/java/jdk1.6.0_41

2. Configure JDK

#vi/etc/profile

Add at Tail:

Export java_home=/usr/java/jdk1.6.0_41/

Export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH

Export lasspath=.:/ Usr/java/jdk1.6.0_41/lib:/usr/java/jdk1.6.0_41/jre/lib: $CLASSPATH

#source/etc/profile

#java-version/test installation of Java appears as follows

[Root@centos bin]# Java-version

Java Version "1.6.0_41"

Java (TM) SE Runtime Environment (build 1.6.0_41-b02)

Java HotSpot (TM) Client VM (build 20.14-b01, mixed mode, sharing)

(if there is almost no relationship, because I am a VM installed how much will be somewhat different)

3. Install Tomcat

#tar ZXVF apache-tomcat-7.0.35.tar.gz/Decompression

#mv apache-tomcat-7.0.35 Apache-tomcat/renamed

#cd/apache-tomcat/bin//Open this directory

#chmod 777 *.sh/Plus 777 privileges

#bash catalina.sh Start/start

Iii. Results of verification

Access http://192.168.1.251:8080/Access address ip:8080 if you can't access

#/etc/init.d/iptables Stop/Disable firewall again visit to see

We continue to talk about the optimization problem in depth. Like the CentOS we're going to talk about today, how do I set up boot tomcat to let the JSP project open?

CentOS set up tomcat boot

1, enter the editor

Vi/etc/rc.d/rc.local

2, after opening at the bottom of the copy below

Export jdk_home=/usr/java/jdk1.6.0_41

Export java_home=/usr/java/jdk1.6.0_41

/var/apache-tomcat/bin/startup.sh

3, restart the server, try to access.

Tips:

0, if the JDK and Tomcat installed directory is not the same as above, please modify the appropriate path

CentOS Tomcat modifies the default port

One, familiar with Tomcat configuration file

#/usr/local/apache-tomcat/conf/server.xml/Edit Tomcat configuration file

(assuming I am installed in/usr/local/apache-tomcat/the actual reference to your server installation path is whichever)

Open the configuration file and find the following section.

   <connector port= "8080" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8443"/>

  Second, modify the port

1, open the Tomcat configuration file

#vi/usr/local/apache-tomcat/conf/server.xml

2, open the Tomcat configuration file Press/8080 Fast Search

3, modify the port, press I, the 8080 modified to 80

4, press: Wq Save and exit

 Third, restart Tomcat and detect

1. Restart Tomcat Service

Deactivate #/var/apache-tomcat/bin/shutdown.sh

(if not, #cd/var/apache-tomcat/bin/to execute #shutdown.sh)

Enable #bash catalina.sh start/go to #/usr/local/apache-tomcat/bin/before operation

2. Try to access

Server IP such as http://192.168.1.251 if not accessible, check the firewall or have it started successfully

  CentOS Modify system default language encoding

First, the command mode modification

1, enter the editor

#vi/etc/sysconfig/i18n/Entry Editor

Put the default:

Lang= "ZH_CN. UTF-8 "/default is Chinese

Modified to:

Lang= "en_US. UTF-8 "/default is English

2, restart the system after testing, because the modified directly after the use or will appear.

Second, the installation system can also choose the system language, the proposed choice of English.

------------------------------------------------

System language: Chinese lang= "ZH_CN." UTF-8 "

System language: English lang= "en_US." UTF-8 "

CentOS Tomcat modifies the default port

One, familiar with Tomcat configuration file

#/usr/local/apache-tomcat/conf/server.xml/Edit Tomcat configuration file

(assuming I am installed in/usr/local/apache-tomcat/the actual reference to your server installation path is whichever)

Open the configuration file and find the following section.

   <connector port= "8080" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8443"/>

Second, modify the port

1, open the Tomcat configuration file

#vi/usr/local/apache-tomcat/conf/server.xml

2, open the Tomcat configuration file Press/8080 Fast Search

3, modify the port, press I, the 8080 modified to 80

4, press: Wq Save and exit

Third, restart Tomcat and detect

1. Restart Tomcat Service

Deactivate #/var/apache-tomcat/bin/shutdown.sh

(if not, #cd/var/apache-tomcat/bin/to execute #shutdown.sh)

Enable #bash catalina.sh start/go to #/usr/local/apache-tomcat/bin/before operation

2. Try to access

Server IP such as http://192.168.1.251 if not accessible, check the firewall or have it started successfully

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.