Install and configure the Tomcat environment in CentOS 6.6
Experimental System: CentOS 6.6 _ x86_64
Prerequisites: Firewall and selinux are both disabled.
Experimental software: apache-tomcat-8.0.24 jdk-8u60-linux-x64 jeecms-v6
1. 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 // repeat the file to make the variable take effect.
3. Check whether JAVA is successfully installed:
Java-version
Ii. install 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
3. Configure tomcat
1. configure server. xml:
Vim/usr/local/tomcat/conf/server. xml
---------------------------------------------------------->
<Connector port = "80" protocol = "HTTP/1.1" // The default port is 8080, Which is changed to 80.
ConnectionTimeout = "20000"
RedirectPort = "8443" type = "regxph" text = "yourobjectname"/>
2. tomcat has a manager-gui Management page. You can skip this step if you want to use the management page that requires configuration management. Configure tomcat-users.xml:
Vim/usr/local/tomcat/conf/tomcat-users.xml
------------------------------------------------------------------------------->
<Role rolename = "manager-gui"/> // specify the manager-gui interface that a user can use.
<User username = "tomcat" password = "tomcat" roles = "manager-gui"/> // set the username and password to tomcat, Which is used on the 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. *" %>
<Html>
<Head>
<Title> test </title>
</Head>
<Body>
<%
Out. println ("Hello World! "); // Embed the java language
%>
</Body>
</Html>
4. Start the test:
Catalina. sh start
Open http: // 192.168.19.74 in the browser, open the Manager App Management page, and use the user name and password configured earlier to enter:
On the Management page, you can see that the test you just created has been loaded. Click in to view the test page. You can directly use http: // 192.168.19.74/test if the manager-gui is not configured before:
Iv. Expand lab
1. A lot of JAVA programs can be installed, here with JEECMS for demonstration, first put the program file, the program can be downloaded from the http://www.jeecms.com:
Unzip jeecmsv6.zip
Mv ROOT/usr/local/tomcat/webapps/cms
Catalina. sh stop
Catalina. sh start
2. Open http: // 192.168.19.74/cms in the browser and go to the installation page:
3. Write related parameters. mysql installation and usage will not be written here:
4. Restart the tomcat service and access http: // 192.168.19.74/cms/jeeadmin/jeecms/index. do, username admin, password:
Catalina. sh stop
Catalina. sh start
Now, the simple configuration demonstration of tomcat is complete. Thank you for watching. Thank you!
Install JDK + Tomcat in RedHat Linux 5.5 and deploy Java Projects
Tomcat authoritative guide (second edition) (Chinese/English hd pdf + bookmarks)
Tomcat Security Configuration and Performance Optimization
How to Use Xshell to view Tomcat real-time logs with Chinese garbled characters in Linux
Install JDK and Tomcat in CentOS 64-bit and set the Tomcat Startup Procedure
Install Tomcat in CentOS 6.5
Tomcat details: click here
Tomcat: click here
This article permanently updates the link address: