zoukankan      html  css  js  c++  java
  • CentOS 6.6下安装配置Tomcat环境

    转自:http://www.linuxidc.com/Linux/2015-08/122234.htm

    实验系统:CentOS 6.6_x86_64

    实验前提:防火墙和selinux都关闭

    实验软件:apache-tomcat-8.0.24  jdk-8u60-linux-x64  jeecms-v6

    一、安装JAVA环境

    1.安装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.配置环境变量:

    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        //重读此文件,让变量生效

    3.查看JAVA是否安装成功:

    java -version

    二、安装tomcat

    1.安装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.配置环境变量:

    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.查看tomcat版本状态:

    catalina.sh version

    三、配置tomcat

    1.配置server.xml:

    vim /usr/local/tomcat/conf/server.xml
    ---------------------------------------------------------->
     <Connector port="80" protocol="HTTP/1.1"      //默认端口为8080,改为80
                connectionTimeout="20000"
                redirectPort="8443" />

    2.tomcat有manager-gui的管理页面,想要使用必须配置管理用户,不使用可以跳过此步。配置tomcat-users.xml:

    vim /usr/local/tomcat/conf/tomcat-users.xml
    ------------------------------------------------------------------------------->
    <role rolename="manager-gui"/>                                        //指定用户可以使用的接口为manager-gui
    <user username="tomcat" password="tomcat" roles="manager-gui"/>      //用户名和密码为tomcat,在manager-gui接口使用

    3.创建测试页面:

    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!");      //嵌入java语言
            %>
        </body>
    </html>

    4.启动测试:

    catalina.sh start

    用浏览器打开http://192.168.19.74,并打开Manager App管理页面,用之前配置的用户名和密码进入:

    进入管理界面,可以看到刚才创建的test已经装载了,点击进去,即可看到测试页面了。之前没有配置manager-gui的可以直接使用http://192.168.19.74/test打开:

    四、拓展实验

    1.可安装的JAVA程序很多,这里用JEECMS做演示,首先放入程序文件,程序可从http://www.jeecms.com下载:

    unzip jeecmsv6.zip
    mv ROOT/ /usr/local/tomcat/webapps/cms
    catalina.sh stop
    catalina.sh start

    2.浏览器打开http://192.168.19.74/cms,进入安装页面:

         

    3.写入相关参数,mysql的安装及使用这里不再写出:

    4.重启tomcat服务并访问http://192.168.19.74/cms/jeeadmin/jeecms/index.do,用户名admin,密码password:

    catalina.sh stop
    catalina.sh start

  • 相关阅读:
    transaction sql
    谈谈tempdb在系统中的重要作用
    Windows快捷键
    sp_addlinkedserver使用方法
    大型网站用户登录信息保存实现的探讨
    Proj EULibHarn Paper Reading: Graspan: A SingleMachine DiskBased Graph System for Interprocedural Static Analyses of LargeScale Systems Code
    Proj EULibHarn Paper Reading: Towards Efficient LargeScale Interprocedural Program Static Analysis on Distributed DataParallel Computation
    Proj EULibHarn Paper Reading: APICraft: Fuzz Driver Generation for Closedsource SDK Libraries
    Proj EULibHarn Paper Reading: Systemizing Interprocedural Static Analysis of LargeScale Systems Code with Graspan
    Proj EULibHarn Paper Reading: Chianina: An Evolving Graph System for Flow and ContextSensitive Analyses of Million Lines of C Code
  • 原文地址:https://www.cnblogs.com/tingyuxuanzhuzi/p/6645625.html
Copyright © 2011-2022 走看看