Configuring the Tomcat environment under CentOS 6.6 installation
[Date: 2015-08-25] |
Source: Linux Community tae44 |
[Font: Big Small] |
Experimental system: CentOS 6.6_x86_64
Lab Prerequisites: Firewall and SELinux are off
Experimental software: apache-tomcat-8.0.24 jdk-8u60-linux-x64 jeecms-v6
First, install the Java environment
1. Install Java:
wget http://download.Oracle.com/otn-pub/java/jdk/8u60-b27/jdk-8u60-linux-x64.tar.gz
Tar XF jdk-8u60-linux-x64.tar.gz-c/usr/local/
cd/usr/local/
LN-SV jdk1.8.0_60 JDK
2. Configure Environment variables:
vim/etc/profile.d/jdk.sh
--------------------------------------------------->
Java_home=/usr/local/jdk
Path= $JAVA _home/bin: $PATH
Export Java_home PATH
<---------------------------------------------------
. /etc/profile.d/jdk.sh//Reread this file for the variable to take effect
3. See if Java is installed successfully:
Java-version
Ii. installation of Tomcat
1. Install Tomcat:
wget http://mirrors.cnnic.cn/apache/tomcat/tomcat-8/v8.0.24/bin/apache-tomcat-8.0.24.tar.gz
Tar XF apache-tomcat-8.0.24.tar.gz-c/usr/local/
cd/usr/local/
LN-SV apache-tomcat-8.0.24 Tomcat
2. Configure Environment variables:
vim/etc/profile.d/tomcat.sh
--------------------------------------------------->
Catalina_base=/usr/local/tomcat
Path= $CATALINA _base/bin: $PATH
Export PATH catalina_base
<---------------------------------------------------
. /etc/profile.d/tomcat.sh
3. View the Tomcat version status:
catalina.sh version
Third, configure Tomcat
1. Configure Server.xml:
Vim/usr/local/tomcat/conf/server.xml
---------------------------------------------------------->
<connector port= "protocol=" http/1.1 "//default port is 8080, changed to 80
connectiontimeout= "20000"
redirectport= "8443"/>
2.tomcat has Manager-gui admin page, want to use must configure administrative user, do not use can skip this step. Configuration tomcat-users.xml:
Vim/usr/local/tomcat/conf/tomcat-users.xml
------------------------------------------------------------------------------->
<role rolename= "Manager-gui"/>//Specify the interface that the user can use as Manager-gui
<user username= "Tomcat" password= "Tomcat" roles= "Manager-gui"/>//user name and password for Tomcat, used on Manager-gui interface
3. Create a test page:
Mkdir-pv/usr/local/tomcat/webapps/test/web-inf/{classes,lib}
vim/usr/local/tomcat/webapps/test/index.jsp
--------------------------------------------------------------->
<%@ page language= "java"%>
<%@ page import= "java.util.*"%>
<title>test</title>
<body>
<%
Out.println ("Hello world!"); Embed the Java language
%>
</body>
4. Start the test:
catalina.sh start
Open the http://192.168.19.74 with your browser and open the Manager App Admin page with the user name and password you previously configured to enter:
Into the management interface, you can see that the test you just created has been loaded, click in, you can see the testing page. You can open the Manager-gui directly using http://192.168.19.74/test without previously configuring it:
Iv. expansion of the experiment
1. Can install a lot of Java programs, here with Jeecms to do demo, first put in the program file, the program can be downloaded from http://www.jeecms.com:
Unzip Jeecmsv6.zip
MV root//usr/local/tomcat/webapps/cms
catalina.sh stop
catalina.sh start
2. The browser opens the Http://192.168.19.74/cms and goes to the installation page:
3. Write the relevant parameters, MySQL installation and use here no longer write:
4. Restart the Tomcat service and Access http://192.168.19.74/cms/jeeadmin/jeecms/index.do, username admin, password Password:
catalina.sh stop
catalina.sh start
At this point, the simple configuration of Tomcat demo finished, thank you for watching, thank you!
RedHat Linux 5.5 installs Jdk+tomcat and deploys Java projects http://www.linuxidc.com/Linux/2015-02/113528.htm
Tomcat authoritative Guide (second edition) (English-Chinese HD PDF + bookmark) http://www.linuxidc.com/Linux/2015-02/113062.htm
Tomcat Security Configuration and performance optimization http://www.linuxidc.com/Linux/2015-02/113060.htm
Using Xshell under Linux to view the Tomcat real-time log Chinese garbled solution http://www.linuxidc.com/Linux/2015-01/112395.htm
Install JDK and Tomcat under CentOS 64-bit and set up the Tomcat boot operation step http://www.linuxidc.com/Linux/2015-01/111485.htm
Installing Tomcat http://www.linuxidc.com/Linux/2015-01/111415.htm under CentOS 6.5
a detailed description of Tomcat : please click here
Tomcat : please click here.
Installation and configuration of Tomcat for Linux services