Tomcat配置支持war包部署

Tomcat配置支持war包部署

#cat /data/tomcat/conf/server.xml

<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="off" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
  
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <Service name="Catalina">
    <Connector port="8080" protocol="org.apache.coyote.http11.Http11AprProtocol"
        connectionTimeout="20000000"
        maxThreads="600" minSpareThreads="100" maxSpareThreads="500" 
        maxProcessors="75" minProcessors="5" acceptCount="700" enableLookups="false" URIEncoding="UTF-8"
        compression="on" disableUploadTimeout="true" noCompressionUserAgents="gozilla,traviata" useSendfile="false"
        compressableMimeType="text/html,text/xml,text/javascript,application/javascript,application/json,text/css,text/plain"
    />

    <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" keystoreFile="/data/cert/tomcat.keystore" keystorePass="qwe123"
           ciphers="TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_RC4_128_SHA,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA,SSL_RSA_WITH_RC4_128_SHA"
           URIEncoding="UTF-8"
    />


 <Engine name="Catalina" defaultHost="run.tidebuy.net">
        <Realm className="org.apache.catalina.realm.LockOutRealm">
                <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
        </Realm>
        <Host name="tomcat.run.tidebuy.net" appBase="webapps" unpackWARs="true" autoDeploy="true"></Host>
        <Host name="run.tidebuy.net"  appBase="/data/web/com.sem.view.market" unpackWARs="true" autoDeploy="true">
                <Alias>run.tidebuy.net</Alias>
                <Context path="/" docBase="/data/war/com.sem.view.market.war" privileged="true" antiResourceLocking="false" antiJARLocking="false" crossContext="true" caseSensitive="false" reloadable="false"/>
        </Host>
    </Engine>
  </Service>

</Server>

部署文件

 运行目录

 Nginx文件:

cat /etc/nginx/nginx.conf

user  nginx;
worker_processes  32;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    include       /etc/nginx/proxy.conf;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

#    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    tcp_nopush     on;

    keepalive_timeout  65;

    server {
        listen       80;
    server_name  localhost:8080;
 
        charset utf-8;

        location / {
        proxy_pass http://localhost:8080;
        }
    }

    server {
        listen       443 ssl;
        server_name  localhost:8443;

        ssl on;
        ssl_certificate /data/cert/tidebuy.crt;
        ssl_certificate_key /data/cert/tidebuy.key;

        location / {
        proxy_pass https://localhost:8443;
        }
    }

    gzip on;

    gzip_min_length 1k;
    gzip_buffers 4 32k;
    gzip_disable "MSIE [1-6].";
    gzip_http_version 1.1;
    gzip_comp_level 3;
    gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/javascript application/json;
    gzip_vary on;
    
#    more_set_headers "Server: tidebuy";
    
    include /etc/nginx/conf.d/*.conf;
}

 

 

 

 

 

posted @ 2020-10-13 19:13  —八戒—  阅读(1507)  评论(0编辑  收藏  举报