server.xml, Modify this file and add web page compression function.

 <Connector port="8081" protocol="HTTP/1.1"
                noCompressionUserAgents="gozilla, traviata"                  compressableMimeType="text/html,text/xml,text/css,text/javascript,image/gif,image/jpg"
                redirectPort="8443" />

Domain name related settings in server.xml

  <Host name=""  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

        <Context path="" docBase="example" debug=""/>

Modify the Apache configuration file

Modify the /etc/httpd/conf/httpd.conf configuration file

Listen 80---Listen on port 80

----Turn on compression in the apache service settings, which WordPress uses----
<IfModule mod_deflate.c>
# 圧縮レベル 9
DeflateCompressionLevel 9
# 圧縮タイプ html、xml、php、css、js
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-javascript application/x-httpd-php
AddOutputFilter DEFLATE js css

ServerName address of the server

<Directory "/var/www">
    AllowOverride None
    # Allow open access:
    Require all granted----directory allow access

<IfModule dir_module>
    DirectoryIndex index.html index.php---Add PHP file type

 AddType application/x-compress .Z
 AddType application/x-gzip .gz .tgz-------More compressed formats

<VirtualHost>------IP address of the server
    ServerAlias's Java platform website domain name
    ProxyPass /images !
    ProxyPass /css !
    ProxyPass /js !
    ProxyPass /
    ProxyPassReverse / startup port
    SetEnv force-proxy-request-1.0.1
    SetEnv proxy-nokeepalive 1

<VirtualHost>------IP address of the server
    DocumentRoot /var/www/html/ownDirectory-----The main directory of your PHP WordPress site
    ServerAlias -----PHP wordpress website domain name
    DirectoryIndex index.php index.html
        <Directory /var/www/html/ownDirectory>-----The main directory of your PHP WordPress siteトリ
                options -indexes
                AllowOverride All
    RewriteRule .(svn|git)(/)?$ - [F]
    <IfModule mod_headers.c>
        Header set X-XSS-Protection "1; mode=block"
        Header always append X-Frame-Options SAMEORIGIN
    SetEnv force-proxy-request-1.0.1
    SetEnv proxy-nokeepalive 1

In this way, a WordPress website and a Java platform website can be deployed on one server, and the Apache service is used to proxy WordPress and reverse proxy Tomcat to complete the dual-platform website deployment.


Thanks for your support to bet365fans!