Yum install Tomcat basic tutorial

  
 

Deploying java development web application under linux, generally adopts Tomact+jre environment (can not need apache), under RHEL and CentOS, you can use yum online automatic installation mode to install, the specific operation is as follows:

1, the basic environment installation configuration, such as operating system
(I use Centos6.3), network and host basic configuration, etc.

2, yum install tomcat:

yum - y install tomcat6 tomcat6-webapps tomcat6-admin-webapps tomcat6-docs-webapp tomcat6-javadoc


yum install tomcat will automatically install related software, such as jre environment, so do not need to separate Install jre.

3, yum installation after the tomcat directory Description:

configuration file directory: /etc/tomcat6

installer main directory: /var/lib/tomcat6/

After Centos is installed with Centus, the Tomcat-related directories have been symbolically linked to the /usr/share/tomcat6 directory, including webapps, etc. This is very convenient for us to configure management [root@tomcattest tomcat6]# ll /usr/Share/tomcat6 total usage 4drwxr-xr-x. 2 root root 4096 October 19 00:44 binlrwxrwxrwx. 1 root tomcat 12 October 19 00:44 conf ->/etc/tomcat6lrwxrwxrwx. 1 root root 23 October 19 00 :44 lib ->/usr/share/java/tomcat6lrwxrwxrwx. 1 root root 16 October 19 00:44 logs ->/var/log/tomcat6lrwxrwxrwx. 1 root root 23 October 19 00:44 temp -> /var/cache/tomcat6/templrwxrwxrwx. 1 root root 24 October 19 00:44 webapps ->/var/lib/tomcat6/webappslrwxrwxrwx. 1 root root 23 October 19 00:44 work -> var/cache /tomcat6/work


4. Modify port 8080 to 80: 80 port is not occupied. You can use netstat -nat to check if port 80 is in use. a) Modify the 8080 in the following field of the vi /etc/tomcat6/server.xml file to 80

<Connector port="8080" protocol="HTTP/1.1"

connectionTimeout="20000"

redirectPort="8443" />b)Because in Centos6, the system does not allow tomcat users to use ports below 1024, so you need to modify vi /etc/tomcat6/Tomcat6.conf found CONNECTOR_PORT="8080" and commented out, add the following two lines: TOMCAT_USER="root"CONNECTOR_PORT="80" Note: The security of this is to be verified

c) Run the service tomcat6 restart command to restart the tomcat service. After accessing the page, you only need to enter the IP or host name, and you no longer need to add the port number.

Copyright © Windows knowledge All Rights Reserved