httpd-vhosts.conf


# Virtual Hosts
#
# Required modules: mod_log_config

# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot "/var/www/html/xxx"
    ServerName 域名
    ServerAlias 域名

    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    CustomLog "|/usr/local/sbin/cronolog /usr/local/apache-2.2.27/logs/access_log.%Y%m%d" combined
    <Directory />
        Options FollowSymLinks Includes
        AddType text/html .shtml .html htm
        AddOutputFilter INCLUDES .shtml .html .htm
        DirectoryIndex index.shtml index.html
        AllowOverride None
    </Directory>
    <Directory /var/www/html/xxx>
        Options FollowSymLinks Includes
        AllowOverride None
        Order allow,deny
        allow from all
        AddType text/html .shtml .htm
        AddOutputFilter INCLUDES .shtml .htm
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    #ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    #CustomLog ${APACHE_LOG_DIR}/access.log combined


JKMount /*.do DLOG4J
JKMount /*.action DLOG4J
JKMount /*.htm DLOG4J
JKMount /*.jsp DLOG4J
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot "/var/www/html/xxx"
    ServerName 域名
    ServerAlias 域名
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    CustomLog "|/usr/local/sbin/cronolog /usr/local/apache-2.2.27/logs/access_log.%Y%m%d" combined
    <Directory />
        Options FollowSymLinks Includes
        AddType text/html .shtml .html htm
        AddOutputFilter INCLUDES .shtml .html .htm
        DirectoryIndex index.shtml index.html
        AllowOverride None
    </Directory>
    <Directory /var/www/html/htqh_web>
        Options FollowSymLinks Includes
        AllowOverride None
        Order allow,deny
        allow from all
        AddType text/html .shtml .htm
        AddOutputFilter INCLUDES .shtml .htm
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    #ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    #CustomLog ${APACHE_LOG_DIR}/access.log combined


JKMount /*.do DLOG4J
JKMount /*.action DLOG4J
JKMount /*.htm DLOG4J
JKMount /*.jsp DLOG4J
</VirtualHost>







httpd.conf
引入mod_jk.so;

追加

JkWorkersFile conf/workers.properties
JkMountFile conf/uriworkermap.properties
JkLogFile logs/mod_jk.log
JkLogLevel warn
JKMount /*.do DLOG4J
JKMount /*.action DLOG4J
JKMount /*.htm DLOG4J
JKMount /*.jsp DLOG4J


workers.properties

#
# workers.properties
#

# list the workers by name

worker.list=DLOG4J, status

# localhost server 1
# ------------------------
worker.s2.port=8009
worker.s2.host=127.0.0.1
worker.s2.type=ajp13
worker.s2.stopped=0

worker.DLOG4J.type=lb
worker.retries=3
worker.DLOG4J.balanced_workers=s1
worker.DLOG4J.sticky_session=1

worker.status.type=status


uriworkermap.properties

/*=DLOG4J
/jkstatus=status

!/*.xml=DLOG4J
!/*.flv=DLOG4J
!/*.ico=DLOG4J
!/*.gif=DLOG4J
!/*.jpg=DLOG4J
!/*.jpeg=DLOG4J
!/*.png=DLOG4J
!/*.css=DLOG4J
!/*.js=DLOG4J
!/*.swf=DLOG4J
!/*.htm=DLOG4J
!/*.html=DLOG4J
!/*.shtml=DLOG4J
!/*.zip=DLOG4J
!/*.pdf=DLOG4J
!/*.txt=DLOG4J
!/*.doc=DLOG4J
!/*.docx=DLOG4J
!/*.xls=DLOG4J
!/*.xlsx=DLOG4J
!/*.ppt=DLOG4J
!/*.pptx=DLOG4J
!/*.rar=DLOG4J
!/*.arj=DLOG4J
!/*.exe=DLOG4J