美文网首页
centos tomcat安装

centos tomcat安装

作者: Sicerora | 来源:发表于2017-06-27 17:23 被阅读0次
    • 1. 安装jdk

      找到想要安装的jdk版本
        yum -y list java*
      
      安装jdk
        yum install java-1.8.0-openjdk.x86_64
      
    • 2. 安装tomcat

      选择安装目录
        cd /data
      
      下载最新的tomcat
        wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.0.M21/bin/apache-tomcat-9.0.0.M21.tar.gz
      
      解压
        tar -zxvf pache-tomcat-9.0.0.M21.tar.gz
      
      删除安装包
        rm -rf apache-tomcat-9.0.0.M21.tar.gz
      
    • 3. 优化tomcat配置

      更改server.xml
        vim apache-tomcat-9.0.0.M21/conf/server.xml
      
      server.xml配置参考如下
        <Connector port="8080" protocol="HTTP/1.1" URIEncoding="UTF-8" 
        minSpareThreads="25" maxSpareThreads="75" enableLookups="false" 
        disableUploadTimeout="true" connectionTimeout="20000" acceptCount="300" 
        maxThreads="300" maxProcessors="1000" minProcessors="5" 
        useURIValidationHack="false" compression="on" compressionMinSize="2048" 
        compressableMimeType="text/html,text/xml,text/JavaScript,text/css,text/plain" 
        redirectPort="8443" />
      
      更改catalina.sh
        vim apache-tomcat-9.0.0.M21/bin/catalina.sh
      
      内存设置验证
        java -Xmx6000M -version
      
      添加配置参考如下
        export JAVA_OPTS="-server -Xms6000M -Xmx6000M -Xmn2048M -Xss512k 
        -XX:+AggressiveOpts -XX:+UseBiasedLocking -XX:+DisableExplicitGC 
        -XX:MaxTenuringThreshold=15 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC  
        -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection 
        -XX:LargePageSizeInBytes=128m  -XX:+UseFastAccessorMethods 
        -XX:+UseCMSInitiatingOccupancyOnly -Djava.awt.headless=true"
      
    • 4. 启动tomcat

        apache-tomcat-9.0.0.M21/bin/startup.sh
      

    相关文章

      网友评论

          本文标题:centos tomcat安装

          本文链接:https://www.haomeiwen.com/subject/yqsecxtx.html